Page 1 of 1
Lux sensor triggers all "If else" but should only trigger one
Posted: Tuesday 21 November 2017 22:14
by Feddan
I have the following Blockly "code":

- MultiSensor4_TriggersAll.PNG (273.06 KiB) Viewed 906 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?
Re: Lux sensor triggers all "If else" but should only trigger one
Posted: Wednesday 22 November 2017 10:43
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
Re: Lux sensor triggers all "If else" but should only trigger one
Posted: Wednesday 22 November 2017 19:54
by Feddan
Thanks, that explains it!
Re: Lux sensor triggers all "If else" but should only trigger one
Posted: Saturday 16 December 2017 18:16
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.