Detection sensor and Light Management

Post Reply
Pierryck
Posts: 28
Joined: Saturday 27 February 2016 21:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Detection sensor and Light Management

Post by Pierryck » Sunday 08 January 2017 20:40

I have an issue on my external light management.
I did an event when the camera detects a move outside, it switches on the light.
The light stay on for 1mn and then automatically switch off.
But when the external light switches off, the camera detects a move and switch on the light again.
The result is my camera always detects a move and the light is always on.

What I expect is to switch on the external light for 1mn when a move is detected.

Is there a way to do it?

User avatar
Egregius
Posts: 2446
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: Beta
Location: Beitem, BE
Contact:

Re: Detection sensor and Light Management

Post by Egregius » Sunday 08 January 2017 21:42

Use a script to check if the light hasn't been switched in the last 62 seconds before turning it on.

Pierryck
Posts: 28
Joined: Saturday 27 February 2016 21:39
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Detection sensor and Light Management

Post by Pierryck » Thursday 12 January 2017 18:26

Is it possible to do it with Blocky ?

tozzke
Posts: 123
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Detection sensor and Light Management

Post by tozzke » Thursday 12 January 2017 19:01

Try adding a variable so you'll get something like this:

Code: Select all

If [camera_motion = On] and [light = Off] and [Var camera_motion_cooldown = 0]
Do [Set light = On For 1 minutes]
   [Set Var camera_motion_cooldown = 1]
   [Set Var camera_motion_cooldown = 0 After 65* seconds]
or

Code: Select all

If [camera_motion = On] and [light = Off] and [Var camera_motion_cooldown = 0]
Do [Set light = On]
   [Set Var camera_motion_cooldown = 1]
Elseif [camera_motion = Off] and [light = On] and [Var camera_motion_cooldown = 1]
Do [Set light = Off After 60 seconds]
   [Set Var camera_motion_cooldown = 0 After 65* seconds]
* Depends on how long the camera's motion is kept on @ Domoticz. If it's 10 seconds after last motion detection, you'll have to change this to 71 seconds at least

This way the light will only switch off when the camera detects no motion anymore. The first solution will switch the light off no matter what

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests