programming PIR for lights

Moderator: leecollings

Post Reply
pascalspits
Posts: 88
Joined: Tuesday 24 February 2015 16:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belgium
Contact:

programming PIR for lights

Post 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 ?
RasPi2 - Aeotec Z-Stick S2 - Fibaro multisensors - Fibaro RGBW dimmers - ETH08 relais boards
pascalspits
Posts: 88
Joined: Tuesday 24 February 2015 16:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belgium
Contact:

Re: programming PIR for lights

Post 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 ?)
RasPi2 - Aeotec Z-Stick S2 - Fibaro multisensors - Fibaro RGBW dimmers - ETH08 relais boards
mrf68

Re: programming PIR for lights

Post 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.
pascalspits
Posts: 88
Joined: Tuesday 24 February 2015 16:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Belgium
Contact:

Re: programming PIR for lights

Post 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 ?
RasPi2 - Aeotec Z-Stick S2 - Fibaro multisensors - Fibaro RGBW dimmers - ETH08 relais boards
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: programming PIR for lights

Post 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
Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
TheBod
Posts: 52
Joined: Friday 01 January 2016 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: programming PIR for lights

Post by TheBod »

pascalspits

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

Who is online

Users browsing this forum: No registered users and 1 guest