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

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 » Tuesday 21 November 2017 23:14

I have the following Blockly "code":
MultiSensor4_TriggersAll.PNG
MultiSensor4_TriggersAll.PNG (273.06 KiB) Viewed 202 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: 681
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

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

Post by Nautilus » Wednesday 22 November 2017 11: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

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 » Wednesday 22 November 2017 20:54

Nautilus wrote:
Wednesday 22 November 2017 11: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: 19
Joined: Thursday 29 December 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Contact:

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

Post by Spitfire » Saturday 16 December 2017 19:16

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