Page 1 of 1

Why is this event not working

Posted: Wednesday 12 April 2017 19:36
by svinedyret
I have made this event, it must check if one of my door switches are left open - but it's only the last switch in the "IF" chain that will react -
Why does it do this?
Domoticz IF Error.PNG
Domoticz IF Error.PNG (13.24 KiB) Viewed 2588 times

Re: Why is this event not working

Posted: Wednesday 12 April 2017 19:45
by kubrik
I don't use blockly events..but i think you would add the right comparisions...

if "Door Sw.." = On or Door SW WC Stuen.. = On etc..etc..
and not
If "Door Sw.." or Door SW WC Stuen..

Re: Why is this event not working

Posted: Wednesday 12 April 2017 19:46
by tozzke
You have to say for each switch what you need it to be before it triggers, so change it to:

Code: Select all

If [Door SW Entre] = [On] or [Door SW WC stuen] = [On] or [Door SW Terasse] = [On] or [Door SW Kitchen] = [On]
Do ...

HELP NOTHING WORKS

Posted: Wednesday 12 April 2017 20:09
by svinedyret
NOTHING WORKS
Please Help
I have two variables:
"Alarm State" which is = 2
and "Door SW State" which is = 3

The script stops here. This means that it does not accept the statement ???
What am I doing wrong with this "Event"
alarm state.PNG
alarm state.PNG (20.67 KiB) Viewed 2558 times
If anyone understands what I am trying to do.
How will it look like in LUA?

Best Regards Allan

Re: Why is this event not working

Posted: Thursday 13 April 2017 17:39
by tozzke
with Blockly (or even Domoticz altogether) you can't set the same variable which you already use in the if-statement. I believe it was because of preventing loops.
Replace in this blockly the variables with dummy switches and you'll see it'll work just fine

Re: Why is this event not working

Posted: Sunday 16 April 2017 6:53
by svinedyret
Thanks for help :-)