Help with Event

Moderator: leecollings

Post Reply
asmithdub
Posts: 10
Joined: Monday 30 September 2013 22:07
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Help with Event

Post by asmithdub »

Hi all,
Looking for assistance in achieving the following, if anyone could point me in the right direction:

I live in an open plan apartment. One large living space accessed from a hallway and a bedroom, accessed from the living space.
All lighting is controlled via Domoticz via Lightwave RF/ RFXCOM.

Each separate room/space has a PIR - at the moment these are used to trigger simple events.

What I'm looking to do is have the lighting turn off in say the bedroom or living area when there is no movement for a certain amount of time.
That parts simple.

But I want the lighting to return to it's previous state/ scene if movement is detected with in a certain amount of time.
This is the part I'm not sure where to start on.
Does anyone have any ideas?


Thanks,
S
mrf68

Re: Help with Event

Post by mrf68 »

Hi,

I would create a script_time_pir1.lua script. This script will run every minute. In the script you check if the pir is off, the light is on and the last update of the pir is > say 300 seconds. If so, turn off the light. Then when motion is detected within those 300 seconds, the status last update of the pir will be updated, so the light will stay on.

Regards,
Martin
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest