Bug? Rule Machine required expression + local variables

I haven't had time to do any extensive testing, but here's an issue I'm facing:

Rule Machine 5.1 (Created on 2.3.0.113, still happening after I updated to 2.3.0.116) - I create a local variable boolean with a default value of false. At the beginning of my actions, I set the boolean to true. At the end of my actions, I set the boolean to false with a 2 minute delay.

Part of my "predicate" required expression is that the local variable must equal to false.

Once the delay is finished, and the variable flips from true to false, the UI shows that every condition is successfully met, but it still has the big red error that says "Required Expression false". The only way to eliminate this is to click the "Update Rule" button or Stop/Start.

Sure, I could create a virtual switch, but hoping to not deal with the extra overhead.

2021-12-05_22-57-57

1 Like

I expect the display of the "current values" may not be live, so may only be displaying changes as they happen.... No proof that this theory is correct.... just an idea...

I didn't include all the screen shots. The variables definitely were "live" throughout the process (every time I refreshed the page). I watched the variable go from true to false after the 2 minute delay was satisfied. I also observed the required expression go from evaluating false to evaluating true after the 2 minutes. However, the "Required Expression false" message is never cleared, and the rule does not fire again the next time motion is detected via my trigger.

It's almost like there's some bug where the delay in the rule doesn't trigger the predicate condition subscription, or maybe there's a problem with predicate conditions subscribing to local variables?

I'm wondering if your rule would work if you used the rule's built in Private Boolean rather than that additional local boolean variable??

1 Like

I learn something new every day; didn't know that private boolean even existed!

This worked!! The predicate condition was satisfied after the 2 minute delay and is a perfectly acceptable workaround since I don't need to manage multiple local variables!

Thanks so much for your suggestion!

1 Like