
Background In a previous post, I wrote about building a presence sensor to automatically turn my bedroom lights on and off (smart bulbs connected to ...
In a previous post, I wrote about building a presence sensor to automatically turn my bedroom lights on and off (smart bulbs connected to Home Assistant). However, I still had to solve the wall switch problem.
A normal light switch interrupts mains power to the bulb. This is really bad for smart bulbs. They need continuous power to stay connected to the network (WiFi, in my case), which allows them respond to commands. So every time the wall switch is flipped, it cuts power to the bulb, breaking the whole smart home workflow. The fix was to tell people "don't touch the switch!", but that gets old, and you're fighting against muscle memory.
What's more, when the presence sensor doesn't work, it really sucks to hunt for your phone, just to SWITCH ON A LIGHT. In those moments, it truly feels like an Internet of Shit. My first attempt at fixing this was to build a "control center": I mounted a cheap tablet to the wall near the switch, and opened the Home Assistant page in a browser. This didn't work well; the tablet was too slow, ran out of battery often, and had flaky voice controls.
Nothing beats a physical button, truly. I've been itching to get back into building for a while, so I decided to fix this.
I set myself two goals:
I used Gemini and Claude for some brainstorming. One option was to install smart relays behind the existing switch, but I preferred not to mess with the wiring. Ultimately, I landed on this setup:
The key decisions for me were:
After some research, I settled on:
The button communicates to the coordinator via Zigbee, but there are different options for how to connect with Home Assistant.
My chosen coordinator uses the Texas Instruments CC2652P chip, which is supported by both Zigbee2MQTT and ZHA. I decided to go with ZHA, to minimize the number of moving parts.
I shut down Home Assistant and plugged in the coordinator.
After booting, I set up the ZHA integration from the docs page. From there, I clicked "Add a device", and ZHA found the dongle right away, and I followed the prompts for automatic setup.
The button setup was fairly painless. I followed Aqara's instructions to put it into pairing mode. Home Assistant found it almost immediately. ZHA then started the "Interview" (where a Zigbee device is queried for information to work out exactly what kind of device it is and what it can do).
From there, I set up the automations in Home Assistant. The button exposes 4 different actions (short press, double press, long press, and release after long press), along with battery level. I added an automation to toggle the light when the switch is pressed.
I added a second automation, to fix another peeve. The presence sensor is really more of a motion sensor, so when you don't move for a bit, it thinks you're away, and turns off. Or sometimes you don't want the lights to come on when you just roll in bed. This second automation would toggle the presence sensor functionality on double press.
Finally, I set up the wall switch cover. This was really simple: the cover goes directly over the old switch with some adhesive, included in the package. The button also has an adhesive strip on its back, so I used that to mount it on the cover.
All done!
aiA practical, source-backed guide to building a local AI workspace like PewDiePie's Odysseus, including VRAM tiers, realistic budgets, model runtimes, installation steps, and security advice.
ragYour RAG copilot can't count — stop letting it try A user asked our document-search...
aiSystem Enforces Order, AI Accelerates Logic: Driving Next-Generation R&D Through...
aiPart 4 of **The Answerability Problem, and the one that isn't about abstention. Parts 1–3 argued that...
devchallengeWe are excited to announce the winners of our DEV Weekend Challenge: Passion Edition! The prompt was...
aiEighteen months ago, MCP was the thing. Every demo and chatbot connector was running on MCP under the...
Workflows from the Neura Market marketplace related to this Perplexity resource