JAlcocerTech E-books

Chapter 16 — Home Assistant: Sonoff, Zigbee, and Automations That Actually Run

After months of individual IoT experiments — sensors on microcontrollers, MQTT topics accumulating, Node-RED flows growing — the question becomes: how do you make this into a coherent system?

Home Assistant is the answer. Not because it’s perfect, but because it’s the right scope: local-first, extensible, and mature enough that whatever device you want to add, someone has already figured out the integration.

Sonoff and Zigbee

Sonoff makes inexpensive smart home devices (switches, relays, sockets) that originally required the eWeLink cloud. With custom firmware (Tasmota or ESPHome), they operate entirely locally over MQTT.

The more interesting path is Zigbee: a low-power mesh networking protocol designed for smart home devices. Zigbee devices (light bulbs, motion sensors, temperature sensors, door contacts) communicate with a coordinator, which connects to Home Assistant via the ZHA (Zigbee Home Automation) or Zigbee2MQTT integration.

Zigbee advantages over WiFi for smart home devices:

  • Much lower power consumption (battery-powered Zigbee sensors last 1–3 years)
  • Mesh networking (devices relay signals for each other, extending range)
  • Up to 65,000 devices per network
  • No router pairing required for each device

The coordinator setup: a USB Zigbee coordinator (Sonoff Zigbee 3.0 USB Dongle Plus, ~€15) plugged into the Raspberry Pi running Home Assistant. Add a device in HA, press the pairing button, done.

Home Assistant dashboard with MQTT sensor data — the end state of a working Zigbee + MQTT setup

Automations That Are Actually Useful

The most common mistake with home automation is automating things that don’t need to be automated, while leaving genuinely useful automations unbuilt.

Useful automations (from real deployments):

Presence-based climate control: when the last person leaves home (based on phone location), set the thermostat to eco mode. When anyone returns, restore the normal schedule. Estimated saving: 8–12% on heating bills.

High CO2 alert: when the CO2 sensor in the bedroom reads above 1000ppm, send a notification. Above 1500ppm, trigger the ventilation fan. Good CO2 control measurably improves sleep quality.

Water leak detection: a €5 Zigbee water leak sensor under the washing machine and dishwasher. When water is detected, turn off the water inlet valve (via a Zigbee smart valve) and send a high-priority notification. The automation that pays for the entire homelab the first time it triggers.

Plant care reminder: when VPD has been above 1.4 kPa for more than 2 hours, send a notification to check the humidifier. Prevents plant stress without constant monitoring.

Home Assistant dashboard inspiration — what a fully configured HA setup looks like after months of iteration

A second HA dashboard layout — different approach to the same sensor data

The Honest Maintenance Reality

Home Assistant updates approximately monthly. Most updates are smooth. Some break integrations. Budget 30–60 minutes per month for updates and fixing anything that broke.

Keep a local backup (HA has built-in backup functionality). Test the backup restore process once before you need it. Restore from backup is the answer to most “Home Assistant is broken” situations.


Takeaway: Zigbee for battery-powered sensors — they last years and mesh naturally. Build automations around things that actually matter (energy, safety, health) rather than things that are technically impressive.