Page 1 of 1

Strange IF DO ELSEIF in blocky ?

Posted: Monday 12 December 2016 20:45
by multinet
hello

I've this blocky :
Capture d’écran 2016-12-12 à 20.41.27.jpg
Capture d’écran 2016-12-12 à 20.41.27.jpg (99.25 KiB) Viewed 873 times
It compare a Lux devices to a user variable (set to 1500)
Lux is at 0 value (it is the night)

here is my log :

Code: Select all

2016-12-12 20:41:00.484 EventSystem: Event triggered: 999-test_1
2016-12-12 20:41:00.485 TEST
2016-12-12 20:41:00.486 TEST OK
2016-12-12 20:41:00.487 1500
2016-12-12 20:41:00.487 0
2016-12-12 20:41:00.488 TEST KO
2016-12-12 20:41:00.529 (Domoticz RPI B+) Lighting 2 (Vertigo (B+))
I don't understand why I have the IF and the ELSIF debig log (and all other actions) ?

why the comparison between my lux sensor and my user variable if TRUE in the 2 cases ?
Capture d’écran 2016-12-12 à 20.58.59.png
Capture d’écran 2016-12-12 à 20.58.59.png (51.4 KiB) Viewed 863 times
Thanks a lot
Multinet
Capture d’écran 2016-12-12 à 20.59.29.png
Capture d’écran 2016-12-12 à 20.59.29.png (59.32 KiB) Viewed 863 times

Re: Strange IF DO ELSEIF in blocky ?

Posted: Monday 12 December 2016 21:14
by StanHD
It's probably the "nested" "If" blocks. I do not think this works in Blockly. Can re-write with sequential "Else If" blocks to test?

Re: Strange IF DO ELSEIF in blocky ?

Posted: Monday 12 December 2016 21:19
by multinet
Hello

no this blocky gives the same result :
Capture d’écran 2016-12-12 à 21.18.58.png
Capture d’écran 2016-12-12 à 21.18.58.png (93.7 KiB) Viewed 856 times

Code: Select all

2016-12-12 21:18:00.481 EventSystem: Event triggered: 999-test_1
2016-12-12 21:18:00.482 TEST
2016-12-12 21:18:00.482 TEST OK
2016-12-12 21:18:00.483 1500
2016-12-12 21:18:00.484 0
2016-12-12 21:18:00.485 TEST KO
2016-12-12 21:18:00.526 (Domoticz RPI B+) Lighting 2 (Vertigo (B+))

Re: Strange IF DO ELSEIF in blocky ?

Posted: Monday 12 December 2016 21:28
by StanHD
Sorry, I think I was confusing you. You now have more nested "if" blocks. You should only have 1 "If" with multiple "Else If" blocks.

Re: Strange IF DO ELSEIF in blocky ?

Posted: Monday 12 December 2016 21:39
by multinet
You're right it works :)
Thanks