Local variables do not update when Trigger device is updated?


C7 running 2.5.1.152
Seems my RM rule does not update even after clicking "Update Rule" and "Done". What am I doing wrong?

I switched 2 contact sensors (child devices, connected via Abode integration). Thus I had to update the rules associated with them. I simply updated the trigger in the associated RM rule, from the previous sensor to the current.

Results that are expected:

  • In the RM Rule, Trigger Events section, the current sensor is listed.
  • In the Device section, for the current sensor, In Use By section shows the rule
  • In the Device section, for the previous sensor, In Use By section DOES NOT show the rule

Results that are not expected:

  • When the contact that is no longer part of the rule is opened, the rule fires. It obviously should not do this.
  • In the RM Rule, Local Variables, Device and Text fields shows the previous contact sensor, not the one one in the Trigger Events. The previous contact sensor is no longer part of this rule at all, so why is it shown in the Local Variables and how do I correct it?

Rule Machine cannot use devices (as in references to a specific device) as variables, so I'm assuming you're talking about one of the built-in string variables like %device%. This just shows the display name of the last trigger event event device (or certain other things), regardless of what your current triggers may be. There is a specific FAQ about this in the docs: Rule 5.1 | Hubitat Documentation

But I'm not sure what's causing your actual problem. It sounds like you've hit "Done," but that can't hurt to try again. Doing a reboot with the "rebuild database" option selected might help as well. If nothing else, you could re-create the rule (you can copy/paste actions to make this easier if it's complicated), but I'd consider that a last resort. I'd also enable all logging and see what Logs say, just so you know what the rule really thinks is happening.

OK, thanks for the clarification... I now understand the variables showing in RM are a symptom, rather than the cause, of the problem.

Already tried "Done" a second time. Will do a reboot and rebuild and update later...
Thanks.

After a reboot, my rule is once again working. No clue what caused this anomaly, but at least in this process I learned that the data in Local Variables is a display of the last triggered event...