Roll Your Own Home Alarm System (Part 2): Connecting Devices

If you’re following the previous article, where I discussed hardware and installing Home Assistant for our alarm system, this article will detail how to lay out a basic alarm system with window and door sensors, fire alarms, a siren, and an announcer (for announcing when doors are opened or if windows or garage doors are left open at night). For the software, we’re using Home Assistant.

In this article we’ll install the sensors, connect it to our phones and setup announcements to be spoken by an Amazon Echo Dot (Alexa) when events happen.

Previously, we installed Home Assistant on a raspberryPi, but there are other ways of using this. you can install it on a virtual machine as well, but just make sure that whatever machine you use is constantly on and connected to the network. I plugged my Rpi, router, and modem into a battery backup that’ll work for a short time in case of a power outage.

Home Assistant Phone App:

I use the phone app to simplify setting up my sensors, so this is one of the first things I recommend doing. I also track my phones location. Once I set up remote access, this basically allows me to automatically activate and deactivate my alarm system.  If I am not home, then it is armed, but once I get within a certain distance of my home, it will disarm. This way, I don’t need to buy a keypad. It is important to note that this will only work when you are on your home network until you set up remote access later.

Z-Wave Integration:

With a clean install of Home Assistant, you will need to set up the Z-Wave integration before we can add sensors. You can do this from the phone app or on a computer in a web browser. If not using the phone app, you can go to  http://homeassistant:8123 and login with the credentials you set up in the last article.

From the main window in the left column, click on “Settings”,   then select “Devices & Services.”

At the bottom right of the screen, you should click the “+ ADD INTEGRATION” button. and search for “Zwave.” The logo looks like this:

Once this is installed, we can move forward installing the different sensors and actuators.

Adding Window and Door Sensors:

For window and door sensors, I recommended the Ring window/door sensors because they use Z-wave protocol and are pretty simple to pair and re-pair with your Home Assistant system. I have other brands such as ecolink and dome as well, but Ring sensors are a bit cheaper and easier to come by nowadays.

For Ring sensors it is very easy. Using your phone, navigate to Settings–> Devices & Integrations” then click on the Z-Wave icon.  On this page, once you start adding sensors you will be able to access really detailed info on all of them. For now, we need to click “Configure” in the “Hubs” panel. Then you will see a blue button on the bottom right of the page that says “+ Add Device”. When you click this, it will ask you to scan the QR code on the bottom of the Ring door sensor. Go ahead and do this, and also remove the plastic tab on the sensor that keeps the batteries disconnected during shipping. The LED on the front should blink green about once a second. If it isn’t , then hold down the button on the front a few seconds and let go and it should start blinking. This is pairing mode for the sensor.  You should see an acknowledgement on Home Assistant when this is done.

If you now go to the Overview page, you should see your new Ring sensor. I like to give this a better name and change its icon to make it easier for me to remember what this particular sensor is supposed to do.  The benefit of using my phone for pairing is that I can be next to the door or window this sensor will be installed on as I do it. I only pair one sensor at a time as well so I don’t mix them up.

On the Overview page, click on the word “Intrusion” under this new sensor’s panel. It will take you to another screen that will show you the history of all the changes of this sensor. This is a nice page to look at to see if I want to see when the door was last opened or closed or how long it has been in those states.   To change the name and icon, click the gear icon at the top right.  Add a name such as “Door to Basement” and change the icon to a closed door.

Allowing Voice Assistant Access:

Next if you plan to have a voice assistant to announce the state of this sensor at any time, you can turn this on by clicking “Voice Assistants” and turning on the one of your choice. There are a couple other steps involved with this, but if you don’t allow the sensor to be visible here, then you can’t do any of the neat tricks like: “Alexa, Is the back door opened?” or have your voice assistant announce when sensors change or remind you to shut the windows at night.

Repeat those steps for your other sensors. fire alarms and sirens have their own pairing process so be sure to read the manual that came with yours, or you can always find all the details of your devices on the Z-wave alliance website.

Automations:

Just having sensors and sirens, etc. show up in Home Assistant doesn’t make them an alarm system. You need to figure out the rules for when you want different things to happen, then create Automations for them. Basically something like “If the front door opens, send a notification to my phone stating “Front door opened”.  Or if you left the garage bay door opened, and it is 9pm, you probably want a notification on your phone reminding you to close it. Of course, if you aren’t home, and ANY door or window opens, you want to turn on the siren and get a text, etc.

I prefer doing these on a computer rather than the phone app, but you can do it on either. For this, go into Settings–>Automations & Scenes In Home Assistant. Then click the big blue “+ CREATE AUTOMATION” button at the bottom right of that screen. Create a new automation here.  You’ll notice 3 key areas. You can add a Trigger, Condition, and an Action. The Trigger is what you are sensing, the Condition is another thing that must be met when for the action to happen, and the Action of course is what you want to happen when the automation is triggered.

Here, I’ve clicked “Add Trigger–>Device”  Then in the dropdown in the new pane, I selected “Front Door” Next the “Trigger” dropdown will give me all possible things I can check from that sensor. In my example, I selected “Front Door Opened”. The default for a Ring door sensor is “Intrusion.” If you didn’t change this as I mentioned above, then you’ll be looking for the words “Front Door Unsafe” instead.

I don’t have an AND condition for this automation, so I left it blank.

The Action I have selected is to text my phone. So to add this, click “Add Action  and select “Notifications.”  If you already installed the Home Assistant app on your phone, then it will appear here as one of the options i.e. “Send Notification via mobile_app_pixel6”  or whatever your phone is.

In the message I simply write “front Door Opened”

I have this also send a notification to my wife’s phone as well, so you can repeat the last step and select the other phone(s) you want to be notified.

The same goes for all the sensors, including leak sensors, fire alarms, CO sensors, etc.  Everything gets its own automation. Instead of starting over each time, I simply duplicate this one automation, change its name, then change the trigger sensor and edit the messages sent.  It doesn’t save a lot of time, but it is a bit better then having to search through menus.

I have some modification that I have done here as well, such as if I leave a window or garage bay door opened after 8pm, then I have the automation send me a message every 5 minutes until  I close it.  I’ll explain this later as it is a bit more complex.

Whatever automation logic you want, I recommend you write it down as a sentence, then break the logic out. For instance: If it is after 8pm AND IF the bedroom window if left opened, THEN DO send a notification to my phone.

An important automation it the logic of the siren. This can be complicated, but you can either break it into multiple individual automations. For instance: If the Front Door Opens, or Side Door is opened, or Garage door is opened, OR (whatever else), AND IF my phone is not at home THEN DO Siren Activates, and notify my phone.

Instead, you can get more detail by separating these as we have before, and just add the phones location as an AND IF, then you will know which door was opened when you weren’t home.

Conclusion:

You can slap together a pretty useful set of rules here and as long as you are at home, your phone can get notifications.  But what if you aren’t home?  The next article will go over the easiest way to set up remote monitoring of your Home Assistant system, as well as adding in announcements by a device such as an Alexa.

 

 

 

Leave a Comment

Protected by CleanTalk Anti-Spam