Rules Help - motion sensor to turn lights off after x

taskman

Member
Hi,

I have been looking around for quite some time now so it is time to ask.

Using Insteon w/ISY 99i and Elk M1 Gold

Trying to set a rule or rules so if anyone left a light on and there is nobody in that room, the lights should be turned off.
If there is motion, then it should wait until no motion is sensed, then maybe wait a few minutes and turn the light(s) off.

What will it look like if there are 4 sets of lights, each with (3-way insteons) (so 2 switches) and 1 with 3 switches.
I have a scene setup for the entire room so I was thinking to make the off action on the scene

I was thinking it should look at the motion every x minutes and if motion is sensed, return the clock back to start and start ticking down.
Of course this would only be effective if the (any) lights are on.

Thanks for any help
 
It has been long time since I did something similar, but lets try.

In logical terms, you should have a rule that whenever the light from Room A is ON, and Sensor 1 is triggered, you turn an output On (logical output) for X minutes. If the output is on already, the effect is that the count down timer will be reset to X minutes again. You need to create another copy of this rule for each sensor in Room A.

Then you have another rule that whenever your output is turned Off and the light in Room A is On, the turn the light in Room A Off.
 
One way to do this with the ELK(in shorthand). Output Z can be turned on/off manually to use a longer time(60 min) for the case where you are using the room and motionless. I also added a section that will enable the longer timer if you turn the lights on manually soon after they are turned off by the timer.

Whenever (motion) is insecure (restart the longer timer if Z is on and motion)
and output Z is on
Then turn output X on for 60min, restart if running

Whenever (motion) is insecure (restart the shorter timer if Z is off and motion)
and output Z if off
then turn output X on for 10min, restart if running

Whenever output X turns off (when X expires, turn off, start 30 sec timer for manual override)
then turn light off
turn output Y on for 30 sec

Whenever (X lighting) is turned on (manually trigger 6hr of longer time if turning light on within 30 sec of auto-off)
and output Y is on
and output Z is off
then turn on output Z for 6 hours

Whenever (X lighting) is turned on (start the longer timer if Z is on)
and output Z is on
then turn on output X for 60min

Whenever (X lighting) is turned on (start the shorter timer if Z is off)
and output Z is off
then turn on output X for 10min


EDIT: Writing more complete rules. Untested, but closer to a working version
 
Have you tried the rules in this post?

It is a simple idea:

1) When you sense motion, start a timer. Turn off the lights when the timer expires. Unless you have other rules dealing with an off event, no need to worry if the lights are already off

2) Some way to override if you are in the room. Doesn't really matter what you want to do. Maybe if you turn the lights back on manually within 30 sec of the auto-off, etc. Just something like that.

The rules I posted aren't actually rules, they are a concept I created for this thread. The actual rules depend on a specific implementation. It was just an example of a logical thought. Looking again I didn't really write all the items I intended to show, but you should get the general idea. I was assuming the original poster can customize it to his particular situation or he will reply if he needs an exact set of rules written. I'll modify it to actually work.
 
I was curious to learn if Taskman had tried the rules in the other post. It does what he had requested.
 
One way to do this with the ELK(in shorthand). Output Z can be turned on/off manually to use a longer time(60 min) for the case where you are using the room and motionless. I also added a section that will enable the longer timer if you turn the lights on manually soon after they are turned off by the timer.

Whenever (motion) is insecure (restart the longer timer if Z is on and motion)
and output Z is on
Then turn output X on for 60min, restart if running

Whenever (motion) is insecure (restart the shorter timer if Z is off and motion)
and output Z if off
then turn output X on for 10min, restart if running

Whenever output X turns off (when X expires, turn off, start 30 sec timer for manual override)
then turn light off
turn output Y on for 30 sec

Whenever (X lighting) is turned on (manually trigger 6hr of longer time if turning light on within 30 sec of auto-off)
and output Y is on
and output Z is off
then turn on output Z for 6 hours

Whenever (X lighting) is turned on (start the longer timer if Z is on)
and output Z is on
then turn on output X for 60min

Whenever (X lighting) is turned on (start the shorter timer if Z is off)
and output Z is off
then turn on output X for 10min


EDIT: Writing more complete rules. Untested, but closer to a working version


Hi,

That was a great help.....

For now I have the one room with 4 sets of lights with 3-ways on each and combined as an ALL Room scene.
It is easy to activate the ALL for the Off. Is there a way to write it so if any of the lights are on, it would ignore the output so no counting would start until one of the switches is left on after x minutes?

Thanks
 
Back
Top