Temporarily suspend motion sensor control of light in RM 5.1

A RM 5.1 is set up with a motion sensor is the trigger for turning a light on to 20%, and the light stays on for a few minutes then automatically turns off.

At times, the light needs to be on at 100% for an extended period of time. For this, I set up a double tap on the switch that controls the light.

The double tap up is position 1 on the switch and works great to keep the light at 100% and override the auto turn off until someone double taps down (position 2) as long as you don't retrigger the motion sensor. HOWEVER, if anyone triggers the motion sensor, the light auto turns off. I would like the light to stay on for as long as the switch is in position 1, and not auto turn off until it is 2x tapped down to position 2.

I've searched the forums but must be using the wrong terminology, so either I'm the only one who has ever had this issue, or I'm searching wrong... Any links to posts that explain this or suggestions on how to keep the light on even when people are triggering the motion sensor?

Below is the rule. I don't understand why the motion sensor triggers it to go off when the switch is in position 1...
image

While it would be possible to create some logic to do this in Rule Machine, have you looked at either Room Lighting or Motion Lighting? Both have an option to do exactly this.

Your rule looks more or less like it should work, but no one can say for sure without seeing the entire rules (at minimum, your screenshot is missing the trigger events). One thing that could help you figure things out -- or at least also help someone else -- is to enable all logging for the rule and see what clues the Logs output for this rule provides.

2 Likes

It looks like you have two triggers to this rule: (1) double tap up and (2) the motion sensor. Assuming this is the case, I’d modify a couple of things. First, I would turn your motion sensor trigger to be a conditional trigger. It should be motion active only if private Boolean is true.

After you make that change, modify your rule for when the switch is double tapped. Have the first action set the private Boolean to false. Have the last action before the else reset the Boolean to true.

Basically, the motion sensor is cancelling out the wait because the rule is being retriggered. Using the private Boolean and a conditional trigger will get around this issue.

Thank you for the response!

Actually I only have one trigger to the rule - if the motion goes active. But thinking through your response, maybe that it the problem?

I'm trying to make the motion sensor going active trigger the light to go on at 13%, but only if the 2x tap button =2. If the 2x tap button = 1, I want it to wait until the 2x tap =2

You note I should make the motion sensor trigger a conditional trigger. Isn't it already a conditional trigger? It only triggers IF...

I'm searching this site for what a private Boolean is.

You wrote:

You are exactly correct - the wait is being cancelled. I'm having a hard time getting my head around it because even if it is cancelled and retriggers the rule, the rule should not do anything if it runs into the 2x tap switch being in position 1....

I'll have to work on this after the holidays. Have been banned from changing ANY automation for a week starting tonight...

i do it all in rule machine with a virtual switch and physical presses to trigger..

ie

1 Like

What exactly are you trying to do? Limit the motion sensor except for when a button is in a certain state? Does pushing button 1 twice do other things or are in a different rule? If so, there might be a way of simplifying all of this into a simple rule with a required expression.

With the above said, my suggestions would still work with just the trigger of motion active. You can find more information about conditional triggers and Private Booleans at Rule 5.1 | Hubitat Documentation.

Yes, the only Trigger = Motion Active

90% of the time I want the Motion Active to trigger the light to turn on at 13%, after sunset/before sunrise, and for the light to turn itself off after 2min 15 seconds of no motion active. That part works great.

Then I learned there are limited times when the light needs to be on at 100%, and to STAY on, until my household decides it needs to go off.

So I've deployed the 2x tap feature on a switch to act as an indicator.

If the light needs to stay on, 2x tap up on the switch, and the switch reports 2x tap value =1.
image

When 2x tap value = 1, my rule SHOULD stop the motion sensor from both triggering the light to on at 13% brightness and stop the auto off of the light after 2 min 15 seconds.
BUT it stops neither: Even when 2x tap value = 1, if the motion sensor is triggered, the light goes to 13% then auto shuts off after 2 min 15 sec.

When the activity is done, user can tell the light to go back to being controlled by the motion sensor (about 90% of the time) by 2x tap down on the switch, so the switch reports 2x tap value = 2
image
This part works ok.

I would again suggest enabling all logging for the rule, then looking at Logs for clues (here if they aren't helpful for you) as well as sharing the entire rule if you still need help after that. Good luck!

What type of switch are you using? Usually, when we start talking about double taps, the switches have been converted to buttons. If this is the case, buttons are generally stateless with only a momentary activation. This would explain your issues as to why it is not working at all.

@bertabcd1234 suggestion of Room Lighting would be a good solution as it can handle buttons to disable and re-enable activations. Otherwise, you’ll need to separate out the rules. @kahn-hubitat’s suggestion of virtual switches would do the trick. Have double tap up turn on a virtual switch. Have double tap down to turn it off. Then you add a required expression to your motion rule of the virtual switch being off.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.