Page 1 of 1

Blockly starts looping

Posted: Monday 20 April 2020 23:03
by opale
Hello
I have to create a script to manage garage door.
Unfortunately garage door have only a on switch that activate the engine. Does not control open/close.
I had the script to manage it via domoticz switch and variables... but I have also to manage the manual switch on "real" swich.
So I have put in place two Sonoff DW1 sensors bridged with Sonoff RF hacked with tasmota.
Unfortunately the script in the image goes in loop
-OpeningSensor is a counter sensor
-garagetest is a virtual switch that replace the real one for testing purposes...
-the open url resets the counter (192.168.178.101:8080/json.htm?type=command&param=udevice&idx=115&svalue=0&nvalue=0)

any idea why?
thanks in advance
blockly_loop.jpg
blockly_loop.jpg (87.19 KiB) Viewed 405 times
event_log.jpg
event_log.jpg (204.93 KiB) Viewed 405 times

Re: Blockly starts looping

Posted: Thursday 30 April 2020 17:33
by thomasbaetge
HI,

not totally sure, if I understand you correctly, but as fas as I can see, the problem is the single 'if' clause.
it woud be a better idea, to combine it with something within the do block, to make sure it gets triggered only once.

if OpeningSensor-> actual > 0 AND IsGarageOpen = "no"
this would run only once, because IsGarageOpen gets set to "Yes" in the do-block