HSM required expression ignored in Rule Machine 5.1

I am seeing RM5.1 required expressions being ignored when they contain HSM status. In the below rule the disarm and lamp on command are run whenever the second half of the expression (at least one presence device is present) regardless of the status of HSM. Could this be a bug?

Rev C-7 running 2.3.1.142 firmware.

Turn on all Logging for the rule and post a screenshot. Redacting your images isn't going to help find what's happening. Just change the names while you get this sorted.

I set up a rule just like yours and it works as expected. That is to say, with HSM Status Armed Night false (because HSM is not armed for night), and two presence sensors both gone, then one of the arrives -- the rule is not triggered -- as it shouldn't be. When both arrive, same thing.

You really have to turn on Logging for Events, Triggers and Actions to show what is actually happening.

Just to clarify - the required expression requires HSM to be Armed Night and at least 1 presence to be present. Does that align with the test your end? I'll get the logs drawn up and sent over ASAP

P.S. Good idea on changing the names of the devices!! Wish that had occurred to me! :slight_smile:

Ok, troubleshooting is as follows:

  1. HSM Armed Night, Nick present, Pablo departed:

  2. Pablo returns - rule fires and actions take place. Results in HSM being disarmed and the required expression evaluates to false but this is NOT reflected in the logs

  1. Pablo departs - rule fires again. HSM is 'disarmed (was already disarmed) and only now does the required expression evaluate to false in the logs

  1. Rule functions as expected (in that it doesn't fire) until the process is repeated and HSM is armed night

I think there is a logic problem here. This rule won't fire until the second person arrives, not the first. When both are gone, and HSM is armed, the arrival of the first causes the Required Expression to become true -- but it was not true at the time of the event so the rule will not fire then. Upon the next arrival, Required Expression is true to begin with, so it is triggered, and HSM is disarmed then.

However, I did discover a bug related to the trigger of any presence arrives. as this is triggering when the first trigger departs. This bug will be fixed in the 2.3.2 release, now in beta. And, consistent with your findings there is a separate bug related to HSM Status in a Required Expression. This one meant that it failed to detect that the Required Expression became false when HSM was disarmed. This too will be fixed in the next release.

1 Like

Thanks @bravenel.

And the logic you described is as intended - the rule is supposed to fire when the first person is present and the second arrives.

I have paused the rule for now and will retest after the release. Thanks

Download the Hubitat app