Turn Lights on for 5 minutes

I made two rules one in RM & BR.

-> Target Kitchen Slider
BASIC RULE:
BR to turn "Abby Light" ON for 5 minutes when I open the door contact. When elapsed time has expired the light turns off. That part works great. However when I close the door it reactive the rule and the timer starts again and the light turns back on. I just want it to turn the light on for 5 minutes and turn off even it the door is left open longer than 5 minutes.



-> Target Kitchen Slider

RULE MACHINE:
In this rule I was trying to turn the "Abby Light" on after the door contact (open status) has been open for more than 5 seconds.

  1. Turn the Abby Light on & The Dinning Room light on for 5 minutes and than turn them off.
  2. Send a message that the door is open to my phone. Not in the rule right now but I want it to send a message to my phone every 5 minutes that the door is open. Example: 8:05, 8:10 & 8:15 and so on.
  3. This rule will be fine tuned of course once I get it working. This is a TEST rule.

Kitchen Slider 3


Just put an OFF: Abby Light, Dining Room Delay 5 min right after the On.

3 Likes

This one is very simple in rule machine

2 Likes

This app will do almost what you want. Contact opens, will run a switch for entered time then turn it off. Can send a notification of it turning On and turning Off. Only thing missing is the every 5min notification. Something for me to think about adding someday.
Use Trigger #1 with contact and Action #3 with 5min duration time.

Okay I have the rule working great for turning the light on and staying on for 5 minutes. And when I close the door it does not re-trigger the rule. Now all I want to add to the rule is door is left open for 20 minutes I get notified. I do not have the 20 delay in the rule yet. Just trying to get the notified right now.


By the a big thank you to all that have reached out to help me with this rule.

You don't need the IF/END-IF statements in this rule. Since the trigger is set for open, you already know the contact is open, no need to check this condition again in the actions.

I'm not sure I understand what you mean. The way you have it right now, the rule will trigger each team the contact is opened for at least 5 seconds. So for example, if you close the door inside of the 5 minute delay, then re-open it for 5 seconds, the wait will be cancelled, the rule re-triggered and a new 5-minute timer will start.

If you want the light to be shut off when the door is closed or after 5 minutes, whichever comes first, just change the "Wait for event - elapsed time" to a "Wait for event - contact closed" with a timeout set to 5 minutes.

IMO, while you can add that feature to this rule, it would be easier to create a second rule, with a trigger of "door is open and stays open for 5 minutes", or use the built-in Notifications app (use the "for how long?" parameter), which allows you to easily control how many times you'd want to be notified. etc.

In the case you want to add the notification directly in this rule, you'd want to re-check the contact open condition with an IF after the wait.

2 Likes

You don't need the conditional as you can imply that from the single trigger. Once you start making rules with multiple triggers, you may need to sort out what to do about them.