Disable Turning Off Events

I have a motion sensor turning on a light then turning off with no motion after x seconds. I have it not turn off if the smart switch controlling it is pressed up. Then I have the re-enable set to when the light is turned off (only closest option for my situation). Once the light is manually turned off and triggering the motion again, the light does not turn on until the motion stops for x seconds and the motion is triggered once again.

I'd hate to have to use multiple rule machine rules and variables for this to work. I assume it is working as intended but unless I missed a way for this to work I suggest a re-enable event that simply stops and exits the 'rule' until motion is triggered again.

Once the switch button is pressed to keep the light on, this 'rule' is no longer needed and shouldn't stay active, in this case.

Can you post some screenshots of your Room Lighting setup, including the main page, plus the on and off settings pages.

I have something almost exactly the same working for me, so it is possible, but think it would be better to work through your example.

Sure, I think this shows all you need. (note: using test devices, but doesn't change outcome)

Reading your original post again and looking at the RL setup, I'm not quite sure what you could do. Even while you manually control the light / disable turning it off with the button, the motion sensor will continue to detect motion, completely independently of anything with HE or RL. So I would expect the motion sensor will only send a motion activation message to HE once it moves from an inactive state to activated.

What motion sensor are you using? Does it have a long "cool-down" period? Could this be more the problem?

You may have a point about needing to move through the X seconds period in RL....

If I understand what you wrote, the problem is the rule staying active after the button is pressed UNTIL the motion sensor is activated and allowed to be inactive for x seconds which will idle the rule. Only then will the rule work as intended and turn the light on again.

The motion sensor is not the problem, the way I see it. There needs to be a way to stop the rule from being active on a disable event not when it completes the turn off events either directly or via re-enable event.

What motion sensor are you using?

Or perhaps the other way to phrase the question, if you activate the motion sensor and leave the room / area, how long before it becomes inactive? You can look at this via logging (when turned on) or via Device Events page.

This is likely the case, I just expect the larger impact to your issue is likely the motion sensor setup. Or at least worth ruling out....

Perhaps I got a little blinkered in my assessment of your issue. I shouldn't discount the potential for an RL issue as being more significant. All I know is that I don't experience that with my Hue motion sensors which have quite a quick 10 second cool-down, compared to many motion sensors. That doesn't completely stop your issue from occurring... but I'll stop there... :slight_smile:

PIRZWAVE2.5-ECO in test mode which deactivates in 5 seconds.

1 Like

Well you win!!! :slight_smile: That is impressive for many of the motion sensors I have seen written about around here. I would then definitely agree the motion sensor is not the issue.

I was cleaning up my hubitat and wanted to use more built-in apps but I see now why I did everything in rule machine. I guess I will stick to that.

RM = The original built-in App and still the best :wink:

Thanks for your thoughts. Already have 2 rules working in rule machine. :slight_smile:

1 Like

No worries.

If I interpret your request in more detail than I did originally, what is happening vs what you want to happen is:

Is happening:

Light turns off, re-enabling turning off
Motion Inactive Event
Motion Active Event (No Action Taken by RL)
Wait for 0.1 seconds
Motion Inactive Event
Motion Active Event (RL Rule Activated)

Desired Behaviour:

Light turns off, re-enabling turning on and off in RL
Motion Inactive Event (Wait for 0.1 seconds not used)
Motion Active Event (Light turned on)
Motion Inactive Event (Wait for 0.1 seconds)
Light turned off

Close.

Happening

Motion Event
Light Turns On
Button Pressed (stop light from turning off when motion stops for .1)
Motion Stops
Manually Turn Light Off (rule still active, does not trigger re-enable criteria, is properly reported off)
Motion Event
Light Does Not Turn On (because rule is still active)
Motion Stops
Wait .1 (rule idle, light turned off even though it was never on meeting re-enable criteria)
Motion Event
Light Turns On

Desired

Motion Event
Light Turns On
Button Pressed (stop light from turning off when motion stops for .1, STOP RULE AND IDLE HERE)
Motion Stops
Motion Event
Light Turns On

Then I wonder whether your issue is more the reporting of the state of the light? Given it is driving the disabling / enabling?

Tried with in-wall and plug in z-wave plus devices, same results. If that was the case, why does rule machine work?

Simply put, RL, in some cases, does NOT need a re-enable event and just needs to stop when a stop condition is met.

Have you checked the timing of the Events / logs for the device? Compared to the behaviour you are seeing in RL?

I had the individual device pages up monitoring the states during testing.

Looking back at your RL screenshots.... I am expecting that the "Limit Activation..." settings would stop the RL rule transitioning into the Active state, but the change in the "Lamp 2" state occurs after this has happened. For what it's worth, I use a separate Virtual Switch that is triggered via a separate Button Controller or RM rule, which I can only assume get's changed before RL is affected. So maybe that is what is happening and what you need to adjust....? Maybe the limiting of the RL Activation is not happening when you think it is, meaning the RL App is in the Active state, and you need to limit this through other means?

At this point I think I have used up all my likely thoughts on this issue, and probably best to see what the experts recommend :slight_smile: If I can contribute again I will try....

This is probably not needed and actually may be breaking it.
image

Turn on logging and debug logging, get a a screenshot of the logs.

You may want to also add the option "Switch to determine all lights are off" and add the lamp 2 switch so the RL goes inactive when you manually turn the light off.

The problem is probably that the RL instance is still "active", so then the motion trigger no longer is turning it on. There is also an option "Activate even if partially activated" which would bypass that.

3 Likes