Page 1 of 1

programming PIR for lights

Posted: Sunday 12 June 2016 11:14
by pascalspits
Hi,
How can I program (blockly) this :

When movement (PIR) the light should switch on for 2 minutes
If within this 2 minutes there is again movement detected (PIR) the (already running) 2 minutes counter should restart
In this way Domoticz would keep the light on as long as there is movement in the room, and only when there is no more movement it will switch the lights off after 2 minutes

Now I have this programmed in blockly to get the PIR to switch on the light "for 2 minutes" but in this way it doesn't restart the 2 minutes counter when more movement is detected while the 2 minutes are already running ... so whatever happens, the lights will go out after 2 minutes anyway ... kinda stupid when there is still movement in the room ...

Shouldn't this be easy to do ?
Isn't this quite basic functionality ?

Switching the light on with PIR and leaving it on untill there is no more movement ... (in human language : switch the light on in the room when somebody enters and keep it on until this somebody leaves the room again)

In my current situation the light gets switched off after 2 minutes, and then we must wave to the PIR and wait for it to get it back on again ... quite annoying ...

any ideas ?

Re: programming PIR for lights

Posted: Sunday 12 June 2016 11:32
by pascalspits
I think I got it working by using an intermadiate dummy switch which has an off delay of 120 sec
I make an event to let the PIR switch on this dummy
then I make another event to let the lights follow the dummy switch (or should I do this with the "slave" settings instead of creating an event ?)

Re: programming PIR for lights

Posted: Sunday 12 June 2016 12:46
by mrf68
I use a PIR which is set to stay on for 5 minutes. The PIR itself will only send an Off signal when there's no movement for the last 5 minutes. Domoticz turns the lights on whenever the PIR sends the On signal and Domoticz will turn the lights off when the PIR sends the Off signal. To me this is the most logical solution. So: PIR = On then light = On, PIR = Off then light = Off.

Re: programming PIR for lights

Posted: Sunday 12 June 2016 14:01
by pascalspits
how do you set a PIR to stay on for 5 minbutes ?
when I use the "off delay" setting, it doesn't work
is it done in the hardware settings ?

Re: programming PIR for lights

Posted: Sunday 12 June 2016 14:05
by markk
I've found it depends on what PIR you use. Some won't turn off even if you set an on delay.

I use @simonrg's smart lua scrips to turn all my lights on and off automatically: https://www.domoticz.com/wiki/Smart_Lua_Scripts

Re: programming PIR for lights

Posted: Wednesday 29 June 2016 14:43
by TheBod
pascalspits

Did you manage to resolve this using blocky? If so, could you share an image of it?