Turn switch off after 5 minutes if the switch was turned on via a specific rule

I have come up with the following rule that I am hoping will turn my exterior floodlights on when I get near the house with my phone present (Jan Burger)

I would like these lights to turn of XX minutes after the rule has been triggered by my "presence" but only turn off if the rule is waht turned the lights on.

I dont want the lights to be turned off via RM if i have turned them on manually (used the switch) or if another rule has triggered those lights to come on (i.e. smoke alarm etc)

Would appreciate the help - I am not set on using RM for this...Just a novice and that seemed the easiest to use.

First, your conditions aren't doing anything. Where there currently are is just a repository for them where you can "create or manage" them. To use them, the must be include in a rule action, either as a Conditional Action or an Expression (i.e. Wait for Expression). It also seems that what you want is for the defined conditions to be triggers. Not sure about the NOT Time is Sunrise though.

I would setup two separate rules, one for time is Sunset and one for presence. The presence rule can have an action to turn off the lights, for example

Trigger:
Jah Burger no Pickles becomes present

Actions to Run:
On: Floodlights
Wait for event: duration --> 0:10:00
Off: Floodlights

If you want it all in one rule then you can add Sunset as a trigger and use a Conditional Action to differentiate the actions. For example:

Trigger:
Jah Burger no Pickles becomes present OR
Time is Sunset

Actions to Run:
On: Floodlights
IF (NOT Time is Sunset) THEN
    Wait for event: duration --> 0:10:00
    Off: Floodlights
END-IF

I think I am looking for an AND - Jah burger no pickles becomes present AND its after sunset...

I only want the lights to come on if its dark basically - If I come home int he middle of the day I would not want the lights to come on.

In that case, use a Required Expression

Required Expression
Time between Sunset and Sunrise

Trigger:
Jah Burger no Pickles becomes present

Actions to Run:
On: Floodlights
Wait for event: duration --> 0:10:00
Off: Floodlights

How do i get to a page that lays out he rule like you have it above? Also, I cant figure out the wait for event duration piece

Maybe -

That's just text I typed in with "Preformatted text </>" applied

The Waits are in the same place you found the delay. Note that I said the Wait for event was duration but you actually want to the capability of elapsed time.

The delay should work, the only issue is if you arrive then leave then arrive again within 5 minutes. Using a Wait, the timer will reset every time you arrive. With the delay, you can make it do the same thing, it just take a little more effort. Here are effectively the same actions:

Option 1:
Cancel Delayed Actions
On: Floodlights
Delay 0:05:00 (cancelable)
Off: Floodlights

Option 2:
On: Floodlights
Wait for event: -> elapsed time: 0:05:00
Off: Floodlights

Note in option 1 that you need to make the delayed action cancelable so the Cancel Delayed Actions will actually cancel it.

1 Like

I think I got it...Will test it tonight

Download the Hubitat app