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.

 

 

 

Roll Your Own Home Alarm System (Part 1): Hardware and Software

There are a lot of home alarm systems on the market, and most require you to purchase a bundled package from a provider that includes hardware, professional installation, and a monthly subscription. While these solutions work for many, I wanted something more customizable. I also didn’t want a company constantly tracking my cameras and sensors, if they want my data, they can pay me for it. I’m not about to pay them to take it.

I’ve been using Home Assistant on and off for years, and it has really matured. I recently put together a simple DIY alarm system that mimics many of the features of a traditional setup. Here’s what I wanted:

  • Window and Door sensors
  • Phone app control (as a front panel)
  • Smoke/Fire/CO monitoring
  • A loud siren
  • Voice announcements when doors open and alerts if they’re left open

At the heart of my system is a Raspberry Pi 5 from Canakit. This kit is great because it includes everything you need to start: power supply, case, SD card, card reader, cables, and a fan. For this project, there’s no need for a monitor, mouse, or keyboard. You’ll access it over your home network.

Next, I added a UPS battery backup to keep the Pi, router, and modem running in a power outage. Only one side of the unit is backed up so be sure to plug essential devices into that side. The other side functions as a surge protector for non-critical gear like your TV or game console.

Wireless Protocols

For wireless sensors, I prefer Z-Wave over Zigbee. Z-Wave is generally more secure, though it’s slightly pricier and offers fewer product options. Zigbee is widely used and supports more device types (like bulbs and outlets), but in my opinion, it’s too easy to hack for use in a security system. You can use both in Home Assistant if you want the best of both worlds.

Z-Wave is more secure partly because it’s governed by the Z-Wave Alliance. Devices must be certified to use the protocol. Z-Wave frequencies vary by region, so check the Alliance’s site to find compatible devices and manuals for pairing or resetting.

Door and Window Sensors

You’ll need a Z-Wave USB dongle to connect the Pi to your sensors.

For sensors, I recommend Ring’s Z-Wave contact sensors. They’re affordable and easy to install. If your doors or frames aren’t aligned, these risers help position the magnets properly. You can also 3D print your own and use extra adhesive strips. For garage doors, I use these handy brackets.

Smoke and CO Monitoring

If your home has wired smoke detectors, you can retrofit them with this Z-Wave sensor. It listens for alarms and sends a signal to Home Assistant. If you’re buying new detectors, Ring’s listener is a solid option. Note that it doesn’t detect CO directly. Instead, it listens for the sound of a CO alarm and then alerts your system.

Siren

The siren I use is discontinued, but this Aeotec model is a good replacement. These sirens often support multiple chimes and alarms, so you can assign different sounds to different events, like a door chime or an intrusion alert. You’ll configure these behaviors through Home Assistant automations.

Announcements

I currently use an Echo Dot for spoken notifications when doors open or to remind me if they’re left open at night. You can also use Google Home or other smart speakers.

Other Devices

Depending on your needs, you can add leak sensors near washers, sinks, or sump pumps. Zooz even makes an actuator that can shut off your water supply in an emergency.

Brands I’ve used successfully include Zooz, Aeotec, Dome, and Ecolink which are all great for Z-Wave sensors and actuators.

Home Assistant Setup

Home Assistant is the software platform powering all of this. You can do everything from integrating smart bulbs to automating your HVAC. For this build, we’ll stick to the basics, sensor monitoring and phone access.

The simplest and most stable install is flashing Home Assistant as the Raspberry Pi’s operating system. Their official install guide walks you through it. You won’t need a monitor or keyboard, just plug the Pi into your router with Ethernet and power it up.

After a few minutes, go to http://homeassistant:8123/ in your browser to finish setup by creating your username and password. In the next post, we’ll walk through adding sensors and automations. Then we’ll learn how to access the system remotely and have voice announcements for when events happen.

Recreating a Chrome Extension for Pinboard.in Using AI Assistants

Recently, one of my most essential Chrome extensions was automatically disabled after an update. Google Chrome has migrated to Manifest V3 for extensions, causing older, unmaintained extensions to stop working. While I’ve dabbled with extension development in the past, I wasn’t familiar with the new manifest format. This presented a perfect opportunity to test the capabilities of AI assistants like ChatGPT and Claude.

The Problem

The extension in question was simple but critical to my workflow: it allowed me to right-click and post the current page or selection directly to Pinboard.in, my bookmarking service of choice. Pinboard offers a straightforward API for adding links – you simply use the pinboard.in/add URL and pass parameters for the title, link, and description. The service then displays a page where you can adjust these values or add tags before saving.

My initial approach was to ask ChatGPT to convert the old extension to the newer manifest format. This failed completely. Since I couldn’t verify the license of the original extension (the creator’s personal website is offline – I hope they’re okay!), I decided to build a new extension from scratch.

Building a new Plugin from Scratch with AI

I started by explaining my goal to ChatGPT and requesting a Manifest V3 template. This generated the foundational file I used moving forward. I think templating is a really good use case for AI assistants to make. But from there, things went a little awry.

For example, a seemingly simple request like:

"When I right click and select my 'post to pinboard' entry, I want a popup to appear with the pinboard.in/add page"

led to several iterations because my language wasn’t as precise as it should have been. First, ChatGPT created a Chrome popup using chrome.action.openPopup() which is technically correct based on my prompt, but not what I needed.  Once I closed the Chrome popup, then a blank pinboard.in/add page opened in the browser window.  The Title and Link info I entered into the popup did not pass to the pinboard window either. Obviously I was going to have to assume less of the AI when writing my prompts.

