The BEST RGBW Lightbulb Firmware? E1.31 and MQTT control in one package.December 19, 2018
Today on the hookup we’re going to create the ultimate RGBW smart light that can be fully controlled locally by home assistant via MQTT but can also become part of your holiday light show using programs like xlights and vixen via the DMX E131 protocol.
Ever since our house was built in 2012 I’ve always disliked our builder’s grade porch lights. Not only did I dislike their appearance, but there was just enough of a gap at the top of them to let insects and lizards get into the casing where they would inevitably die and block out the light. If I didn’t get up on a ladder once every few months and dump out the bugs the light would dim to the point where you could barely tell it was on.
I’ve also been putting in a fair amount of work on my holiday light setup this year and I got to thinking… what if I could replace the porch lights with RGBW lights that could participate in the light show?
Enter Zemismart who contacted me a couple of months ago and asked me if I’d be interested in reviewing any of their products. I took a look around their website and noticed that they had some 6” RGBW flush mount downlights that were compatible with the Tuya platform.
The tuya platform was attractive to me not because I ever plan on using tuya in my smart home, but because tuya products use the ESP8266 chip to provide wifi access to their products, and we all know how great the ESP8266 is.
Zemismart sent me two of these 6” downlights to review, and they are pretty great. On the top side there’s not much to see, just a simple AC to 5v DC stepdown converter. The rest of the casing looks nice and durable with a pretty high build quality.
If you don’t care about E131 or MQTT local control you can set up these zemismart light using the tuya cloud and the tuya app, and there’s even a component that allows you to easily add those tuya cloud devices to home assistant. But at that point, you’re still relying on the cloud and allowing closed source firmware on your home network… not an option in my house, so I needed to be able to get to the circuit board containing the ESP8266.
Getting into the zemismart downlights is actually easier than it looks. The plastic is very bendable, just grab the outside of the bezel and bend it back until you can see the edge of the opaque plastic lens cover, then stick a small screwdriver, or a butter knife into the gap you created and pry out the cover.
Inside you can see that there are 9 red LEDs, 6 green leds, 6 blue leds, and 14 white LEDS mounted to a metal casing with some thermal compound for heat dissipation. In the middle is a circuit board containing the ESP8266 and a four channel LED driver called an MY9291.
The circuit board for this light has all of the connections nicely labeled. In order to properly flash this chip we’ll need to solder a wire to the 3.3V pad, the ground pad, the RX and TX pads, and also the GPIO zero pad in order to put the chip into programming mode.
The easiest method for attaching wires to these pads is to add a small amount of solder to each pad and then tin the end some thin wire then you can just put the wire directly on top of the solder pad and apply a small amount of heat. We don’t need to make a permanent connection here, these are just temporary wires for flashing our new firmware.
This is as good a time as any to thank the people over at gearbest for sending me a TS-100 soldering iron to try out. People all over youtube are raving about this new type of low voltage highly portable soldering iron, and I wanted to see what all the fuss was about. My previous go-to soldering iron came in a $20 kit from amazon and it works pretty well, but it lacks accurate temperature control and it takes over a minute to heat up to the target temperature. The TS100 has precise digital temperature control and heats up in seconds. It also runs off of 12 to 24V DC so it can be powered with a lipo battery pack for portability. This is my new go-to soldering iron for all of the small projects that do at my desk or at the kitchen counter. Gearbest has also provided a promo code for this video, so if you use the promo code GBHookup1 you can pick up this iron for $53 including free shipping, a pretty great deal on a super nice soldering iron.
Next I’ll use my trusty FTDI adapter to add a new program to the light. The first firmware that I tried was tasmota, and it worked pretty well using the AiLight platform. My only annoyance was that there was no easy way to use the white channel with the RGB channel without them overwriting each other. I could have solved this in node red, but I wanted something easier to be able to share with you all.
At that point I decided I was going to put together a new firmware, and there’s been a lot of talk the past few weeks about using xlights and the E131 protocol to create holiday light shows. So I did a little research, grabbed some libraries for E131 and the LED driver on this light and put them all together. The result is a light that is easily added to home assistant and controlled via MQTT, but has a dropdown menu to switch from MQTT control to E131 control. That means that my porch lights will be able to participate in my holiday light show without needing to change firmware or do any other modification.
For this use the Zemismart downlight is an awesome solution because it has so many color LEDs, but if you’d rather use your existing lighting fixtures I also wrote a slightly different version of the firmware to control the sonoff B1 via E131 and MQTT. As I mentioned in an earlier video, the only downside is that there are far fewer RGB leds on the sonoff B1, so it isn’t going to generate as rich of color as the zemismart lights will. If you have another type of RGBW led light it will probably work with my firmware as well, but you’ll need to figure out which LED driver chip it uses, which is either the MY9291 like the zemismart or two MY9231s like the B1 and then pick the correct firmware.
If you get any library errors while uploading, the urls for the needed libraries are located at the top of the sketch.
If you have an existing sonoff B1 with tasmota on it and you’d like to try out the new firmware you don’t need to resolder any wires onto the bulb, you can actually use tasmota to switch the firmware over the air. You’ll need to first upload the tasmota minimal.bin file and then create a new bin file in the Arduino ide with the new firmware, just update the user configuration section with your credentials, select generic ESP8266 as your board with these options and then click “sketch” “export compiled binary”, wait for it to compile, and then click “sketch” “show sketch folder”. When that folder pops up you’ll see that it contains a .bin file with the same name as the Arduino sketch. You can then use the tasmota web interface to upload this .bin file to your tasmota device. After it uploads you should now be able to control it the MQTT topics specified in the YAML in the description. This file also includes ArduinoOTA so you should see your bulb in the Arduino IDE under ports -> network ports. If at any time you’d like to go back to tasmota you can use the Arduino IDE to send the upload the tasmota firmware over the air using that network port.
If you’re only interested in using the firmware for your holiday show and you won’t be using a home I’ve also included a super minimal version that doesn’t include MQTT on my github page. If you’re on the fence about whether you’re interested in the E131 protocol, here’s a quick look at what these lights look like in action.
I’ve got lots of links down in the description including all of firmware that I’ve put together for this project, as well as links for the zemismart lights and the sonoff B1. The nice people at Zemismart have also given me two of these 6” downlights to give away, so on Saturday I’m going to select two of my patrons to receive one for free.
Speaking of patreon, thank you to all of my awesome patrons for your continued support, I really appreciate it and I hope you and everyone else continues to enjoy the content on this channel. We’re getting really close to that 20 thousand subscriber mark, and I’m honestly blown away by it. Once we get there I’ll be releasing an extra video in addition to my weekly video with a walkthrough of my smart home setup. So if you enjoyed this video and you want to get us one step closer to 20 thousand, please consider subscribing, and as always… thanks for watching the hookup.