Rule Machine Not Reading Device Values Properly

I have a rule that fires when the state of a thermostat changes and checks to make sure the corresponding Zooz ZEN15 plug has also changed accordingly (they occasionally become unresponsive - I'm working with Zooz on that). Rule has been working fine. In the course of troubleshooting with Zooz, I deleted and re-paired the plug (substituting a Virtual Switch as a placeholder so I wouldn't have to reprogram everything). That worked fine.

However, the rule I wrote to do the checking is no longer reading the correct device status. I have two of these rules (one for each of 2 thermostat/heater combinations) that used to be one single rule. In the course of troubleshooting, I split it out into two. So I have done the following:

  1. When it was a single rule, I removed all references to the device and added them back.
  2. I removed all references to the device and saved the rule and cloned it, replacing the devices in the clone functionality.

Neither worked.

I can see in the logs that the heater is on right before the IF statement showing that it's off. It doesn't make any sense.

What do I need to do to fix this?

You can see in the screenshot below at the very bottom where the switch reports on but the rule, when it checks, finds it off. If I check the device page itself, it shows on, so it's not a mesh issue. The device is correct but the rule isn't seeing the correct value.

Assuming you've made sure that the device in the rule is the exact same device (e.g., not just one with a similar name; going to the App Status page -- "i" icon -- for your rule and seeing if you can find the device name in the Settings table there, then clicking it to go to its device detail page, is one way you can sort of figure this out), then I might try re-creating the rule. A clone, which I see you've tried, may not on its own, as it carries internal app (rule) data along with it and could just take along your existing problem.

I haven't seen any similar reports, so this is unusual. Is there anything about your device that could be causing oddities, like flipping between "on" and "off" states repeatedly (say, within a few milliseconds) or sending multiple, even if duplicate, events in a row? The "Events" tab on the device detail page or "Logs" would both give clues, though "Events" are all that the Rule would really see.

Not that I can see, no, Looking at the Events page, I see an "on" event (which the thermostat sends every minute) and a corresponding update to the current on the plug and that's all.

I'll give recreating the rule a try and see how it goes.

Even recreating the rule didn't work. It still doesn't reflect the new switch status of on. Makes absolutely no sense.

Have you verified this?

You might also want to try the Settings > Reboot menu item with the database rebuild option (under Advanced) checked to rule out that kind of problem -- assuming everything else looks right, of course.

Yep, I just checked and any references to the device I can click and go to the correct page where it shows the switch is on.

I'm going to update it to the latest firmware (running 2.4.4.155 and I see 2.4.4.156 is out) and see if that reboot helps it and if not, I'll try the database rebuild next.

Appears the update and reboot triggered something. The rule is now functioning correctly. Weirdest thing I've ever seen.