I've set this rule up... it correctly switches the light on at 06:15 but doesn't switch it off after 06:20. What am I doing wrong?
Rule actions run only when a trigger event fires. In your case, this means your actions will run only once per day on weekdays at 6:15 AM. Per your actions, the first IF
will be evaluated and return True
, so the "On: Front Door Light" action will run. Your ELSE
never gets a chance to run. so this rule will never turn off the lights
Are you trying to turn the light on at 6:15 and off at 6:20? If so, you have a couple options. One is to just add another trigger, similar to your existing one but for 6:20 AM. Your IF
could also be simplified a bit to IF (Time is 6:15) THEN
. With this as your conditional, when either of your triggers fire, it will be either 6:15 and your actions will cause the lights to turn on (per the IF
, where you could indeed use a range of times but it's really not necessary), or it will be 6:20 (so the ELSE
will run since the IF
conditions are not matched).
Alternatively, if you're not doing this to try to learn Rule Machine and just want an easy way to turn on or off your lights based on time (and many other events), I'd check out Hubitat Simple Lighting instead. This would be quite easy to do in Simple Lighting with two child apps, one for your on time and one for your off time (EDIT: that's actually not necessary; one will do).
Good luck!
Cheers for the prompt feedback. Yes looking to have the light come on at 6:15 and off at 6:20 - was trying to do it within one rule as opposed to creating two. Will play some more!
No problem! There is nothing wrong with multiple rules, but you can certainly do it on one. I even lied about Simple Lighting--you can turn on and off using one child app:
Hope this helps, whichever method you choose.
another way to do this is keep what you have for the trigger
Action:
Light on
Light off (delay 5 min)
no if needed.