HSM feature request -- direct presence instead of modes for arming/disarming

The HSM currently is able to use modes from the mode manager to automatically arm or disarm. However, I am finding that this use means that use of modes in the Thermostat Manager results in unintended results. For example, presence changes from away to home/night, but the change between night and home modes that happens at 07:30 and 23:00 mean that the HSM is disarming when the switch from night to home happens. This is not what I want. I prefer to disarm the HSM manually in the morning.

If the HSM were able to set arm/disarm directly from presence sensors, this would eliminate the need to set/disarm with modes and would mean that I can use the modes for home automation without worrying that it is disarming the HSM when I want it left armed. I like the automatic arming/disarming, but it is not working the way I need it to right now.

This is easy to customize by using Rule Machine. RM can arm/disarm HSM. So you could make a simple rule triggered by presence sensors to do what you want. For example:

1 Like

Thank you. I thought Rule Machine might be the answer, but Rule Machine confuses me. I appreciate your help.

And so it is. Rule Manager is baffling me. I can create the name and select the trigger event. However, selecting actions to run is giving me a real challenge.

For one, I don't understand the logic.
If (Bruce, Ellen all not present(F) [FALSE]) THEN
Hubitat(R) Safety Monitor: Arm Away

Why False? Why would it not true that all are away? Edit: I figured out that the (F [FALSE]) is the current state. If all were away, it should read (T [TRUE]) but I would not be here to observe it.

Where do you find the ELSE condition? The only things I saw in the pull-down list were AND OR, or XOR. Edit: Found them at last. My German instructor at the Defense Language Institute used to say, "Ein blinder Huhn findet auch einen Korn." (A blind chicken also finds a grain).

The same I guess would apply to the END-IF.
I tried Rule Machine 4 but I also took a look at 3 but that was even more confusing.

I finally managed to locate the conditional statements with the else and end-if. However, my rule looks different. Although I saw the changed as I was going through and creating it, when I finish and view the rule the same as your screenshot, I see it without the closing * on changed so that it looks like *changed instead. Is there a limit on how many characters can be displayed? Do I need to shorten the names of the smart/key fobs? Edit: that didn't fix it. Screenshot below:

@bravenel Thank you very much for pointing me in the right direction. I really need to study Rule Machine more. I'm wondering if Rule Machine would work better than Thermostat Scheduler has been for reliably controlling the thermostat.

You will probably want to delete the first action (HSM Arm-Away). You really wouldn't want HSM to arm, with every presence change, before the conditionals are evaluated.

That's a bug. I noticed it too, and fixed it for next release.

1 Like

When I constructed it in Rule Machine 4, the arm away was the action for true. The conditional isn't showing up in the screen shot. Here is one that shows the conditonals:

I should rephrase that. You can delete the Hubitat Safety Monitor:Arm Away above the IF-Then action. As it's written, when any fob triggers, HSM will first, Arm-Away ,then decide if it should Arm-Away again or Disarm

1 Like

Okay. I see what you are talking about now. I had to look again to see the difference in the two versions. Thank you.

1 Like

I've now had the opportunity to observe how this rule behaves with two departures and returns. It works very well. An added bonus is that the Thermostat Manager which is using Modes is also appears to be working better now that the HSM isn't using modes for arming away or disarming.

Edit: Multiple instances of leaving and returning show that this rule is working very well for arming and disarming the HSM. It also seems to confirm that by not having modes performing the task, the thermostat is behaving much better and making the proper changes. See the topic "Why did I change thermostats?" to see the woes I have been having with the thermostat scheduler and a Zen Zigbee edition thermostat.

Thanks again Bruce for providing the rule and bjcowles for spotting my mistake in setting it up.