Elk Rules timing

BradScott

Member
I want to turn off my garage lights 5 minutes after I close the garage door, if there has been no motion detected in the garage for one minute. What is the best way to set up the rules to do this?

I know I can set a counter to 10 when the door closes, then do a WHENEVER every 30 seconds and count down, when it hits zero, then check if there has been any motion in the last minute (another counter, reset to 2 every time there is motion). But, is there a cleaner and easier way to do this?

Or is there a better way to start a timer and check whenever the timer expires?

TIA
 
Use virtual outputs. You might have to add some more AND conditions depending on what "side effects" you do or don't want...

WHENEVER (Garage Zone) becomes secure
Then Turn Output xxx on for 5 minutes

WHENEVER (Garage Motion) becomes secure
Then Turn Output yyy on for 1 minutes, Restart if running

WHENEVER Output yyy STATE is turned off
AND Output xxx STATE is Off
THEN Turn off lights...
 
Thanks. That makes sense. Just to make sure I understand, since I have no output expanders, I just use output 55 (for instance), and since nothing is hooked up, the M1 is happy?
 
WHENEVER (Garage Zone) becomes secure
Then Turn Output xxx on for 5 minutes

WHENEVER (Garage Motion) becomes secure
Then Turn Output yyy on for 1 minutes, Restart if running

WHENEVER Output yyy STATE is turned off
AND Output xxx STATE is Off
THEN Turn off lights...


You may want to add this Rule so that if Output yyy turns off and Output xxx is still on, Output yyy will be reset to time out again waiting on Output xxx to time out.

WHENEVER Output yyy STATE is turned off
AND Output xxx STATE is On
Then Turn Output yyy on for 1 minute
 
Thanks Spanky. What I had already added was the other condition. My complete set of rules (for the garage lights) is below. The only problem is that my UPB lights are not reporting off back to the M1G when I turn off the garage lights by using the switch (the second rule never gets invoked).

So, the purpose of these rules is to turn on the garage lights when motion, or either of the two garage doors opens or closes, and leave the lights on for 3 minutes after any of these actions takes place. But, do not turn the lights on by motion if they were turned off manually within the last 30 seconds.

WHENEVER Garage MD (Zn 13) BECOMES NOT SECURE
AND Scott House (Area 1) ARM STATE = DISARMED
AND GarageSwitch (Out 49) STATE IS OFF
THEN TURN Garage [10 (A10)] ON, FADE RATE = 0
THEN TURN GarageMotion (Out 51) ON FOR 3 MINS, RESTART TIMER IF RUNNING

WHENEVER Garage [10 (A10)] IS TURNED OFF
THEN TURN GarageSwitch (Out 49) ON FOR 30 SECS, RESTART TIMER IF RUNNING
THEN ANNOUNCE GarageSwitch (Out 49)

WHENEVER Garage Dr Large (Zn 9) BECOMES NOT SECURE
THEN TURN Garage [10 (A10)] ON, FADE RATE = 0
THEN TURN GarageOpen (Out 48) ON FOR 3 MINS, RESTART TIMER IF RUNNING

WHENEVER Garage Dr Small (Zn 10) BECOMES NOT SECURE
THEN TURN Garage [10 (A10)] ON, FADE RATE = 0
THEN TURN GarageOpen (Out 48) ON FOR 3 MINS, RESTART TIMER IF RUNNING

WHENEVER Garage Dr Large (Zn 9) BECOMES SECURE
AND Garage Dr Small (Zn 10) IS SECURE
THEN TURN GarageClose (Out 50) ON FOR 3 MINS, RESTART TIMER IF RUNNING

WHENEVER Garage Dr Small (Zn 10) BECOMES SECURE
AND Garage Dr Large (Zn 9) IS SECURE
THEN TURN GarageClose (Out 50) ON FOR 3 MINS, RESTART TIMER IF RUNNING

WHENEVER GarageClose (Out 50) STATE IS TURNED OFF
AND GarageMotion (Out 51) STATE IS OFF
THEN TURN Garage [10 (A10)] OFF, FADE RATE = 0

WHENEVER GarageOpen (Out 48) STATE IS TURNED OFF
AND GarageMotion (Out 51) STATE IS OFF
THEN TURN Garage [10 (A10)] OFF, FADE RATE = 0

WHENEVER GarageMotion (Out 51) STATE IS TURNED OFF
AND GarageOpen (Out 48) STATE IS OFF
AND GarageClose (Out 50) STATE IS OFF
THEN TURN Garage [10 (A10)] OFF, FADE RATE = 0
 
I recall that you must link the light back to the M1 with Upstart if the light is controlled by a switch.

Maybe one of the lighting guru's will chime in for the details.
 
Okay, I'm starting to conclude that the M1G receives link commands (though it has no clue what they do), but does not get lighting changes directly. If that is the case, I now know what to do. Thanks!

I've had similar questions on the ELK and UPB thread, so maybe I'll get the answer there.

thanks.
 
Back
Top