Alexa Guard Automation and Home Assistant

I have enabled guard in my Alexa since it was released. Guard detects broken glass and gas alarms. However I have not used it very much since it is to much work to enable it by using the standard phrase:

Alexa, I’m leaving and Alexa, I’m home.

This just does not work as the kids forget or if I arm someone else forgets to disarm. You would have to make this automated somehow. I am using Home Assistant and have a presence flow in Node Red. The idéa with this flow is just to set a bolean switch to alarm on/off depending if someone is home or not. It checks phones and the door. It also sends a pushbullet notification when changed.

When this switch is set to on I can do whatever I want to in this second flow. In this case I am sending notifications if motion is detected. I also use TTS on my Alexa to scare the burglars. Not sure they will be very scared though.

TTS is done with the excellent Alexa Media Player. I have been writing about this before here but some things has changed in the last 1.30 version so make sure to read the full documentation about this.

The main thing that has changed is the service as you can see below.

The data filed is:

{“message”:”Motion detected in playroom. Burglar alert.”,”data”:{“type”:”tts”},”target”:[“media_player.echo_plus”]}

So far so good. The TTS will work. But I also have another flow with things to do if the bolean switch alarm is on. It is things like locking the door and turn of all lights. Maybe I have left the house and forgot to do this. In this flow I have also the guard node below.

This is controlled by using the same component. In the 1.30 version guard works. If you have enabled guard an entity similar like below will be created. Just call this and add it to your flow.

When Guard detects something you will get a push notification to the Alexa app. This is fine but maybe you want to trigger something else. This can be done by using the Away lightning like in the image below. You will have to create a dummy light in HA. This light can be called guard.light. Publish it to Node Red and Alexa. When this light is on you can trigger an alarm siren, a pushbullet notification or anything you want.

 

Conclusion: The guard mode is great but has to be enabled by voice. When using with home assistant this takes it one step further.