Turning off multiple lights after x time

i tossed this together

am i right that if downstairs lights go on it starts a 10 min time. if in 5 mins i turn on upstairs lights then both go off in 5 mins cause of the else.

what would be a better way to make sure both have own timers

1 Like

Can you post a screenshot that includes the trigger(s)?

updated original. basic idea is if any of these lights come on it shuts off after 10 mins

I would use two rules for this, and use the Basic Rules app....

EDIT: second action should be "Turn Off" not toggle.

There's no reason to cram both automations into one rule if they're not really related.

1 Like

thanks! i had them 2 rules and decided to take a shot and condensing them. Good to know

1 Like

Probably need to check exactly how you want this to work.... Are you wanting each lght to work independently of each other, and just get the benefit from only needing to setup the one rule? Or do you actually want adjustments in each light to impact how long the other lights remain on?

If you want them to operate independently, I would take @dylan.c 's original suggestion and setup separate rules / automations, allowing you to easily maintain them or stop them from running, in addition to keeping them simple to understand and work with. You can also clone them to make duplicating the same rule easy to do.

One issue with your original rule is the following case...

Upstairs light turns on, rule is triggered.
First IF statement evaluates as TRUE and and a delayed action is scheduled to turn the light off 10 minutes later. Following ELSE-IF and ELSE statements are not evaluated.
4 minutes after the upstairs light is turned on, someone turns on the downstairs light and triggers the rule.
The upstairs light is still on because 10 minutes has not yet passed from the first trigger and action, the the rule evaluates the first IF statement as TRUE (again), and schedules a second action to turn off the upstairs light in 10 minutes. The remaining ELSE-IF and ELSE statements are ignored.
6 minutes later the upstairs light is turned off. 4 minutes after that a second off command is sent, but nothing happens since the light was already turned off. The downstairs light will remain on indefinitely.

This can all be sorted out by a complicated set of conditions and actions, but MUCH simpler to just use two rules.

1 Like

thanks everyone was hoping i could condense but sticking with the original individual ones

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.