ELK M1 rule help for lights

Philament

Member
My goal is to have specific lights turn on for a few hours if it is dark outside and the system is armed away so I can come back to a lighted house and make it look like someone is around.  Initially I did:
 
WHENEVER System is armed away
AND it is dark,
THEN TURN ON LIGHTS
 
It didn't work and I think my problem is that it would have to be DARK outside before arming away for the lights to turn on.  Unfortunately you can't program it in reverse (WHENEVER it is Dark, AND system is armed away, THEN turn on lights - I think in this order, it would function correctly??). 
 
Anyways, is this how I get it to function how I want:
 
WHENEVER every 30 seconds
-AND it is dark outside
-AND Area 1 is armed away
-THEN set lights to 40% Bright, Fade rate = 0 for  3 hrs
 
 
I would also check to see that the light is not on. Otherwise the system will turn it on every 30 seconds .
 
Mike.
 
The trick is that the thing you are testing in the Whenever clause only triggers the evaluation of the rule at the moment that condition occurs.   So when you trigger on Armed status, the rule would execute only at the time you actually arm the system, and not later after you've left.
 
By triggering instead on a time based condition, such as every 30 seconds, the rule will evaluate over and over again.  I would probably use a larger interval, like 5 minutes, since a shorter period of time won't make much difference.
 
I did somethng similar.
 
whenever sunset
and area1 is armed away
then turn on light.
 
This has worked well for me because when I alarm the house and it is already dark outside I turn the lights manually on before I go
 
mikefamig said:
I would also check to see that the light is not on. Otherwise the system will turn it on every 30 seconds .
 
Mike.
 
Thanks for the response.  I don't entirely understand how it would turn the light on every 30 seconds if the light was already on.  Can you elaborate please?
 
 
 
RAL said:
The trick is that the thing you are testing in the Whenever clause only triggers the evaluation of the rule at the moment that condition occurs.   So when you trigger on Armed status, the rule would execute only at the time you actually arm the system, and not later after you've left.
 
By triggering instead on a time based condition, such as every 30 seconds, the rule will evaluate over and over again.  I would probably use a larger interval, like 5 minutes, since a shorter period of time won't make much difference.
 
I was thinking about the rule a little bit more, and would it actually leave the lights on all night if I was gone for the entire night and not turn it off since it is re-evaluate it every 30 sec, 5 min etc and restart that 3 hr timer?
 
Your conditions
 
WHENEVER every 30 seconds
-AND it is dark outside
-AND Area 1 is armed away
 
will be evaluated every thirty seconds and found to be true and the rule will be triggered every thirty seconds. Every time this happens a signal will be sent from the elk to the light switch to turn it on.
 
If you also check to see if the light is on then it will only trigger the rule once.
 
mikefamig said:
I did somethng similar.
 
whenever sunset
and area1 is armed away
then turn on light.
 
This has worked well for me because when I alarm the house and it is already dark outside I turn the lights manually on before I go
 
I think I will just do something like this...seems the easiest.
 
I figure I could always create a rule to turn on the lights automatically whenever it is armed away and dark so I don't have to turn the lights on manually if I left after sunset (if I start feeling especially lazy and don't want to turn them on manually).
 
thanks for the help
 
To add to what RAL said above - you need to understand that the whenever condition is met when a "change of state" has occurred in the real physical world. In Elk macros language this is called an event.  Like whenever a sensor becomes violated or whenever it becomes sunset or whenever motion is detected. An event has occurred in the physical world,
 
By contrast the and condition is met when an existing state is true. Like area1 is armed or zone1 is secure. You could make two rules
 
turn on light if sun set occurs while the house is armed
whenever sunset
and area1 is armed
turn on light
 
 
 
turn on light if the area is armed while it is already dark outside
whenever area1 is armed
and it is dark outside
turn on light
 
Back
Top