Lightbulb, motiondetector reset turn off-timer on every movement

Moderator: leecollings

Post Reply
burton666
Posts: 85
Joined: Monday 17 August 2015 21:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Lightbulb, motiondetector reset turn off-timer on every movement

Post by burton666 »

I have been trying to get this to work for a long time but never succeeded. I have some rooms with both pir-motion detectors and smart light bulbs.
Right now I have the lightbulb to turn on for 30 min when motion is detected. But that makes them turn off and then on again if I am still in the room after 30 mins.

I would like the bulbs timer to reset to turn of in like 10 minutes after every movement. So if movement has been detected and the lightbulb turns on, after 5 minutes movement is detected again the timer gets reset to turn of after 10 minutes.
jake
Posts: 742
Joined: Saturday 30 May 2015 22:40
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Contact:

Re: Lightbulb, motiondetector reset turn off-timer on every movement

Post by jake »

I made a 2nd virtual switch that is kept alive by a lua script for 30 minutes, every time the pir is de-activated.

I did this because the pir stays active when it detects motion again within the period that it was already active.
If you are interested, I can share the script.
User avatar
kuifje
Posts: 36
Joined: Wednesday 25 October 2017 16:38
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Heemskerk
Contact:

Re: Lightbulb, motiondetector reset turn off-timer on every movement

Post by kuifje »

viewtopic.php?f=62&t=20048
Maybe this will get you on the right track.
Kuifje
Dave21w
Posts: 376
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Lightbulb, motiondetector reset turn off-timer on every movement

Post by Dave21w »

You should be able to modify this to how you need it, I use a virtual switch created as a push on button with an off delay of 10 seconds and use the PIR to trigger the button which is called Garage Light PIR, each trigger of the button starts the blockly event again, if no trigger occurs then the lights go out after their set times. You could simply just use the PIR On/Off signal to start the event however the addition of the button provides a fail safe for me, my garage is at the top of the garden so in the unlikely event my RFXCOM missed the PIR off signal the lights would never go out, this way you are only using the PIR ON signal and you always have an OFF generated by Domoticz, hope it helps.

Dave
Attachments
2019-01-01 09_27_27-Domoticz.jpg
2019-01-01 09_27_27-Domoticz.jpg (31.48 KiB) Viewed 869 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest