Page 1 of 1

Blockly switching on/off/on/off

Posted: Monday 28 November 2016 16:45
by Toolman
Hi, I've made a blockly test script to turn on a light when a motion sensor is triggered (Aeon multisensor 6) but when it's turned on it immediately turns off again. This is happening every minute.
2016-11-28 16_23_37-Domoticz.jpg
2016-11-28 16_23_37-Domoticz.jpg (113.07 KiB) Viewed 1120 times
When the motion sensor is triggered its state becomes on and after 4 minutes it becomes off.
So I can't explain the on/off behaviour as mentioned above.
Small piece of logging:
2016-11-28 16_43_56-Domoticz.jpg
2016-11-28 16_43_56-Domoticz.jpg (49.24 KiB) Viewed 1120 times
This doesn't really turns on/off a light, but writes to the logging for testing purposes.

Licht moet aan obv beweging = Light has to turn on because of movement
Licht moet uit = Light has to turn off

Any help would be greatly appreciated.

Re: Blockly switching on/off/on/off

Posted: Monday 28 November 2016 17:16
by tozzke
If I recreate your blockly with dummy switches, it also reacts as you mention.
If I change it to:
Image
it works as expected
Image

a workaround which might help you ;)

Re: Blockly switching on/off/on/off

Posted: Monday 28 November 2016 19:08
by Toolman
Tozzke,
Thanks for the workaround. I'll try that later on (no time right now :-( ) and will use it for the "real" version.
Problem solved I think.
Still weird that my solution does show that strange behaviour.

Re: Blockly switching on/off/on/off

Posted: Saturday 10 December 2016 9:12
by Toolman
Update: the solution of Tozzke works like a charm

Re: Blockly switching on/off/on/off

Posted: Saturday 10 December 2016 10:47
by tozzke
I'm reading more issues regarding the nested If-statements lately, so I'm avoiding those ;)
Also I don't believe they were even possible when I started with Blockly, so I taught myself a way to make them without nested If-statements