More Advanced Trigger?

Hi, I am new to Hubitat, coming from ST & Webcore. I am trying to create a rule that after 20 minutes of motion inactivity, to turn off some lights. I have gotten as far as the trigger of motion inactivity, and then to turn off the light after a 20 minute delay, however, its not working how I'd like. Is there a way to trigger inactive motion for 20 minutes, and then have an action, vs having the 20 min delay in the action? My lights are turning off too frequently, when there is also motion within that 20 minutes to keep the lights turned on.

First, if you don't have a reason to use Rule Machine for this, I'd suggest the built-in Simple Automation Rules (formerly Simple Lighting, which you'll probably still see in the docs) or Motion Lighting apps for this. Rule Machine is a bit overkill just to turn off lights from motion.

That being said, the Rule Machine docs have an example exactly like what you're looking for. I know it sounds boring, but it's highly recommended reading if you use RM. :slight_smile: As an alternative to what you'll find there, you could use a newer paradigm staff have begun suggesting:

Trigger: Motion active

Actions:

Cancel Delayed Actions 
On: Lights //assuming you want this 
Wait for event: Motion inactive 
Delay 0:20:00 (cancelable)
Off: Lights

EDIT (spring 2021): you can now do something like this for the actions (see trigger above), which is probably even easier:

Actions:

    On: Lights //assuming you want this 
    Wait for event: Motion inactive 
    Wait for event: elapsed time --> 0:20:00
    Off: Lights
4 Likes

Oh wow, that was simple. :slight_smile: Thank you!!