Strange IF DO ELSEIF in blocky ?

Moderator: leecollings

Post Reply
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Strange IF DO ELSEIF in blocky ?

Post 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 877 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 867 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 867 times
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Strange IF DO ELSEIF in blocky ?

Post 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?
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange IF DO ELSEIF in blocky ?

Post 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 860 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+))
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Strange IF DO ELSEIF in blocky ?

Post 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.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
multinet
Posts: 97
Joined: Friday 05 December 2014 22:52
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Strange IF DO ELSEIF in blocky ?

Post by multinet »

You're right it works :)
Thanks
PI 2 - Domoticz 2021.1
RFXCOM - RFXtrx433 USB 433.92MHz Transceiver (5 DIO 54755 + 2 DIO 54756 + 3 DIO 54798)
Z-Wave.Me ZME_UZB1 USB Stick (6 FGSD002 + 2 FGRM222 + 1 FGS223 + 1 FGMS001-ZW5 + 1 FGRGBWM441 + 1 FGBS001 + 2 FGFS101)
6 sondes DS18B20
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest