Page 1 of 1

Blockly: Strange behaviour when using illumination LUX

Posted: Monday 03 October 2016 19:36
by Olgmo
I have set up dimmable lights to go on when LUX is less than 100 and this works, but only partly.
If I from GUI adjust the dimmer, let say to 33%, the blockly script will be trigged on new PIR detection and change the value back to 66%.
Why does PIR detection do anything in this script when only illumination is in the blockly and value is less that 100 :?:

I use a Philio PST02-A 4 in 1 multisensor.

Image
"Lysmåler STUE" = "LUX sensor livingroom"

Re: Blockly: Strange behaviour when using illumination LUX

Posted: Monday 03 October 2016 19:48
by StanHD
I can't see from your screen shot if you have an "Else If"? If you do not then you have used the wrong control block. It should be the one without the blue symbol top left.

Re: Blockly: Strange behaviour when using illumination LUX

Posted: Monday 03 October 2016 20:17
by booster
The event will be triggered every time any of the values change...if LUX was (let's say) 90, it will trigger the script, but when LUX drops lower (eg when you dim the lights perhaps?), it will trigger this script again.

You can solve it with a dummy switch which you enable first time and then verify in your if statemen that it needs to be disabled.

Re: RE: Re: Blockly: Strange behaviour when using illumination LUX

Posted: Monday 03 October 2016 20:45
by Olgmo
booster wrote:The event will be triggered every time any of the values change...if LUX was (let's say) 90, it will trigger the script, but when LUX drops lower (eg when you dim the lights perhaps?), it will trigger this script again.

You can solve it with a dummy switch which you enable first time and then verify in your if statemen that it needs to be disabled.
Aha, thanks. That I can do...