If you want smart light switches in your house, you can buy from any one of hundreds of manufacturers. [Brian Boyle] had kitted out his home with TP Link devices, but after a few years of use, he found they all suddenly failed within a few months of each other. Decrying the state of things, he set about building his own instead.
[Brian]’s switches use the ESP32 for its handy in-built WiFi hardware. His aim was to produce smart switches that would fit neatly into standard “Decor” style switch boxes. The design uses two PCBs. One is charged with handling the mains power side of things. It carries an SPDT relay for switching AC power, and a DC power supply to run the ESP32 itself. The controller board holds the microcontroller, a Neopixel as a status indicator, and a pair of buttons — one for switching the lights on and off, the other for resetting to default settings. The physical housing is 3D printed, and looks great with the glowing status indicator in the middle of the switch.
[Brian]’s switches are triggerable via MQTT, a web interface, and the physical button onboard the device itself. Having built the devices on his own, he’ll be well-placed to troubleshoot any usability or reliability issues that crop up in the future. That’s a lot more than we can say about most smart devices on the market!
Tried something similar with my DomoSwitch ( https://github.com/NdK73/HomeAutomation/tree/master/domoswitch ) but never got to packaging :(
I’ve been wanting to do this for awhile but couldn’t figure out how to do the AC/DC conversion in such a tight space. I didn’t know about enclosed compact converters like the IRM-02-5. I’m looking forward to seeing what I can do with it!
I commend people designing their own opensource hardware, but why not just use Tasmota (also opensource) for the software?
100% Agreed!
Not only is it tried and tested (Which to me is especially important when dealing w/ mains control and devices that have their fingers in my home security) but it also makes the devices more accessible to others who may want to build or use the project. Of course I am skipping over one of the main reasons why it makes sense to use Tasmota or another open source firmware, which is people don’t have to spend time learning how to use someone’s strange one off firmware and already know what they can do with it.
Very cool project.
I expect the cost of UL, or similar certification to be code compliant in other countries would outweigh the cost of buying commercial products.
Tasmota firmware offers all this in a cloudfree pre done decora package. I just replaced a failing 1980’s dial dimmer with one I bought off of Amazon
Not to be a Debbie Downer, but rolling your own wiring devices is one of those things insurance companies like to invalidate policies on. 3D printing the switch housing is also likely not up to code.
I felt a audden ebbing in the force, as if hundreds of code inspectors and insurance adjusters cried out at once while reading this article.
No, rolling your own mains switches and enclosures without UL certification does not meet NEC.
For the firmware side of things Apple home users should look at Home Accessory Architect
https://github.com/RavenSystem/esp-homekit-devices
As for hardware it comes down to your region and qualifications.
I as a qualified electrician have a lot more freedom to make and install my own than other Australians.
Here 3D printing the switch housing is not a problem provided you use suitable materials.
In a country where practically everything wants to kill you, I imagine there’s a higher tolerance for experimenting on dangerous things.
Actually the latest versions of Tasmota also have Matter support for lights, switches and temperature.
Tasmota is allot easier to set up than HAA but if you want a bit more complex HomeKit setup HAA is needed.
I have a pool controller with lights waterfall and solar heater based on a Kincony KC868-A4 and HAA, I will do a write up when it’s complete.
No matter what switches you use, a critical part is to clean the incoming power. I use the full suite of surge protectors, at the power entrance and every panel. I believe that’s why in more than a decade of use I’ve never experienced a mass-death of smart switches. (The failure rate has always been below 5%, and in many years 0.)
If you don’t mind me asking, what do you use for whole-house surge protection? I’ve seen commercial installations but it was prohibitively expensive. TIA.
The design fits the requirements, but there is from my point of view a missing requirement: minimize power consumption. Nothing done in that direction, starting with the always-powered relay (OK, only 50% of time statistically) is not acceptable nowadays. Plus WiFi, plus LEDs, … just to switch a light!