Rule for Outside lighting, looking for help

project_x

Active Member
I have been integrating my Z-wave light control with Elk.
Many of the rules have been going smoothly, but I am having trouble getting my head around a specific rule.

My outside lights come on a Sunset.
I want them to turn off at 4hrs after sunset, unless, the alarm is set. If the alarm is set, I want the lights to stay on until I turn the alarm off, in which case I want them to stay on for 15 more minutes and turn off.

I tried this

WHENEVER Area 1 ARM STAT BECOMES DISARMED
AND TIME OF DAY IS LATER THAN 4 HOURS AFTER SUNSET
THEN TURN Output 208 ON FOR 15 MINS
THEN TURN Outside Lights [12(A12)] OFF, FADE RATE=0


I suspect the problem is that the BECOMES DISARMED EVENT is a singular moment in time, not if the Elk is NOT ARMED

Do I need to do this with multiple rules?
 
Yes the WHENEVER statement is your trigger, not both statements in the AND. So you will need several rules to do this. Roughly...

WHENEVER Sunset + 4 Hours
AND AREA Disarmed
Turn Off Lights

WHENEVER Area 1 ARM State Becomes DISARMED
Turn Output 208 on for 15 Mins

WHENEVER Output 208 STATE is Turned Off
Turn Off Lights


You have to break down a rule this way. There are no waits, it will not wait for the output statement.
WHENEVER trigger occurs
Check all AND statements for a match
If they all match, Run all Statements.
 
Back
Top