Need help creating a rule for securing the house

Basically I tell alex "Time for bed" This locks all the doors, shuts off lights, and sets the HSM ARM night. I am not sure if I need a few rules or if there is an app already setup for this.
Would I would like to is if all locks are locked or have been locked and HSM is Armed Night announce house is secure or send a notification

Basically it just verifies doors are closed and locked

Rule machine can use HSM status changes for triggers. Here are the choices…

So you can make a rule with a trigger of “HSM status reports Armed Night”, and in the Actions you would have it send the announcement and/or notification that HSM is armed.

Regarding checking all the doors and locks, you could have RM do that too, but HSM has a feature for that.

On the HSM page where you configure the arming and disarming options, the last item on that page is for Arming Alerts. If you have no arming alerts set up, then HSM will arm even if a door or lock is open. But once you set up an arming failure alert, then HSM will not arm if something is open or unlocked. Instead it will send the announcement that you put in there. As with the intrusion alerts %device% can be put in your announcement text to tell you what lock or door was open.

I do something similar. I created a virtual device as device type "virtual switch" then let Alexa see it. When I say Alexa, time for bed. Alexa turns on the virtual switch (the virtual switch is set to turn back off after 1s). From there I use Rule Machine to run all the automations I want when going to bed. You can do all of what you want in one rule. There is no direct way to make Alexa say what you want (unless you wanted to try getting Alexa TTS working). You can however at the end of your rule have it send you a push notification through the Hubitat app that Armed Night is now active.

This is what I do now I have that same virtual switch as you do and have a rule that actually turns off groups. I can at the end of the rule add a TTS if I have TTS set up but the question is when will that TTS rule fire. I don't want it to fire until the doors are locked and the houses armed? I feel like I need a rule that will continuously loop until all doors are locked and houses armed. Not sure if that's possible to do.

A loop like that isn’t needed. As I mentioned above, rule machine can be set up to trigger a rule when the HSM status goes to “Armed Night”. That rule is where you want your TTS to happen, so you can be sure that HSM is actually armed. But you also need to set up Arming Alerts in HSM. Doing that will make sure that HSM won’t arm unless everything is locked and closed. Then when HSM does arm, it will trigger the rule that has the tts in it and you can be sure that everything is locked and closed (or HSM wouldn’t have armed.) See my previous message for more details.

K I will look at HSM again. But how long will HSM wait till the doors are locked?

There is setting in HSM for how long you want it to wait to before arming it. You enter the number of seconds you want it to delay. It’s under “Configure automatic arm disarm”. But after the delay, it will still arm if something is unlocked unless you set up “alerts for arming failures”, which is at the bottom of that same section. And once you do set up the arming alerts, it will wait until the delay is up, then if something is still open, you will get the alert that you set up.

So I have alarming alerts set up. I tell it to alarm at night. It goes to armed at night. But the door locks are not locked. I have alert notification turned on and received no notifications it should not go armed until the locks are actually locked. This is the part I'm confused on since I have a series of locks it takes time for those locks to lock. This is why I was thinking about doing a loop. Once the locks have locked HSM can then arm. I'm not sure what I'm doing wrong here.

Here is my rule and HSM

K this seems to work. It's not pretty. Let me know what others think.

The two newest rules you show should work fine to check the locks, and will tell you if everything is secure only if the locks are all closed, which is what you wanted to do.

You could make a more elaborate rule that is triggered by something other than the locks(like one of your vswitches) and checks each lock one after the other. That could be setup to let you know which lock is unlocked. It could be in a repeat, or just a one time check. But since that isn’t likely to be a common occurrence, you existing setup is probably just fine. If you don’t get a message that everything is secure you could then use Hubitat’s device page to find out which lock is open. Of course it is more fun to write a rule to do that.

Take a look at the Event Engine should be able to do all of this in one "cog."

And as noted use HSM to provide an arming alert if anything is open/unlocked.

Nice thing about Event Engine is everything is point and click, super simple.

Create a virtual switch (mine is called Nighty-Nite) that ALexa triggers via your good night voice command. Then trigger the Event Engine cog w/that switch turning on and it takes care of all the actions.

Event Engine:

Will it not do the notification until all the doors are locked?

You can choose either AND (all must be locked) or OR (one of more must be locked), whichever you prefer.

All right cog app is not going to help me.
This is what I'm looking to do. I do not want alerts from HSM to tell me that a door is unlocked. I want my rule to lock the door. And continue on once locked.
Once my time for bed switch is turned on
I need a rule to do the following.

  1. It needs to check to see if all locks are locked
  2. If any of them are unlocked then lock them.
    2a it takes time for locks to lock. So it should check every few seconds to make sure the locks are locked or some function that turns true once they are locked.
  3. Once once all locks are locked the rule can move on and arm HSM.

I am not sure how to accomplish the checking. If I'm way off please let me know or if this is above rule machine


I have done it. Still need to tweak timing. 5 secs repeat might be to fast. But this works.