Scott Tompkins

Home Assistant

Home automation that runs on my own network. Zigbee devices and sensor boards I solder myself report to a virtual machine in the house, and the lights work when the internet does not.

When the internet is down, my lights still work. Most commercial smart home products require a cloud connection: the switch talks to a server somewhere, and the server talks back to a phone. I wanted control that stays inside the house, so since 2018 I have run Home Assistant, open-source software that runs home automation from a machine on my own network. This page follows one reading through it, from a temperature probe in the freezer to the software that acts on it.

The probe in the freezer

No commercial product covered some of the things I wanted to measure, or the ones that did needed a cloud account, had short battery life or did not quite fit. So I build those sensors. Each is a hand-soldered board around an ESP8266 or ESP32, which are small microcontrollers. The firmware comes from ESPHome, a project that builds firmware for these boards from a short configuration file. I have used it since 2019.

There are temperature probes in the freezer, the garage and outdoor enclosures, relay boards that switch equipment, humidity and air quality sensors, and boards that connect older equipment that was never smart. Building a battery-powered sensor that lasts months on a charge made me think about power consumption in a way server-side work never asked of me.

Into a virtual machine

The reading goes to Home Assistant, which runs as its own virtual machine on Proxmox. No cloud service is needed for it to arrive.

The other road in: Zigbee

Off-the-shelf sensors, switches and lights arrive a different way. They use Zigbee, a low-power radio protocol in which devices relay each other’s signals to form a mesh. The mesh suits battery sensors because it uses less power than Wi-Fi, and it keeps dozens of devices off my Wi-Fi network.

A Zigbee network needs a coordinator, and mine is a USB device that needs direct USB access. Running Home Assistant in a container, or without passing the device through, complicates that. As a virtual machine it is simple: Proxmox passes the USB device straight through, and Home Assistant sees the coordinator as if it were plugged into it. Most Zigbee devices ship with a vendor’s hub that requires a cloud account. A generic coordinator, used through Zigbee2MQTT or ZHA, lets Home Assistant control the devices directly, and I am not tied to one vendor.

What stays outside

I have seen how carelessly some device firmware handles network communication. Because control is local, I can firewall these devices from the internet, and I recommend that to anyone.

Deciding what to do

Getting a reading in is the easier half. The harder half is making the house behave the way I want. “Turn the light on when the sensor trips” sounds complete until I ask what should happen if the light is already on, or if someone has overridden it by hand. Automations that seem obvious often have cases like those.

The enclosures and mounts for these boards come off my 3D printer. An ESP32 is also the board inside the pantry ticket printer.