You’re a developer. You have smart lights. They turn on when you clap or yell at a cylinder. Congratulations, you’ve automated nothing meaningful.
Real home automation is infrastructure. Let’s build it properly.
The Stack That Works
Home Assistant — The hub. Open source, local-first, integrates with everything. Run it on a Raspberry Pi, a NUC, or a VM.
Zigbee/Z-Wave coordinator — Wireless protocols that don’t depend on WiFi or cloud services. Zigbee2MQTT or ZHA for Zigbee, Z-Wave JS for Z-Wave.
MQTT broker — The message bus. Mosquitto is the standard. Lightweight, fast, reliable.
Node-RED — Visual automation for complex flows. Optional but useful for logic that’s awkward in YAML.
Why Local Matters
Cloud-dependent smart home devices are:
- Unreliable — Internet outage = dark house
- Slow — Round trip to server adds latency
- Ephemeral — Company goes under, devices become bricks
- Privacy nightmares — Your usage data lives on someone else’s server
Local-first means:
- Works offline
- Instant response
- You control the data
- Devices work forever (or until hardware dies)
Automation Patterns
Presence-Based
The most valuable automations react to who’s home.
| |
Presence detection options:
- Phone WiFi/Bluetooth — Home Assistant companion app
- GPS geofencing — Good for “arriving soon” triggers
- Motion sensors — Room-level presence
- mmWave radar — Detects stationary presence (sitting, sleeping)
Layer them. GPS for macro presence, motion for micro.
Time + Context
Simple schedules are table stakes. Context makes them smart.
| |
This only triggers on workdays, when home, when it’s actually dark. Not a dumb timer.
State Machines
Complex automations need state tracking.
| |
Mode changes cascade to multiple systems. One trigger, coordinated response.
Sensor Fusion
Combine sensors for reliability.
| |
Motion sensor OR mmWave radar OR significant power draw = occupied. Much more reliable than any single sensor.
Hardware Worth Buying
Sensors
Motion: Aqara P1 or Hue motion sensors. Fast, reliable, Zigbee.
Door/window: Aqara contact sensors. Cheap, tiny, last years on a battery.
Temperature/humidity: Aqara or Sonoff SNZB-02. Put one in every room.
mmWave presence: Aqara FP2 or DIY with ESP32 + LD2410. Game changer for room presence.
Actuators
Lights: Anything Zigbee. Hue bulbs are expensive but excellent. IKEA Tradfri is budget-friendly.
Switches: Inovelli or Zooz for Z-Wave. Sonoff for Zigbee. Replace dumb switches, keep existing bulbs.
Outlets: Sonoff S31 (flash with Tasmota) or Zigbee smart plugs.
Locks: Z-Wave locks (Schlage, Yale) for local control. Avoid WiFi-only locks.
Infrastructure
Coordinator: SONOFF Zigbee 3.0 USB Dongle Plus (flash with Zigbee2MQTT firmware) or SkyConnect.
Host: Raspberry Pi 4 (dedicated) or any Linux box. Home Assistant OS is easiest.
Network: Separate IoT VLAN if you’re paranoid (you should be).
The VLAN Setup
IoT devices are security liabilities. Isolate them.
Firewall rules:
- IoT devices cannot initiate connections to main network
- IoT devices can respond to Home Assistant
- IoT devices have no internet access (optional but recommended)
Your smart bulb doesn’t need to phone home.
Avoiding Common Mistakes
Don’t Over-Automate
The best automation is invisible. If you have to think about it, it’s wrong.
Bad: “When I triple-tap the light switch, set movie mode” Good: “When the TV turns on after sunset, dim the lights”
Handle Edge Cases
| |
The for clause prevents false triggers. The guest mode check prevents awkward situations.
Build Manual Overrides
Every automation needs an escape hatch.
| |
A physical button or dashboard toggle to disable automations when they’re in the way.
Test Before Deploying
Home Assistant has a “Developer Tools” section. Use it.
| |
Template editor shows exactly what your conditions evaluate to.
Start Here
- This week: Install Home Assistant, add one Zigbee sensor
- This month: Presence-based lighting in one room
- This quarter: Whole-house presence + climate automation
- This year: Full local control, no cloud dependencies
Home automation done right is infrastructure that fades into the background. The house just works. You stop thinking about lights, locks, and thermostats entirely.
That’s the goal.
The best smart home is one where you never open an app. The house knows what you need before you do.