im trying to have an easy way to pause rules via mobile app dashboard, i created a virtual switch for the dashboard tile, i asked ai to make me a rule so on press of virtual switch to pause rules, this does not work ai is not sure seems like. Is there a way to do this? If so could you select each rule or all rules? Then when virtual switch is turned off they all resume
Just use Rule Machine. Use your virtual switch as a Trigger, and then use the Pause/Resume action as desired.
great thank you, i started messing with rule machine, i created a rule if motion is activated which is my trigger, a condition is midnight - 5am, action is to turn lights on then i created another action to turn off delayed at 10 mins, does the delay time stack or reset if motion is picked back up within the delayed time frame? example is motion is activated all lights turn on the count down of 10 mins starts to turn off but motion is activated again before 10 mins is up from first activation would the delay time just restart? @ogiewon
The answer is... it depends on how the rule is written.
WAIT actions are automatically cancelled every time the rule is re-triggered.
DELAY actions are not automatically cancelled.
In your example, first, I would strongly recommend you utilize the built-in Room Lighting app, instead of building this automation in Rule Machine. The Room Lighting app was purpose-built for exactly this type of lighting automation, and has a bunch of options available that would be challenging to implement in Rule Machine.
If you really want to do this in Rule Machine, here is what I would start with.
The above rule has a time-based restriction, as you mentioned in your post. It is triggered by motion going ACTIVE only. Once triggered, and if during the correct timeframe, the first action will turn on the light at the correct brightness level. The rule then 'waits' until motion has gone INACTIVE for 10 minutes continuously. Once that occurs, the light is turned off.
If the motion goes inactive for 7 minutes, but then motion is detected again, the rule will be triggered, the original WAIT will be cancelled, and the actions will run once again. This has the effect of resetting the 10 minute timer once motion goes inactive again.
In the Room Lighting app, here is what it would look like.
Hope this helps!
@ogiewon amazing explanation thank you for all that i appreciate it ! The question becomes if i want to use mobile app to pause rules can rule machine control room lighting app rules? Another example would be, have a polebarn if i set a rule after those above times if motion or door sensors are triggerd in those time frames to turn lights on and alert, but what if im outside working past midnight i would like to pause them from my phone via mobile app dashboard just click the virutal switch and they pause untill un selected v switch is off. I do understand you can use webbrowser to go into panel and do it like that but sometimes mobile app is faster in different situations
@ogiewon also why choose room lighting over rule machine? Im really new to everything and dont mind learning , i see all the options and different things you can do with RM but im sure after trial and error and learning it will work good just would like to understand from a seasoned pro
Yea, I think I see where you're coming from.
What is great about Hubitat is that it provides many ways of accomplishing one's goals.
However, for my requirements, I have never needed to pause/resume a rule or automation. I utilize the built-in Hub "Modes" to break the day into different time zones like "Day", "Evening", "Night" and "Away". "Away" is the mode whenever everyone has left the house. I use the built-in Mode Manager app to automatically switch modes based on time of day, sunrise, sunset, and whether or not our phones are home. This provides me with the necessary flexibility to control lighting under all circumstances, regardless of the time of day. I also use Mode to control whether or not some automations run. For example, I have a Notifier automation (using the built-in Notifications app) that will send me a notification is any door is opened when we are AWAY (mode = away). But, when anyone is home, that Notifier will not send push notifications, as we expect the doors will be used.
Here is an example Room Lighting instance where I use Modes to control what the lights will do.
Per Mode Lighting Settings for the above Room Lighting instance
Just thought I'd share an example that utilizes Modes, in case that might aid you in your design goals for using the hub.
One of the many great things about the Hubitat development team is that they 'truly eat their own dog food!'
The team that created the Hubitat Elevation hub were originally SmartThings users from back in the 2013-2017 era. They were some of the most prolific community developers for the SmartThings platform, sharing tons of drivers and apps, including @bravenel who is the author of Rule Machine. The team grew tired and weary of the direction that Samsung decided to take the ST platform after they acquired ST. They also decided that local control, not cloud-based, was the way to go for performance and reliability. Thus, Hubitat released their first commercial hub, the C3, back in Q1, 2018. I have still have my C3 running for development purposes to this day.
All of that said - these guys development these built-in Applications, like Mode Manager, Room Lighting, Notifications, Hub Safety Monitor, etc... to make everyone else's life much easier. These apps take into account real-world (i.e. the dog food reference) ways in which users like to perform certain types of automations. For example, Notifiers can be configured to repeat notifications until the condition that triggered it is changed. Want to nag your family to close a door? Send them a repeating push notification to their phone until the door is closed! Want an easy way to keep your bathroom lights on while you're in the shower and the motion sensor in the room goes inactive? Add a second motion sensor in the shower area whose only purpose is to do just that. The built-in apps have a bunch of options that most users would never even consider if all they tried was Rule Machine. RM is great, don't get me wrong. But it can be very difficult and challenging to try to reproduce the functionality of many of the built-in Hubitat apps.
I do much the same. However, I have a Room Lighting automation that works well for my different modes/times EXCEPT when we want to relax out in the hot tub.
The main rule is based on time periods, and turns on all the outside lights when motion is active at any of my external motion sensors. But, when we are in the hot tub, we do not want the back floodlight popping on when the neighbors dog runs too close to our sensors, or when we run back and forth to get something to drink, etc. So, I duplicated the rule with all the lights except for the back floodlight. Then, I use a virtual switch to disable one rule and enable another. I can call the switch from Google, Alexa, Or use our dasshboard mounted next to the deck door.
@ogiewon Hey so i did some rules but I have a condition of times for a certin action to turn lights on if motion is active and turn off after 10 mins how would i only turn off lights that were already off? Meaning if rule triggers and there is already a set of lights on the rule does not turn them off like IF lights were already on to skip the turn off part of the rule?
example : kitchen lights are already on, motion triggers my actions to turn other lights on, after 10 mins action is to turn off lights but can you skip devices that were already on.
That’s a good question, and one that I have never explored personally. I am tagging @bertabcd1234, as he is very knowledgeable when it comes to questions like this. Hopefully he knows an easy way to accomplish this using Hubitat’s built in apps, as opposed to a complex RM Rule. ![]()
I'm not sure about any purpose-built built-in apps. WebCoRE can probably do it by saving an array of devices matching a certain state before you do anything (I don't use webCoRE for automations anymore), or with Rule Machine you could probably make use of the "Capture and restore" set of actions to get something like what you want, depending on what parts of "being on" you actually care about (this would really get the whole state).
I suppose you could use Room Lighting or Groups and Scenes and "capture" a scene (or RL equivalent setup) before and (re)activate that scene after, to use entirely built-in, purpose-built apps... ![]()