After clarification, the new code opened the pinboard.in/add page in a new tab which was closer, but still not ideal. I gave it one more try, clarifying I wanted a new window. Finally, it created a separate popup window, but it wouldn’t automatically close after submission

This inability to autoclose the window was tricky for ChatGPT. Once the user clicks the “Add Bookmark” button, the popup window just went completely white, but would not close, regardless of the command I tried in the listener callback function.  This was frustrating because every time I asked for new code, ChatGPT would reply as if it had made some change, but you produce identical code. The responses were something like

You’re right, I added a window.close() call in the function to make the window close when the “Add Bookmark” button is clicked.

After multiple attempts with ChatGPT producing identical code despite my clarifications, I switched to Claude to see if it could help solve the popup closing issue. I pasted in my code and asked it for help closing the pop up window. Initially, Claude produced similar results, but after some persistence, it understood what I was trying to accomplish.  In it’s final response, it mentioned making the popup window a “true popup” which is the solution I was looking for from the beginning.

With the “post page to Pinboard” feature working properly, I then extended the extension to work with selected text. When text is highlighted on a page, the extension now adds it as the description parameter in the Pinboard form – creating a more versatile bookmarking tool. The last step was making custom icons in inkscape and post it on github.

Installing and Using the Final Product

  1. Click here to see the complete, working extension is available on GitHub.
  2. To test this plugin, simply download the code as a zip file to you PC.
  3. Unzip this folder my right-clicking it and selecting “Extract All” if in windows.
  4. Then open chrome://extensions/
  5. In the top right corner, click to activate “Developer mode”
  6. This will show 3 additional button on the top right of the window. Click “Load Unpacked” and select the folder
  7. Then on any webpage, right-click and select “Post page to Pinboard” (Obviously you should have a pinboard.in account for this to work)

This project shows both the potential and limitations of using AI assistants for development tasks. While they excel at generating boilerplate code and understanding common patterns, precise implementation details sometimes require persistence and clear communication. You can spend longer debugging what they give you rather than just writing the code yourself, even if you aren’t familiar with all the details of the language.  By asking the AI tools for a description of how to do atomic tasks, or how a particular function might work if you are unfamiliar, you’ll get farther than just expecting it to produce good ode on its own.

Fix Your Fire TV Showing a Blank Screen After the Logo

If you’ve recently encountered an issue where your Fire TV loads the logo but gets stuck on a blank screen, you’re not alone. I experienced this frustrating problem myself. The app buttons for Netflix, Hulu, and Disney worked fine, but I couldn’t get the home screen to load or access Prime Video properly. Every time I tried using Prime, I got an error message: “Error: 1061.”  I tried a lot of recommendations from users on Amazon’s forums such as unplugging the firestick from both the HDMI and power for 15 minutes, then trying again. I also tried their suggestion of changing the HDMI port, but nothing they suggested worked.

After some poking around, I eventually found a quick and effective fix:

  1. Open the Prime Video app on your Fire TV.
  2. Navigate to the Account section within Prime.
  3. Select Sign in with a different Amazon account to log out of your current account.
  4. Log back in using your Amazon credentials.

That’s it! After logging back in, everything worked perfectly again—the home screen loaded, and Prime Video was back to normal.

If you’re facing a similar issue, give this method a try before diving into more complicated fixes. It worked like a charm for me!

Design Nerding – Product Dissection of a Kid’s Meal toy

A while back, the CG version of the Lion King came out in theaters. As advertisement for the release Kid’s meals at McDonalds came with themed toys. One was a talking toy. I’ve long been fascinated by toys like this and took apart tons of them as a kid. They are great case studies for DFM (Design for Manufacture).  I wanted to see how they are making them nowadays.

As typical for McDonald’s, you need the tri-bit (or similar sized flat-head and some patience) to take this toy apart.

Once apart, I was amazed at how simple it was.  In the past, I recall a small PCB with a potted silicon die on the board (black blob tech). I was surprised to find that now they no longer have a PCB at all. Now they just have a 4-terminal IC in a custom package. The pins are Vcc, Gnd, and the 2 speaker outputs. Very minimal costs here.

One of the best parts of these kinds of cheap toys are the switches. It is much cheaper to make the switch yourself versus buy a pre-made switch. This one is an elegant design for sure. Th Gnd side of the chip attaches to a cheap stamped metal spring that is bent along two different axes. The long arm of the metal spring fits into a slot on the switch. The switch itself is molded such that it has a compliant spring that helps it “click” into one of two positions moulded on the base of the toy. (Second pic below makes this more obvious, look at the bump on the right side of the switch and the two indexed locations on the right side of the hole in the plastic base).

   

 

Overall the design is about as cheap as you can get for a talking toy while still being well-engineered and not feeling “cheap”. McDonalds typically has some really great engineering in the toys (if you’d believe it) when compared to some other fast food places. For example, the reinforcements in the base of this toy gives an experience that you wouldn’t know the switch was just an extra cobbled together bit of plastic.  The toys are always solid-feeling (not flimsy when you apply force when actuating the switch for instance) and I find it rare to see sunken areas on the outside of the piece opposite of the reinforcement ribs in the plastic. McDonalds only works with a few suppliers for their toys and rigorously check them for safety (after being sued in the 80s for toys being choking hazards, hence the “for ages 3+” warnings on all toys nowadays). Check out this article on one of the companies and see the journey of a toy from concept to reality.

McDonald’s has decided to stop making plastic toys by 2025 globally. I’m sure there are billions of these types of toy in consignment stores, garages, landfills, and buried in back yards across the world if you want to get ahold of some to take apart.

Keep your eyes peeled for great design!

Protected by CleanTalk Anti-Spam