Making Smart Bulbs Smarter With The Power Of MQTT

What’s the point of smart home automation? To make every day tasks easier, of course! According to [Tomasz Cybulski], that wasn’t the case when he installed IKEA smart lights in his closet. It’s handy to have them in a common switch, in this case a remote control, but having to look for it every time he needed the lights could use some improvement. Enter his project to make smart bulbs smarter, through the use of a simple ESP8266.

While hooking a door switch to the lights’ power supply could provide a quick solution, [Tomasz]’s wife wanted to keep the functionality of the remote control, so he had to look elsewhere. These light bulbs use the simple Zigbee protocol, so arranging for other devices was rather trivial. A USB dongle to interface with the protocol was configured for his existing Raspberry Pi automation controller, while an ESP8266 served as the real-world sensor by connecting it to reed switches installed in the closet doors.

With all the hardware sorted out, it’s a simple matter of making it all talk to each other. The ESP8266, using the Tasmota firmware, sends a signal to an MQTT server running on the Raspberry Pi, which in turn translates it to a remote trigger on the Zigbee frequency with the dongle. The lights turn on when the door opens, and off again once it closes. And since there were no further modifications to the lights themselves, the original IKEA controller still works as expected, which we’re sure [Tomasz]’s wife appreciates!

MQTT can be an interesting piece of software that goes beyond just home automation though, and if you already have a server in your home you can use it to transfer your clipboard’s contents to another device. If you are using it for home automation though, here’s an inspiration for a rather unusual dashboard to keep things interesting. Check out this hack in action after the break.

14 thoughts on “Making Smart Bulbs Smarter With The Power Of MQTT

  1. “…use the simple ZigBee protocol…” Ahem, which one? These are using the ZigBee LightLink application layer (if they haven’t been updated to the new application layer), that’s slightly different from an Arduino ZigBee shield or the connection layer that people usually play with.

    1. Then later, you can upgrade to smart switches and smart bulbs, so that you can use one remote to turn the light on, and another to program its color sequence.

      I was in a hotel room that had an Alexis and a smart TV. There was a card telling me how to use it. “All” I had to do was say, “Alexis, tell the Vixio TV to turn on”. No, “Alexis, turn on the TV” wouldn’t do the trick. We’re not there yet.

      1. Smartbulb, smartswitches, smartar**
        How comes this amount of technology (rpi, Linux, zigbee, Internet, SaaS, etc… Can be required to just switch on/off a light bulb in a closet? Why cannot we just simply use motion sensor, timers and door switch? As they likely will still be functioning in 10 year (not like Hue)

        1. In our closet we have a switch on the door that is pushed when the door is closed. Connecting to the NC pins the little LED light comes on when you open the door. Basically it is like a fridge lol

    2. I’ve found the half way solution really works well – Custom surrounds to hold the Hue zigbee remotes over the legacy switches. At least if things fall over, you’ve got a working dumb switch under the magnetically held remote.

  2. Just curious. Why not use a Tradfri gateway for the lights (standard, off-the-shelf), and a Tradfri library on the Pi?

    Or get a second remote, pair it with the same lights, and solder the switches to the remote PCB and tuck it away somewhere?

    I have Tradfri lights connected to a Tradfri gateway and controlled by a Tradfri library on my Pi running Domoticz. It’s (currently) working.

  3. More layers is more latency, people do not like latency they think something is wrong. The zwave dimmers in my closets runs dumb lights and uses the existing door switch all while being completely concealed. Opening the door the lights dim up, the controler gets notified and if needed changes the level before the bulb gets that bright. If I wanted different color temps or colors overall would use smart bulbs but not something I want for a closet.

    Now my bedside lamps are smart with a dimmer directly (in the zwave sense of direct association) controlling them and the hub changing color temps and colors.

    Zigbee has to many competing standards it’s a PITA to work with. MQTT is pretty much an HA universal glue but would rather see a wifi bulb or something that the ESP can directly control and let the hub deal with extra logic rather than taking several hops. Say an MTQQ setting for max level based on time/lux or whatever.

  4. Nice project but I would have used Home Assistant instead. It supports zigbee with a dongle (or the tradfri gateway) and mqtt but also has way more protocols and devices it also supports, so you can add other stuff too later for more home automation.

Leave a Reply to oopsitsaflameCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.