Page 1 of 1
Brighten a dimmer when motion detected
Posted: Wednesday 06 May 2020 10:26
by AllesVanZelf
I created a Blockly script to dim the lights when there is no motion detected.
The motion sensor works well, so are the lights. But the script is not working. The lights never dim, brighten up, or go off.
Daglicht is a dummy switch, switched at sunrise, etc.
Is there something wrong in this script?
Re: Brighten a dimmer when motion detected
Posted: Wednesday 06 May 2020 22:27
by jake
Just guessing, but when you would do this in dzvents, you have a device state (off, on) and level 0-100%
So, are you sure that this dimmer device reacts on On? Try with > 0% instead and for off = 0%
Re: Brighten a dimmer when motion detected
Posted: Thursday 07 May 2020 11:21
by AllesVanZelf
Thank you Jake, I'll have a look at this if domoticz is up and running again. I have some trouble with my rpi now.
Re: Brighten a dimmer when motion detected
Posted: Thursday 07 May 2020 17:48
by AllesVanZelf
I just tried.
If I set the [If] or [Else If] part to [level %] then I get an:
Code: Select all
attempt to compare number with string
error.
But this [If] or [Else If] part does not react on: [On] or [Off].
In the set part I can use Level. This is really strange behaviour. I have the same trouble with a Qubino Shutter.
Re: Brighten a dimmer when motion detected
Posted: Thursday 07 May 2020 23:33
by jake
AllesVanZelf wrote:I just tried.
If I set the [If] or [Else If] part to [level %] then I get an:
Code: Select all
attempt to compare number with string
error.
But this [If] or [Else If] part does not react on: [On] or [Off].
In the set part I can use Level. This is really strange behaviour. I have the same trouble with a Qubino Shutter.
I got the same error when trying If dimmer > 50% then turn other light off.
Than I changed my blockly to if dimmer = on than turn other light off and than it worked. So, check with a simple formula first and than extend until you find where the problem is. Instead of testing with the real PIR, you could also try with another 'dummy' switch or whatever. Do you know for sure that your PIR uses on/off and not something with motion / no motion?
Re: Brighten a dimmer when motion detected
Posted: Friday 08 May 2020 16:21
by AllesVanZelf
Yes, This motion sensor only produces ON/Off states.
I will do some more test.