Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

Scene gives error (lua)


EveWes

Question

Hello!
This scene run without problem last year. But now give me an error:

( I see in blockscene that i can build a scene with access to gardenpanel, will try this later)

[2024-06-23] [00:19:54] [ERROR] [SCENE584]: (load):3: syntax error near 'x'

 

 

{
  conditions = { {
      id = 230,
      isTrigger = true,
      operator = "==",
      property = "centralSceneEvent",
      type = "device",
      value = {
        keyAttribute = "Pressed3",
        keyId = 1
      }
    } },
  operator = "any"
}

 

print ("Alla sprinkler på från Nord till Väst")
local sprinkleralla({1910, 1909, 2033, 339, 2040, 2041, 338, 2398})
x = 5  --  5 sek vila mellan turnOn och turnOff
y = 20 --  60 sek drift av sprinkler, överrider 2 min default i sprinklersettings
hub.call(2398, 'forceWatering') -- Utevatten (huvudbrytare)
hub.sleep(x*1000)
hub.call(338, 'forceWatering')  -- Altanen (för kran+väst2-3)
hub.sleep(x*1000)
hub.call(1910, 'forceWatering') -- Nord1
hub.sleep(y*1000)
hub.call(1910, 'turnOff')
hub.sleep(x*1000)
--hub.call(?, 'forceWatering')  -- Nord2 när den är klar
--hub.call(?, 'turnOff')
--hub.sleep(x*1000)
hub.call(1909, 'forceWatering') -- Ost1-2
hub.sleep(y*1000)
hub.call(1909, 'turnOff')
hub.sleep(x*1000)
hub.call(2033, 'forceWatering') -- Syd1-2
hub.sleep(y*1000)
hub.call(2033, 'turnOff')
hub.sleep(x*1000)
hub.call(339, 'forceWatering')  -- Väst1
hub.sleep(y*1000)
hub.call(339, 'turnOff')
hub.sleep(x*1000)
hub.call(2040, 'forceWatering') -- Väst2
hub.sleep(y*1000)
hub.call(2040, 'turnOff')
hub.sleep(x*1000)
hub.call(2041, 'forceWatering') -- Väst3
hub.sleep(y*1000)
hub.call(2041, 'turnOff')
hub.sleep(x*1000)
hub.call(338, 'turnOff') -- Altanen
hub.sleep(x*1000)
hub.call(2398, 'turnOff') -- Utevatten
print ("Alla sprinkler skall vara av efter vattning")
hub.sleep(120000) --120 sek -- lägg till vilken sprinkler som inte är av
if sprinkleralla ~= turnOff then hub.call(sprinkleralla, 'turnoff')
hub.alert('simplePush', {[1] = 2420, }, 'Alla sprinkler är inte av!' , false, '')
print("Alla sprinkler är inte av!")
end

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Hi @EveWes ,

 

On the first look second line defining local variable should be:

Please login or register to see this code.

equal sing is missing and parentheses () are not needed.

 

Code after that I do not understand. I guess you plan to rewrite it using this local variable and loop?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...