Lux sensor triggers all "If else" but should only trigger one

Moderator: leecollings

Post Reply
Feddan
Posts: 7
Joined: Wednesday 18 October 2017 16:04
Target OS: -
Domoticz version:
Contact:

Lux sensor triggers all "If else" but should only trigger one

Post by Feddan »

I have the following Blockly "code":
MultiSensor4_TriggersAll.PNG
MultiSensor4_TriggersAll.PNG (273.06 KiB) Viewed 856 times
I've had problems getting it to work properly so I added a few debug messages to see which triggers that worked. Turns out that ALL of them trigger, when the Lux value is 0.

Is something broken or have I missed something?
Nautilus
Posts: 722
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Finland
Contact:

Re: Lux sensor triggers all "If else" but should only trigger one

Post by Nautilus »

Unfortunately nested if's do not work and with "else if" the conditions must be set so that all of them mutually exclude each other, otherwise all matching condition are executed even if a prior condition matches. See e.g. http://www.domoticz.com/forum/viewtopic ... fs#p128152
http://www.domoticz.com/forum/viewtopic ... fs#p151162
Feddan
Posts: 7
Joined: Wednesday 18 October 2017 16:04
Target OS: -
Domoticz version:
Contact:

Re: Lux sensor triggers all "If else" but should only trigger one

Post by Feddan »

Nautilus wrote: Wednesday 22 November 2017 10:43 Unfortunately nested if's do not work and with "else if" the conditions must be set so that all of them mutually exclude each other, otherwise all matching condition are executed even if a prior condition matches. See e.g. http://www.domoticz.com/forum/viewtopic ... fs#p128152
http://www.domoticz.com/forum/viewtopic ... fs#p151162
Thanks, that explains it!
Spitfire
Posts: 20
Joined: Thursday 29 December 2016 9:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Lux sensor triggers all "If else" but should only trigger one

Post by Spitfire »

Maybe a hijacking of the thread but does anyone know why the else if bug never is fixed? There are two control cmds in Domoticz and one of them doesn’t work...

This might sound very ungrateful but that is not my purpose I just want to know why there doesn’ t seem to be any interest at all to solve this which if solved would make Blocky so much more useful.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest