Hoping to get a little help. I am trying to setup a notification that updates me on the status of my house when the alarm is set in either the armed home or armed away mode. I would like to receive a text that provides the following:
Front Door: (Front Door Status) locked or unlocked
Back Door: (Back Door Status) locked or unlocked
I am guessing once I get the idea, I can just use the boiler plate with any sensor I want notification on.
Also, Things take a little bit of time to work after the security system is armed so a “delay” of like a minute before it checks the status and sends the notification would be cool.
I tried and got no where. Been googling for a couple hours.
The automation docs are here - you should take a read through so you understand how it all works.
Yours will look something like (replacing all the entities with your actual ones):
automation:
- alias: 'Rule 1 Light on in the evening'
trigger:
- platform: state
entity_id: lock.YOUR_LOCK_FRONT
- platform: state
entity_id: lock.YOUR_LOCK_BACK
condition:
- condition: state
entity_id: group.YOUR_DEVICES
state: 'not_home'
action:
- service: notify.YOUR_NOTIFIER
data_template:
message: "Hey, the {{ trigger.entity_id }} is {{ trigger.to_state }}"
I’m using templating so that you can do it all with a single automation.
You’ll need to set up a group that has the devices you want to track, and obviously a device tracker to track them (possibly multiple trackers). You’ll also need to set up a notifier.
Multiple device trackers
I talk about it more here, but modern mobiles will put WiFi to sleep when they’re idle. To avoid false aways you need to mix in WiFi based and Bluetooth based, and optionally GPS based (but that tends to be inaccurate when indoors). You can also follow this guide to smooth some of that out.
Since switching to a combined view across multiple trackers I’ve had no false away events.
I think I read your requirements slightly differently to @Tinkerer so I’ll add my take on it and hopefully somewhere between his answer and mine is what you want…
automation:
alias: Check door status when alarm set
initial_state: on
trigger: #Trigger when alarm is armed home/away
- platform: state
entity_id: alarm. YOUR_ALARM
to: 'armed_home'
- platform: state
entity_id: alarm. YOUR_ALARM
to: 'armed_home'
action: #Send message with status of front and back door
service: notify.YOUR_NOTIFICATION_SERVICE
data_template:
message: "The alarm has just been set to {{ trigger.to_state }}.
The front door is {{ states('lock.YOUR_FRONT_LOCK') }}.
The back door is {{ state('lock.YOUR_BACK_LOCK') }}."
Personally I’d template that more so that the message would read more like: “Alarm is set and all is secure” or “Warning! The alarm is set but the back door is unlocked”, but the general gist is there.
Just play around with the spacings in the message block, or physically build the message with a template and get it to spit out the result in the format you want