Home Automation

Posted on 2023-11-21 in misc • 4 min read

Introduction

For many years, I have had some form of home automation in my home. I used to have a few x10 devices that I used on my aquarium to control lights. We eventually purchased a security system that had z-wave support, and then we had a few devices connected to that. It allowed some basic automation, and you could have a little more complicated things like "disable the alarm system if the door-lock was unlocked with a PIN". Overall though, the functionality was pretty basic, and I really wanted something more, but never got enough interest in it to actually do something about it.

I had decided that I was tired of being limited by what the security company and their app would allow me to do with the system, and at some point in the past, I had stumbled on Home Assistant. I knew I needed some way to interface with my computer. There are quite a few options here, but I chose the Aeotec z-stick <https://www.amazon.com/Controller-SmartStart-Raspberry-Compatible-Assistant/dp/B094NW5B68?ref_=ast_sto_dp>. That started me down the rabbit hole of "real" home automation.

There was a light in my daughter's room that had an old z-wave lamp module that for whatever reason wasn't paired with the security system. So since I now had all the parts, that was the first step to kick off my home automation insanity.

My Home Automation Guidelines

Everyone has their own approach for what works for them. These are the general rules I follow with my approach to home automation:

Automation

The first rule of home automation is that things should be automatic. Walking into a room and having to control the light with my voice or my phone is not home automation. That is just wall switches with extra (slow) steps. Wherever possible, things should "know" what is supposed to happen and just work. Along with that though, any automation should be able to be turned off. Sometimes an automation doesn't work when there are unexpected inputs (like having guests over).

Wall Switches should work

Even though things should automate, When you come into a room that is dark, it is natural to reach to the side of the door you just walked through to find a switch to turn on the light. And likewise, to turn it off when you leave.

There are many smart bulb options that are as easy as unscrewing a stupid bulb, and screwing in a smart bulb. In my opinion, there are problems with this. First, the switch always has to be "on", and thus you lose the wall switch functionality. These may also require some sort of third party app or service to work. Also, specifically to smart bulbs; bulbs die. I would rather buy a $40 smart switch once and a $2 bulb each time it dies instead of a $20 bulb every time one dies.

So in my setup, I will use a smart switch, or a smart outlet and will not use smart bulbs. I also configure the automations so if you manually turn on a switch, it will disable any actions that would turn it off automatically after a period of time. Which means: "the wall switch will work like a wall switch is expected to work"

Local First

I do not want to be dependant on some third party's cloud service (which is probably gated with a subscription). You don't have to look too far in the home automation history books to see examples of companies that either died, and left devices broken; or ones that cut off API access, or kind of bait and switch with a free offering that they then pay for. For these kinds of reasons, I don't want to trust anyone else for this. Plus, even though the packets are small enough and speed isn't really an option, it doesn't make a whole lot of sense for a sensor to trigger an event that goes out to the cloud to figure out what to do and then come back in to my house to actually turn on a light or something. It just doesn't make sense.

This also means that I am not using any third party smart speaker like Google or Amazon

Why Home Assistant?

I stumbled on Home Assistant, and thought it looked like it would solve everything I needed. It is written in python, and uses yaml for most of the configuration. These are things that I am very familiar with, so it was easy to get started with. I decided to use the docker version, and so far that has been easy enough to integrate other things with it, so I'll probably just stick with that version.

Some of my Home automations

Here are just a few examples of some of the things I have automated

  1. Lots of lights are automated to come on when it is dark and someone enters a room
  2. Outside lights on at sunset, off at sunrise
  3. Closet light turns on when the door is opened
  4. Garage door opens when someone arrives, and closes when they leave
  5. Turn on the bathroom light when someone enters, start a timer that will turn it off after 5 minutes, unless the door is closed.
  6. Also, don't automatically turn on the bathroom light if there is motion detected from someone leaving the bedroom (don't want to blind someone who was asleep in a dark room, and then had to go to the bathroom)
  7. Set a timer to remind me to take out the dogs, reset the timer when the dogs are detected outside