In the first article, we selected hardware and software for our alarm system. In the second, we learned how to make connections between all of our devices to have sensors send notifications to phones that are on the network, or activate a siren. In this article, we’ll cover accessing the system when you are not home over the internet and having voice announcements.
Remote Access:
Honestly, I have wasted a LOT of my time over the years setting this up in different ways, with VPNs, hosting stuff myself, etc. It’d work for a bit, then after an update something would break and I’d be without remote access for a while (having a fairly useless system) until I devoted a few hours to repairing everything again. I’ve come to a setup I like quite a lot. It barely costs anything and gives me the flexibility that I like while being very easy to set up.
I made an account with Nabu Casa, which is the official Home Assistant Cloud service. It is run by the same folks who created Home Assistant, so it integrates easily, seamlessly, and even has automatic backups of your system (see caveat below) in case it gets hosed up somehow. It isn’t free, but it is super cheap compared to my hourly rate I’d charge for my time. Currently it is only $65 per YEAR! The amount of time I have saved here and the frustrations I’ve avoided with it makes it priceless.
The one caveat with the automatic backups is that the backups are encrypted. So you need to manually download the emergency backup kit from within your instance of homeassistant before you have to use them. Otherwise, if something hoses your system and you need to reinstall HomeassistantOS from scratch, you’ll have lose everything and have to start over. Go ahead and download this backup kit if you’ve been following this tutorial series and store the key somewhere securely so you can use it in case of emergency.
As I said, I’ve messed around with Home Assistant for more than 5 or 6 years, and I’ve never written an article about it because I didn’t want to endorse other people pulling their hair out working with it, but Nabu Casa makes it all worth it!
The way it works is that once you sign up, the Nabu Casa website will generate a custom URL for you. You simply log into your Home Assistant instance, Select “Settings” Then “Home Assistant Cloud” You’ll be able to login and/or paste this URL from Nabu Casa, and you’re done. From that point forward, you will be able to securely control your Home Assistant, and get notifications anywhere you have internet access!
Voice Announcements:
There are about a million ways to get voice announcements in Home Assistant. Years ago I’d send a message to an old cellphone I was using as a front panel that ran LANnouncer. Nowadays, we have Amazon echo devices (echo dots, echo show, old fire tablets, etc.). Home Assistant will let you connect with these, Google Home , or even their own new Voice module (which I may get once it is more mature).
If you paid attention in the last article when connecting your sensors, you would have gone into the sensor’s settings and activate sharing to voice assistants. This is step 1, so if you haven’t done that yet, go back and do so now. Each time you do this, your Alexa will announce they have seen a new device.
Next, open your Alexa app on your phone. If you go into devices you should be able to see the devices and they should have the names you gave them.
The easiest method I’ve found to make simple announcements is to create a routine, add the device you want as the trigger, then make the announcement. Announcements can go to multiple Alexa devices, and “messages” can only go to a single device. Here’s a video showing how:
More Complicated Use Case:
I wanted to have an alert every 5 minutes if a window or door was left opened past 8pm. This would remind me to go close it. The way to set this up wasn’t intuitive to me at first, but I found a great way to do it without having to code Home Assistant’s YAML file directly.
First, I need to create a Helper in Home assistant. You can find this in the Settings–>devices & Services window, select “Helper” tab at either the top or the bottom (depending on what app you use to access home assistant). Create a new helper and search for “toggle” as the type. Name it something (i.e. “Open Window Alert”) and give it an icon.
This creates a new pane on your Overview with a toggle button. You can toggle it on or off manually there, but we are going to control it with an automation instead. Before we do that, go to the settings of this new button and expose it to a voice assistant like we did with other sensors before. This makes it so that Alexa will see this as a device like your other sensors.
Then we will create a new automation. In the trigger, you’ll select “Time & Date” then “Time Pattern” This will allow us to have a repeating time trigger. The syntax is goofy here. To make it do a multiple of minutes, you must put a slash before the number of minutes. For example “/5” for every 5 minutes. Luckily, when you do this, it changes the text of the trigger and gives you a sentence in English to help you debug the timer. eg “Trigger every 5 minutes of every hour” vs “trigger 5 minutes past the hour each hour.”
Next you’ll want to add two AND IF conditions. The first is a fixed time of 8pm, and the second condition is “Kitchen window opened”
For the THEN DO action I want it to notify my phone, as well as to TURN ON the New Window Alert. To do this, select Helper” from the Actions list, then you can try one of 2 methods. You can “Toggle” the input boolean (our switch) or you can select “Turn On” and add a second “Turn Off” action afterward. While testing, I chose the two separate ON and OFF commands. Note that if you Toggle, then the alert will only be voiced half as often as the time you selected above.
Once you select this, you will then need to link this to our specific helper. Click the “Choose Entity” button to select the ” New Window Alert” switch on the front panel we created. This is the input boolean referred to above.
Now this automation will trigger every 5 minutes when it is past 8pm, the window is opened. It should send a notification to your phone and we can make an announcement on Alexa. Go to Alexa, and create a routine using this “New Window Alert” as the Trigger, and make it announce “Kitchen Window opened, Please close the window.”
If you chose to use the Toggle Function above note that you will get notifications every 5 minutes, but announcements every 10 minutes because toggling only flips the switch one direction each time it is toggled.