Correct way in Rule Machine to do this light on motion then off after 5 minutes?



been googling ofr 2 days an watching videos, on this trying ot get my automation i had in ST back at least to a point

1 Like

There is a Motion Lighting app built into HE that can do this with a few clicks. Are you using Rule Machine instead because you want to learn it, or ?


Example below:

1 Like

yes I want to learn it and make thing more "smart" in time and i know the biult in APPs have limitations becuase i was already running into them in ST

For example I want to make a "party mode" at some point to hold the locks open and not be flipping off the lights.

plus if i dont learn it when somthing falls out side of the biult in app then ill be WAY over my head.

Also it seems to work at least to turn it off

not i gotta figure out my utiliy rooms light htat turns on and off with Door contact or motion and stays on if there motions lol

1 Like

Have fun!

i know it going ot take a while but i figure if i don't get the basics down ill NEVER be able to figure out advanced stuff.

The motion lighting app is actually super powerful, like you can select buttons, switches, or contact sensors to trigger the on/off state, or stop the trigger of the off/on state, or even trigger that device itself when the motion lighting rule triggers. Then you can create smaller RM rules that use those events as triggers to do what you want. Lots of options and you likely will have plenty of chances to use RM, but imo use the easy stuff when you can.

For instance, over the holidays I completely revamped my kitchen motion lighting automation in Node-RED to accommodate RGB undercabinet lights alternating between red and green lol. But to do that, I had to create the base functionality from the ground up. Long story short it was no small task especially with multiple triggers and multiple ways to turn the motion on and off and trigger the Christmas mode on and off. But since I have no use for it any longer, I disabled it, and re-enable my good old motion lighting app for the kitchen.

Motion Lighting App


Node-RED Replacment

One bit of advice, reference the documentation for the mode and motion lighting app, there are a ton of options in there and a lot of the descriptions are very wordy and confusing imo, not knocking anyone as the concepts are very hard to describe without examples, but the documentation helps a lot in that regard.

1 Like

It is a bad assumption on your part that your experience with built-in ST apps applies to built-in HE apps.

As exemplified by the Hubitat’s Motion and Mode Lighting app


I agree, I think HE has garnered enough good will to at least be given a chance in this regard, after you give it a chance and you find it lacking then so be it, but coming in assuming it isn't up to snuff may just make your life harder than necessary.


I like rule machine so I have info when it fails. I can track events, triggers & actions. I don't see that with simple automation.


100% and I agree it is super frustrating when you have a bug with the built in apps, especially when it is not you and ACTUALLY is a bug with the core code. But for that you pay with harder upkeep and changing, and my understanding is less optimization compared to a purpose built app.

1 Like

I get why you find that useful. :slight_smile: I just haven't had significant problems w/SA and the Motion app so that hasn't been an issue for me. I also don't have automation needs complex enough that RM is required for me, and I find creating and editing rules in RM annoyingly "clicky," as in way too many clicks required.

Really glad HE and the HE community provide enough options/choices that folks can each find their own way.

1 Like

thank you all for the input, I might check out the biult in soon, but i didn't want to have to learn 3-4 apps on my migration and wanted to learn RM

so far the only thing im stuck on it RM is getting the lights to stay on if the motion keeps happing

1 Like

Your rule, if you want to go that route, has two problems: your "Wait for active" should be "Wait forward inactive" (it's already active or the rule would not have triggered; I assume this was a wrong selection by accident?). Second, you need to remove the timeout and add a "Wait for event/elapsed time" for 5 minutes before the "Off," otherwise that "off" is going to happen regardless of what the sensor does.

If you watched the video from a year and a half or so ago, this would be similar to what they did, except likely with "Delays" that need to specifically be canceled ("Waits" avoid this: the rule triggering again gets rid of them), an option not as easily available at that time. But I also second the advice to not immediately discount the built-in apps. This isn't ST. :slight_smile: Good luck!


no mistake just lack of experiance. LOL i honselty do not follow what you are saying here

I once i get this working I'll try out the app for my other lighting stuff since everyone seems to like it so much :slight_smile:
but i will not beable to sleep until i finsh this LOL

I guess I should just state the two changes plainly. :slight_smile:

  1. Change your second action to "Wait for event: Kitchen motion inactive" and remove the timeout.
  2. Add a "Wait for event: elapsed time 0:05:00" between your (current) second and third actions, so just before the "Off: Kitchen" action. This is under "Wait for events," which I think is what your screenshot is asking.

If this isn't easy enough, I might second the suggestion from others above to start with Simple Automation Rules (the easiest app that can handle the automation above) or Motion Lighting (not much more complicated but has more options than you need for just the above). But I do understand wanting to learn Rule Machine, and the above modifications are one way to make the rule work as expected (there are more in the docs) if you want to keep using RM for this.


like this?

OMG, it's incredibly clicky and rat maze like, no flow, like node red or other GUI programming interfaces. And if you click"back" then all hell breaks loose, like it was programmed by Dominion.


No, the "Wait for event: Motion active --> timeout 0:05:00" thing is still problematic. "Elapsed time" is an option you can choose with "Wait for event" rather than a specific device/capability. (If you don't see this, make sure you're on at least Hubitat platform 2.2.4 from Settings > Check for Update.)

I will also confess to not checking through all the motion/contact logic but will trust that you did. :slight_smile:

i just got my HUB saturday, and i checked for updates, from the screen shot a couple posts ago I dont have that option under the delay/repat/wait


Are you sure? Again, it's under "Wait for events":