There are it seems no wireless-enabled light switches available in the standard form factor of a UK light switch. At least, that was the experience of [loldavid6], when he decided he needed one. Also, none of the switches he could find were open-source, or easy to integrate with. So he set out to design his own, and the Theia IoT light switch is the result.
In adapting a standard light switch, he was anxious that his device would not depend on the position of the switch for its operation. Therefore he had to ensure that the switch became merely an input to whichever board he designed, rather than controlling the mains power. He settled upon the ESP8266 wireless-enabled microcontroller as the brains of the unit, with a relay doing the mains switching. He first considered using an LNK304 off-line switching PSU chip to derive his low voltages, but later moved to an off-the-shelf switch-mode board.
So far two prototype designs have been completed, one for each power supply option. Boards have been ordered, and he’s now in the interminable waiting period for international postage. All the KiCad and other files are available for download o the project’s hackaday.io page, so you can have a look for yourselves if you are so inclined.
You might ask why another IoT light switch might be needed. But even though they are now available and inexpensive, there is still a gap for a board that is open, and more importantly does not rely on someone else’s cloud backend. Plus, of course, this board can be used for more than lighting.
Light bulb image: Осадчая Екатерина (Own work) [CC BY-SA 4.0], via Wikimedia Commons.
How does he power this one? Do they have 3 wires in an UK light switch?
depends on the house, old houses all the wiring runs back to a big old junction box under the floor. Now all connections have to be ‘accesible’. if its looped in at the fitting then no, but if its looped in at the switch he will have a neutral at that switch, but not necessarily at any other multi way switches.
Sadly in my country 99% of the time we have only 2 wires for a regular 1 button light switch. Mostly those two wires are actually the phase/live split in two. So if i would try to install a smart switch here it would kill its own power supply when it would turn the lamp off and when i turn it on the power supply would be in series with the lightbulb which causes all kinds of weird flickers, loss of brightness and other stuff in the lightbulbs.
Lutron (and perhaps others) had a nice trick with incandescents of completing a high resistance circuit at all times with the bulb to complete a circuit and thus be able to sap power from the mains to power their digital and wireless lighting switches.
Unfortunately fluorescent bulb replacements and LED’s don’t work so well with that trick.
So for those who don’t have neutral in the switch box it’s a royal PITA adding it, or breaking regs (meh) to insert other power methods to said DIY light switches.
Or digging up floorboards and terminating at those big old junction boxes. Easier upstairs. Loft.
Or adding a LI battery, the requisite parasitic charger for when the light is on and enough capacity to see you through the light being off. And maybe giving the ESP the ability to turn the light on to charge itself when the battery is running low. :)
For very low power drains (e.g. lighted switches) the usual trick is to let a very small current flow through the switched load even in the ‘off’ state. This works very well for incandescent bulbs, but a CFL I have on a lighted switch gives an almost-imperceptible flash every handful of seconds (noticeable only if the room is very dark and you stare at the bulb). An ESP at full tilt draws much more than a typical LED/neon though, so it may not work as well with non-dumb loads.
As a hobbyist you could probably send the maintenance current through the earthing pin; this might get you the stinkeye from Real Electricians and city inspectors though.
There are reasons why many of the commercial available sets for smart plugs/ light switches have a main unit with WIFI and slave units with 433MHz.
The most interesting facts about such plugs/switches are power consumption and latency. If you put the ESP8266 in sleep mode, latency is high. If you don’t, power consumption is. So, in the first place, far more interesting than the design files are estimates and measurements of the power consumption (including LDO, relay; everything). That is the challenge but there is probably a reason why those are never mentioned in these articles. Hopefully, the next author, whose turn is it to write an article about smart plugs, reads this. You can always leave the LED lights on.
Both Energenie and LightwaveRF Have light switches and dimmers suitable for UK pattress boxes.
“You might ask why another IoT light switch might be needed.”
Nope. I don’t think they’re needed at all. Have we become so lazy as a society that we can’t even be bothered to turn lights on or off anymore?
“Have we become so lazy as a society that we can’t even be bothered to turn lights on or off anymore?”
Yes.
I just shout out a command and one of the kids turns things on and off for me, the problem is when they do it without my input, and forget to turn things off again.
i doubt anyone installs these to use them because they are lazy, rather, they install them and then only use them to justify the installation. I don’t believe anyone can say with a straight face that connecting a lighbulb in your house to the internet has benefited them
But what if you need to flash them in morse code to say “Lassie, Timmy texted me from the bottom of a well, he’s stuck” from the opposite side of the planet huh?
Because I always leave my lights on when I leave home
I’ve been looking into this problem space for a while and realised that the failure of the control unit needs to be more elegant, possibly using a second relay that when not energised causes the circuit to default using the conventional switch and has the circuit under remote control only once the controller bypasses the main switch. The other issue is the usual certification/insurance issues this sort of electrical work involves.
Also if you are going to go to all that trouble it makes sense to also have a smart cap sense switching option where you can wave your hand near the unit to control the light, and while you are doing that add all the other obvious extras like an information display for time/weather etc. As much functionality as the ESP has computing power for. If you have a hand wave trigger an audio signal for your information feed you don’t even need a visual display and can keep the entire set-up looking like a “normal” switch.
You might consider converting a one way lighting circuit to two way if that type of wiring is supported in your country.
I am working on something similar. Fortunately my house has both live and neutral in the boxes. I have built a separate PCB for the high voltage components. It incorporates an isolated 3.3v power module. I am using a D1 mini on a separate isolated board for the ESP8266. The regular switch is now an isolation switch (should be always on) and there is a push button with a LED to turn the light (or other device) on and off locally. The button just controls a GPIO line. Power consumption is not an issue as the wifi is mainly listening and not transmitting and is not battery powered. I am using MQTT and TCP/IP but may change to CoAP over UDP for lower latency. When I have worked out the details, I will put the project on Hackaday.IO
Because of the neutral supply problem it might be better to put the controller in the ceiling rose. Most UK systems have neutral present there. (I believe that it is called the ‘three plate system’). I once helped design a mains powered smoke alarm that used this strategy.