Brighten a dimmer when motion detected

Moderator: leecollings

Post Reply
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Brighten a dimmer when motion detected

Post 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.

Image

Is there something wrong in this script?
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
jake
Posts: 751
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Brighten a dimmer when motion detected

Post 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%
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: Brighten a dimmer when motion detected

Post 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.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: Brighten a dimmer when motion detected

Post 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.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
jake
Posts: 751
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Brighten a dimmer when motion detected

Post 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?
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: Brighten a dimmer when motion detected

Post by AllesVanZelf »

Yes, This motion sensor only produces ON/Off states.
I will do some more test.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest