Private boolean trigger

friends. I think I caught a bug. if one rule defines a private boolean of another rule, in which the change of a private boolean is a trigger, then the last rule is not triggered. an example in the screenshots. the rule does not work. you need to run the rule manually. Currently running version: 2.2.8.156. Rule machine 5.0


I suspect that the change of value of the boolean is not generating an event. You can turn on all logging to see if this is the case.

An event needs to be generated to trigger a rule.

I tried to replicate this problem by setting up two simple rules:

Rule 1 (triggers on PB change):

image

Rule 2 (changes PB on Rule 1):

image

This worked as expected the first time, and I was prepared to say that I couldn't replicate the problem. (This was by me manually running the actions of rule 2, though how those get run shouldn't matter--I just needed a way to set PB on rule 1.) But then...I noticed that it said the predicate conditions in rule 1 were set false. I'm not using predicate conditions in rule 1, so this is mysterious:

If that is happening to you, too, I suspect that this would be the cause of your problem--but a bit different of a problem than a PB change itself not triggering your rule. I was able to work around it by adding a "dummy" predicate condition, something that would always be true (like a virtual switch that is always on that you create/use just for this purpose). This bug looks like it's unique to rules without a predicate condition, with PB apparently affecting that state when it shouldn't.

Tagging @bravenel if he hasn't heard of this problem already or needs more information.

Interesting. Able to reproduce this. Will figure out what's wrong...

Well, that was some messed up code, attempting (and failing) to deal with Predicate Conditions when Private Boolean is set by another rule. This will be fixed in the next release.

3 Likes

there is no message in the log about the creation of an event when the private boolean changes. however, an event on this trigger tries to start. however, private bulean falsé always comes to the event. and upon repeated receipt of falsehood in the log, a message about an incorrect predicate, although it is not used in the application. private boolean never comes. even if the rule changes it to true, it comes all the same false.

But if you add a forced start of the rule after changing the private boolean, everything starts working correctly.

stPrimed = true

Yeah, the code is very messed up for this. Fix will be in the next release.

1 Like

Download the Hubitat app