HSM States vs Mode, with Keypad

I know I can have HSM change state when the mode changes.
But how do people recommend changing the mode when HSM state changes?
The reason I want to drive it that direction, is that I have a keypad (well, 2 actually).
So, if I press "ON" on my keypad, HSM goes to armedAway. I would like the hub mode to switch to Away mode. (Sure, I can create a rule to do that...)
Then, if I "OFF" on my keypad, HSM goes to disarmed. Then, I would like the hub to switch off of Away mode - but to Home or Night? Rule based on time?

Seems like when I have a keypad, and HSM driving that keypad, that the state/mode change is backwards. HSM can respond to mode, but mode can't respond to HSM. And, the keypad can't change mode, only HSM state...

What are others doing if you have a keypad? Any tips? Integration with Mode Manager?

It's what I do. When HSM goes from armed to disarmed then mode manager uses the time settings to pick the mode. The setting is in the mode manager app.

Mode changes can be triggered by a change in HSM state, and keypad entries can change modes, but I believe you’re right that you’ll need rule machine to accomplish that. Mode manager can’t be triggered by HSM state AFAIK (although I think it could trigger from an HSM alert indirectly with virtual switches), but mode manager is only one way to manage modes with Hubitat :slight_smile:.

Do you create a virtual switch? Because mode manager can't be triggered by a change in HSM, at least not that I can find. What mode manager setting are you using?

It's Mode Manager/Set mode based on presence/Use Time settings for return from Away and yes there is the presence switch (which is virtual almost be definition)

Thanks. For other beginners that might be trying to do the same, here is what is working for me:

  1. Setup HSM as desired.
  2. Setup Mode Manager for times to switch day/night.
  3. Create a virtual Presence sensor.
  4. Create a RM rule to trigger on HSM state changed, and if it changes to Away, make virtual Presence sensor departed. If it changes to Disarmed, make virtual Presence sensor arrived.
  5. Go into Mode Manager, and make it base on presence, with Use Time setting for return from Away, and follow the virtual presence sensor.

Is that what you did? Seems like more work than it should be, and it would be good if Mode Manager could just change based on HSM state, since HSM can change based on Mode (which I'm not using), but Mode can't change based on HSM state - which I would like to use, but have done through the setup above.

1 Like

Minor nit - hsm does change the mode - to away. It took me a while to get my mind around that and I still get confused.

EDIT: you are correct HSM doesn't set mode. Mode sets HSM substates.

Many users approach this basic setup differently. Either you go with mode changes controlling the state of HSM or the state of HSM controlling the mode. There are pros and cons to both. Personally I do what you are doing and the state of HSM determines the mode, not the other way around. (I have some modes that have nothing to do with HSM, but for most of my modes that correlate to a specific condition of HSM, it is the change in HSM that changes the mode). For many reasons this works better for me and my family.
I set-up three virtual buttons:

  1. Press for Arm-Away
  2. Press for Arm-Night
  3. Press to Disarm

You can they have anything you want press any of these buttons. For example entering the correct code on my backdoor keypad, results in the pressing of the disarm virtual button, which disarms HSM and changes the mode to the appropriate mode for the current time of day. You could do something similar with presence both for arming and disarming HSM and changing the mode.

When I first started out with hubitat, making the virtual buttons seemed unnecessary, but I soon changed my mind. It was one of the best things I ever did and it made everything simpler after that. I now have these three virtual buttons referenced in both mode manger and HSM (obviously), but I also have these buttons referenced in no less than 7 RM and/or Simple Automation Rules.

1 Like

Thanks for this I was struggling to make this work.

Download the Hubitat app