Rule machine required conditions returns false negative

Hello,

So I had this same issue a while back (old thread here Predicate condition is true but system think's it's false) which stopped being a problem after some time with updates.

Unfortunately, it's back! This is one 2.3.4.133 and exactly the same situation as before. The condition should be true but it's marked as false and the rule fails to run because of it.

The only thing different this time around is that I have another rule that pauses this rule and then resumes it at a later time. But the problem isn't that it's paused so I don't know if it's related or not. Here's screenshot of the other rule that controls the rule above.

You must show logs from the rule. The red text in the app name is not dynamically updated, and may or may not reflect the actual state of the Required Expression (in general). You can also look at the App Status page for the rule, under Application State, for a variable named stPrimed. That is the Required Expression state, true or false. But, be aware that the App Status page is not a dynamic page either, but will show current values when refreshed.

3 Likes

Okay I turned logging on for the rule. Will post update once logs generate unless there's some other logs you were suggesting. I also just checked the stPrimed rule, was false. Clicking on 'update rule" does flip everything back to true

1 Like

Ok here is the logs

app:7492023-01-19 02:41:26.944 PMinfoInitialized
app:7492023-01-19 02:41:26.786 PMinfoUpdated: Required Expression now true
app:7492023-01-19 02:41:23.058 PMinfoInitialized
app:7492023-01-19 02:41:22.927 PMinfoUpdated: Required Expression now true
app:7492023-01-19 09:01:00.253 AMinfoEvent: Resumed by This rule is used to turn off other rules based on how long ago goodnight was activiated
app:7492023-01-18 10:24:05.421 PMinfoEvent: Paused by This rule is used to turn off other rules based on how long ago goodnight was activiated
app:7492023-01-18 10:13:57.050 PMinfoInitialized
app:7492023-01-18 10:13:56.931 PMinfoUpdated: Required Expression now false
app:7492023-01-18 10:13:53.257 PMinfoWait for Event: Motion Sensor - Master Bedroom motion inactive but failed to stay that way for: 1:00:00; Waiting for Event
app:7492023-01-18 10:13:53.224 PMinfoWait Event: Motion Sensor - Master Bedroom motion active
app:7492023-01-18 10:12:43.416 PMinfoWaiting to stay 1:00:00 for Wait for Event
app:7492023-01-18 10:12:43.396 PMinfoWait Event: Motion Sensor - Master Bedroom motion inactive
app:7492023-01-18 10:10:51.691 PMinfoWait for Event: Motion Sensor - Master Bedroom motion inactive but failed to stay that way for: 1:00:00; Waiting for Event
app:7492023-01-18 10:10:51.658 PMinfoWait Event: Motion Sensor - Master Bedroom motion active
app:7492023-01-18 10:08:13.729 PMinfoWaiting to stay 1:00:00 for Wait for Event
app:7492023-01-18 10:08:13.695 PMinfoWait Event: Motion Sensor - Master Bedroom motion inactive
app:7492023-01-18 10:07:06.216 PMinfoWait for Event: Motion Sensor - Master Bedroom motion inactive but failed to stay that way for: 1:00:00; Waiting for Event
app:7492023-01-18 10:07:06.185 PMinfoWait Event: Motion Sensor - Master Bedroom motion active
app:7492023-01-18 10:00:01.874 PMinfoWaiting to stay 1:00:00 for Wait for Event
app:7492023-01-18 10:00:01.839 PMinfoWait Event: Motion Sensor - Master Bedroom motion inactive
app:7492023-01-18 09:58:17.789 PMinfoWait Event: Motion Sensor - Master Bedroom motion active
app:7492023-01-18 09:58:06.126 PMinfoRequired Expression now false
app:7492023-01-18 09:58:06.123 PMinfoEvent: Bedroom Wall Art switch on
app:7492023-01-18 09:58:05.916 PMinfoAction: Wait for event: Motion Sensor - Master Bedroom motion inactive and stays that way for: 1:00:00
app:7492023-01-18 09:58:05.849 PMinfoAction: On: Bedroom Wall Art
app:7492023-01-18 09:58:05.786 PMinfoEvent: Loft Motion motion active
app:7492023-01-18 09:57:56.803 PMinfoInitialized
app:7492023-01-18 09:57:56.673 PMinfoUpdated: Required Expression now true
app:7492023-01-18 09:57:46.551 PMinfoEvent: Resumed by **This Rule**
app:7492023-01-18 09:39:23.048 PMinfoEvent: Paused by This rule is used to turn off other rules based on how long ago goodnight was activiated
app:7492023-01-18 08:05:19.956 PMinfoRequired Expression now false
app:7492023-01-18 08:05:19.952 PMinfoEvent: Bedroom Wall Art switch on
app:7492023-01-18 08:05:19.737 PMinfoAction: Wait for event: Motion Sensor - Master Bedroom motion inactive and stays that way for: 1:00:00
app:7492023-01-18 08:05:19.690 PMinfoAction: On: Bedroom Wall Art
app:7492023-01-18 08:05:19.605 PMinfoEvent: Loft Motion motion active
app:7492023-01-18 07:56:37.351 PMinfoRequired Expression now true
app:7492023-01-18 07:56:37.346 PMinfoEvent: Bedroom Wall Art switch off
app:7492023-01-18 07:56:36.772 PMinfoAction: Off: Bedroom Wall Art

And screenshot in case that's better

It seems the rule got resumed properly but it does not do anything after. I've tried triggering the rule but it doesn't even generate any log entries after the resume. The stPrimed variable is false. The required expression is the same as before and listed as true individually but the red text persists. In the logs at 2:41pm I manually click the update button which forces rule conditions to be true. This will now work fine until the next morning

Which means it won't be triggered, as the Required Expression is false. Sorry, but mobile device logs are impossible for me to read. Do you have a computer?

You have a lot of moving parts with all of the Pause, Wait, Resume. It's going to be challenging to sort all of this out. My suggestion is to throw this approach away, and start over thinking about simpler logic. You don't need the complexity you have baked into this.

I will take away the pause resume thing and report back. My suspicion is the problem will persist but hopefully not.

Btw do you have any suggestions on how to simplify this? I thought it was a pretty simple way of pausing the rule until next morning so it doesn't trigger at night without the restraints of having some arbitrary time window.

Is the pause/resume functionality broken?

Download the Hubitat app