For some reason, randomly this rule fails to trigger because of the predicate condition. As you can see in the screenshot, the defined condition is TRUE but in the rule title, it states it is false (red text "predicate condition is false" is cutoff but that's what it says)
If I check the device page for the dimmer it is checking, I can verify that its state is up to date and correct and the predicate condition should be true.
The log also stops at predicate condition is false check.
Any ideas on why rule machine might be confused about if the dimmer is off or on?
No, unless you might have events happening in quick succession (e.g., the dimmer just turned off right before the rule was supposed to trigger but the event hadn't been committed yet, or your triggering sensor is sending "double events" or something).
What I would do: hit "Done" or "Update Rule" here (just to reinitialize everything--these buttons do the same, except the former also closes the rule). Then see if it happens again. Also keep in mind that this page doesn't dynamically update, so you'll need to reload it in your browser to see whether the rule title says that the predicate is true or false, though it's odd that it doesn't match the evaluation in your screenshot (and from what you described, it never ran), so I doubt that this is the problem.
I think @bertabcd1234 probably has the right idea, these devices, I assume, are in close proximity to each other and the turning on or off of the dimmer and the active state of the sensor could be happening almost simultaneously. That predicate might be better as a condition in the rule.
I'll try some of the suggestions. The primary reason for the predicate condition is to avoid retriggering the rule but it is having unintended consequences.
I am somewhat convinced though that's it's some sort of bug or glitch within rule machine given than it reports both true and false at the same time as seen in the screenshot.
Still having this issue. Thought I'd post the rest of the rule in case there's something in there causing the false negative on the predicate condition
It might be helpful to post a screen shot of the logs when the rule is run.
I don't know how it effects it, but you change the predicate condition inside the rule. I am not sure how that would work. As I understand predicates they are only tested at change, or when you save or update the rule. Not sure how it handles the predicate being changed by the rule while it is running. Still think it would be better to just add a If dimmer is on, exit rule right at the beginning.
Also in your if ELSE statements. You have if sensor is open then else. Inside the else you look to see if the sensor is closed. That is not really necessary as it would only be in the else if the sensor is closed since it was not open.
That is a nitpicking thing as it really shouldn't effect anything just thought I would mention it.
That hurts my brain to even look at that rule. Why are you doing this instead of using Motion Lighting? It is hard to do everything ML can do with a RM rule, even a complex one like what you have there.
I am also having this issue. Semi recently updated to the latest version and created a test rule with predicate conditions. It states false (and has never triggered) on the app screen, but true in the actual rule itself:
Although the actions to run aren't exactly the same, the concept was still the same. I am going to try add the "No School Switch" to the actions on the new rule that I just created that says not installed and test again.
Not saying you are wrong, but it worked with it still saying "not installed", but only on its first slated time. (I had updated it to reflect the no school switch action and updated the times).
It currently (as of 11:56am) says not installed, yet the logs indicate that it triggered successfully at 10:15am.
Oh wait... I see what you are saying. If I click into the rule, then back to the apps section, it displays "not installed"
This must be what I had done after the rule had run... as I was just looking at stuff. I have a habit of doing it (maybe because it never really displayed anything when I did it to rule machine rules prior to 5.0).