Rule not triggering as expected

I have a couple of rules in Rule Machine that are not triggering as expected.

The intent - when physically turning a switch either on or off, an override variable is set to true for 20 minutes

The rule:

When the switch is off and I manually turn it on, I see that the switch registers the physical action:


and the rule runs as expected:

but when the switch is already on and I manually turn it off, I see that the switch registers the physical action:
image
but the rule does not run:
image

Am I doing something wrong?

Can you post the full event list for the device covering those two times?

Not sure why that doesn't work (someone more clued up with RM will advise)

I wanted to do something similar to override motion lighting and stop the lights going out if we weren't moving. I had to do two rules - one for physical on/physical dim to set a variable true, and another for physical off to set the same variable false again (with a 5 second delay for me to clear the PIRs coverage). I did it that way so that if the motion lighting had already put the light on, I could just press and hold the switch to dim it a fraction and the variable would flip and do the override (rather than switching off and on again). I did the below, but will keep an eye on your post as your method may work better....


Screenshot 2022-08-23 at 16.06.02

Here's a more complete event list:

Let me know if any other data would help - thanks!

Odd...was wondering if the switch state wasn't updating when it was turned on, so when it was turned off, it wasn't recognized as a "change". Could you try setting your trigger to "physical on or physical off" explicitly and seeing if that makes a difference?

1 Like

Its been awhile but I have seen where setting a trigger for a physical change will not work, but if you set two triggers one for a physical on and one for a physical off it will. Something to try

Very odd - I changed the rule to trigger on Physical On, and it works as expected. Changed it to Physical Off and it works as expected...then changed it to Physical On OR Physical Off and the rule works as intended!

@bobbyD , Is this a bug in Rule Machine?

If I remember correctly, there was a bug fix for this, many updates ago. Mind sharing what platform version are you running and RM version?

C7, v2.3.2.141; Rule Machine (Rule-5.1)

Edit: I found some other scenarios in the same rule that don't work as expected when trying to physically dim; I'll try and get some screenshots/examples of those as well

Thanks for the details. More logs would be great. Also, please expand the logs, especially for the off event you are showing above. Were there any other logs related to that event?

Here's another example:

Added physical dim triggers:

Device events show physical dim:

and event logged, but rule doesn't run:
image

Happy to provide more, just let me know what you need! Thanks!

You are not showing what happened after the level 1 event came in. Looks like both on and off physical events triggered in the latest screenshot.

That's the weird part - once the event comes in, there ARE no other logs for that rule...

Here's another example - I physically dimmed up, dimmed down, dimmed up, dimmed down:
image

The rule executed on all actions EXCEPT third (second "dim up", at 11:09:33):
image

I don't know why it didn't fire at 11:09:33. I wish the misfire was consistent, as that would have been a bug in the app. But looks like something else may be going on with your hub. I'll have to dig in deeper. Please send me a PM with your hub's ID and we will further investigate. I'll also set up an identical rule to see if I can replicate this behavior.

3 Likes