Page 1 of 1

Detection sensor and Light Management

Posted: Sunday 08 January 2017 19:40
by Pierryck
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?

Re: Detection sensor and Light Management

Posted: Sunday 08 January 2017 20:42
by Egregius
Use a script to check if the light hasn't been switched in the last 62 seconds before turning it on.

Re: Detection sensor and Light Management

Posted: Thursday 12 January 2017 17:26
by Pierryck
Is it possible to do it with Blocky ?

Re: Detection sensor and Light Management

Posted: Thursday 12 January 2017 18:01
by tozzke
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