The plan was modest. Two lights, on a schedule, so the hallway is not pitch black when I come down in the morning. I told myself it was a Saturday afternoon job. It was not a Saturday afternoon job. It was the better part of a fortnight, and I am not entirely sorry.
Home Assistant is the kind of software that rewards a small first win and then quietly opens a door into a much larger room. I started with a docker-compose.yml, a container, and the schedule I came for. By the end I had a Zigbee coordinator flashed onto a cheap USB stick, a dozen sensors paired, and automations I never planned to build.
The schedule that started it
The first automation is almost insultingly simple, and that is the trap. It works on the first try, it feels like magic, and you immediately want more.
automation:
- alias: "Hallway light on at dusk"
trigger:
- platform: sun
event: sunset
offset: "-00:30:00"
action:
- service: light.turn_on
target:
entity_id: light.hallway
Half an hour before sunset, lights on. Lovely. But a fixed schedule is dumb, and the moment you know that, you want presence. So I bought a motion sensor. Then another, because one room is never enough.
Zigbee, and the moment it clicked
The cloud-bulb route is easy until your internet wobbles and your lights stop answering to a thing two metres away. So I went local with Zigbee2MQTT, a CC2531 stick, and a private MQTT broker. Pairing the first device took an embarrassing number of attempts and one re-flash of the dongle firmware. The second took thirty seconds. By the fifth I was pairing sensors faster than I could think of places to put them.
The automation that actually earns its keep is the motion-plus-darkness one, with a delay so the light does not snap off while you are stood still reading a parcel label:
- alias: "Hallway motion"
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion
to: "on"
condition:
- condition: numeric_state
entity_id: sensor.hallway_lux
below: 40
action:
- service: light.turn_on
target:
entity_id: light.hallway
- delay: "00:02:00"
- service: light.turn_off
target:
entity_id: light.hallway
That is the one my family actually notices, and the only metric that matters with home automation is whether anyone other than you would miss it if it broke.
What it actually cost
Two weeks of evenings, roughly forty quid of hardware, and a new mental category labelled "things I will tinker with forever." The honest tally is that I spent far more time on this than the convenience can ever repay in pure hours saved. But that was never the point. The point is that the hallway is lit when I want it lit, none of it depends on someone else's cloud staying up, and the whole thing runs on a box under the stairs that answers only to me. For a hobby, that is a very good return.