RM - Garage lights

It's my first day on this, came from ST.
I've setup all my devices, now I'm trying to port my rules.
I got one rule for garage light to come on when my side door opens, turns off in 10 minutes. My issue is, I want it only to trigger between sunset and sunrise.
How do I add that time parameter? (or can I?)

Is this right?

I'll asume you want to limit the lights on to when it is expected to be dark. If this is the case you would add a "condition" that the time is between xx and yy. The conditions are part of the actions not the trigger and is in the form of if , then. See add condition / conditional.

This is what I did for my motion sensor that will turn on the garage flood light.

2 Likes

Your second rule should more or less work, though I'd recommend getting in the habit of adding the END-IF to complete the IF THEN (RM will infer it here just fine, but it matters if you have a more complicated rule).

One thing you might run into: what if you open the door more than once within 10 minutes? I'd assume you want any previous "timers" to be cancelled (should it still be within a delay) and a new one to start. As-is, the lights will turn off 10 minutes after any time the contact sensor is opened, even if that's multiple times within 10 minutes (so you may be caught by surprise when they turn off earlier than 10 minutes in those cases, possibly repeatedly).

The fix is pretty simple: mark the "cancel?" option on your delay, then add a "Cancel Delayed Actions" action first thing in your rule. You could also consider combining this idea with a rule like the one you see above (where I'd probably make the same adjustment), using contact instead of motion. Then the countdown won't start until your sensor is closed--something you may or may not want depending on whether you want the option to leave the door open to keep the light on.

Good luck!

Something like this?

I lied: you might want to put the "Cancel Delayed Actions" inside the IF so you don't run into an edge case, like the door re-opening outside your timeframe and the lights never turning off because of that (unless that isn't a problem for you). But otherwise, yep, that's what I was thinking!

Cool, made the change. Thanks Bert

1 Like