A question about how to build lighting rules in Hubitat for a specific scenario.
Basically, I have a light bulb and motion sensor in the hallway. It works just fine but I want when I turn the light on manually (non-motion), it stays on and doesn't turn off when it detects motion events. Sometimes I just want the light on all the time (have a party or something) and whenever someone walks into the hallway, the light keeps turning on and off because it senses motion.
Something like:
If the light is on, do not process motion events.
Should I use "Motion Lighting Apps", "Rule Machine"? Do I do this as a restriction? Suggestions appreciated
Thanks, ya I was thinking about that too but would prefer the condition to be related the the light status, IE: If itās on, donāt do it. Iām playing around with Rule Machine and seeing what I can come up with. I was hoping this would be fully automated. Without an App, logging onto the Hubitat website to press the Virtual Button is a bit cumbersome. Hoping for the mobile app soon so I can use restricted buttons for other actions/ideas. Thanks
1st Rule -> If light #1 is off and motion detected, turn on light #1. Chain this to 2nd rule
2nd Rule -> (Dormant, only invoked from 1st Rule). Loop this rule to evaluate motion every minute and turn off light #1 if no motion detected.
I tried playing around with Private Boolean, Evaluate Rules, etc but just canāt figure this out in RM. There is no way to change the order of Rule actions and just feel like I am stuck in a box. I am sure there is a way but really struggling to get Rule Machine to do such a simple task.
Iām confused as to why you want to chain them. This is a simple one shot rule, detect motion, turn light on for the true condition, for false, turn off the light with a delay, in the delay section select cancel on truth change, this will keep the light on while there is still motion happening.
I tried to keep my explanation simple as to why, but Iāll elaborate.
I donāt want motion events to take place on Light #1 if the light is already on. If I manually turn on the light, I donāt want the motion sensor to take over and turn it off when it stops sensing movement. Because of this, your suggestion wonāt work. I also donāt want to do a āparty modeā switch, just a simple, āIf the light is on, donāt do anythingā
Secondarily, I need to isolate your suggestion (which is what I really want in the end) to a compartmentalised rule so that the evaluation of Rule #1 is the only invocation of these actions. If I donāt do this, again this rule would take over the bulb and turn it off once movement stops.
To keep things simple and remove the āwhyā out of the equation, can someone please help explain:
How can I create a āruleā that is only invoked from another rule (not a trigger/state change) and loop it?
Once I figure that out, I can take it from here. After using C0re/Webcore for so many years, I am finding it very difficult to figure out how to do this in Rule Machine.
Maybe you need to create a virtual switch thatās tied to the real switch. If virtual switch is on (by manual switching on the lights) then use that virtual switch as a restriction for the motion sensing logic. When you manually switch off the lights again, the virtual switch turns off, thus allowing the automation to resume.
Was wonder what you ended up with? I am looking at really tuning my motion lighting more and I find the same problem. If the dimmer is switched into the "on" position manually I want this to suspend the motion lighting until the switch is then turned off again manually.
Also is there a way to do this with brightness? For example I have different brightness levels for certain rooms that when motion is detected and the mode is set to let's say "night" then turn lights on at this level. The problem is lets say I go into that room at night and the level is lower but I tell Alexa to raise the brightness to 100%, I want it to stay that way until the motion stops and the light is turned off or if I manually turn off the light.
Also would this be possible without using virtual switches using just RM, ML or SL.
So if I use the option "Switch to disable turning on" would this work? Meaning once the switch is pressed then motion lighting is disabled until this switch is off?
What about when I issue a command to set the dim level? Do I use the "Override for level only?" option?
Okay this makes sense, so if the lights were turned on by motion and I manually adjust the level with the override option enable, then this should prevent the next motion event from changing that level or turning the light off.
@bravenet I wasnāt able to get this to work. Iām using Lutron switches and dimmers and setting the option for āswitch to disable turning offā caused my lights to turn on by motion and then would never shut off. I contacted support about it and Bobby told me this is intended behavior and the way to do it would be to create a virtual switch and have it poll for manual button press to disable the motion. I havenāt yet set this up as Iām awaiting his response I just replied tonight.
I would like the lights to work on motion sensor 30 minutes before sunset through until 30 minutes after sunrise, also be able to disable motion detection by pressing the light on at the switch or dimmer until it's turned off at the switch. When itās turned on I would prefer it turn on at the dimming level set by the mode and resume in the proper mode based on time of day for dimming level. I would like all lights in the house to be turned off when mode away is activated except my sons room (I currently control this with a simple lighting rule that is working fine). They should however continue to function on motion detection while in away mode as my son is home at times when I am not and he does not want to be hooked up to any presence detection.
OK, let's take it a step at a time, starting with the very last step: For Day mode manual turn on to 100% use Mode Lighting, and only specify Day mode. In Option for On select those switches that you want to activate the lights on with (could be all of them), and likewise in Options for off select those switches that should turn all of the lights off.
For the motion part, you can put the time restriction in Motion Lighting for 30 before sunset to 30 after sunrise. The disable part is a bit tricky the way you've described it working, so I will address that last.
For turning all of the lights off (except son's room) when Away, a Simple Lighting rule will do that. For the motion lighting to continue to work while Away, just include that mode in the Motion Lighting app you setup.
That leaves the disable part: I think the idea of using a virtual switch is a good one. You'd use that virtual switch to disable either on or off or both (as desired) in Motion Lighting. To set the virtual switch use Rule Machine rule with "Physical Switch" as the condition. Use the true part to turn on the virtual switch, and the false part to turn it off. I couldn't tell from your description whether you wanted on or off or either to cause this. But you can write the rule to accommodate that choice. For the lights coming back on to the right level, I'd again use Mode Lighting (as above for Day mode), adding the other modes. Mode Lighting will catch the turning on with the switch, while Motion Lighting will handle the motion activation part.
Edited: You could also do the lights coming back on from manual on by selecting the switches in Motion Lighting under Options for On, Activate with these switches.