Page 1 of 1

Blockly, 2 same situations one works other won't

Posted: Saturday 25 July 2020 13:23
by balosa
Hi all,

I got 2 Sonoff Dual switches to turn my shutters up and down, one is on the ground floor (beganegrond) and one is on the small room upstairs (kleinekamer)

First I installed the switch on the ground floor and made the following blockly, which works perfect !
Notice the trigger is DEVICE. (The locked virtual switch ensures the blockly won't run twice in the same minute when triggered)

blockly_bg.jpg
blockly_bg.jpg (182.52 KiB) Viewed 640 times

I installed a switch of the same type (sonoff Dual) and adjusted the blockly for this switch, but it won't do anything, the blockly isn't triggered it seems.
When I switch it manual it works, Domoticz is also changing the status of the switch so that all seems ok.

After some testing I found out that if I change the trigger to TIME the blockly triggers the switch

Same blockly but adjusted for the small room shutters.

blockly_kk.jpg
blockly_kk.jpg (180.28 KiB) Viewed 640 times

Just to understand, why does the switch downstairs works with the DEVICE trigger and the other switch only works with the TIME trigger, while the setup is the same, hope someone can clarify this to me.


Maybe not the right forum for this, but should using a dzvents or lua scrips be more stable, unfortunately I am not able to make a script so I can't test this.

Thanks in advance.

Re: Blockly, 2 same situations one works other won't

Posted: Saturday 25 July 2020 14:11
by waaren
balosa wrote: Saturday 25 July 2020 13:23 Just to understand, why does the switch downstairs works with the DEVICE trigger and the other switch only works with the TIME trigger, while the setup is the same, hope someone can clarify this to me.
All Blockly's set to device triggered are executed when a (any) device is updated. If there are no devices updated at the time you check for, the script is not executed.
Time triggered Blockly's are executed every minute, on the minute.

Have you checked your first Blockly when set as time triggered?
Maybe not the right forum for this, but should using a dzvents or lua scrips be more stable, unfortunately I am not able to make a script so I can't test this.
dzVents or classic Lua are just as stable as a Blockly script but you will have much more possibilities.

Re: Blockly, 2 same situations one works other won't

Posted: Sunday 26 July 2020 15:40
by balosa
I set the 1st blockly also as a TIME trigger instead of the device trigger, and it also works.
I still don't understand why it also works as device trigger though since there are no other (device) triggers at that moment that I know of.

thanks for the response, I will let them stay as time triggers