How To: Inexpensive ($10 US) WiFi RGB Bulb that works with Home Assistant

This is awesome. My 2 experimental bulbs (same you have) arrived about a week ago. I’ve been slowly getting around to reprogramming it to work off my own MQTT server. I’ve been following Michael’s issue progress in the bitbucket discussions for the ESPurna code.

Thanks for posting all this! I’ll be testing as soon as I have time!

Edit: Or, you are the one and the same Michael aren’t you :slight_smile:

Nice Sam! I see you implemented the color temperature. Hope my code was helpful!

1 Like

Glad to be of assistance! You are correct, I’ve been slowly making headway with Xose’s code on bitbucket and thought I would share some of my learnings to hopefully save others a bit of time and headaches. Do give a shout out if you run into any difficulties! Best of luck!!! :slight_smile:

Last couple of days I’ve spent on improving my code a little bit further. The library should be pretty stable right now. In the meantime I managed to get the Homebridge (with Home Assistant plugin) installed as well.

Now I can control the AiLight with iOS Homekit and Siri! Pretty neat stuff…

I understand that the Yeelights work well with 110v for those afflicted with this voltage. They are quality lights and on special are not much dearer than these cheapies.

Agreed, I see that Amazon, in the US, now carries the 110v version of the Yeelight, but it’s still a bit more pricey at $35 USD currently.

Yeah indeed about the price. And the price of this AiLight allows you tinker / hack all you can :slight_smile: Nothing more satisfying than that.

1 Like

Sorry for little beginner question. I have never worked with Arduino. I followed this site, but then I have some question regarding the section ‘Configuring the hardware’, in the file ‘code/espurna/config/arduino.h’ should I enable
//#define AI_LIGHT
?

Do I uncomment by removing the ‘//’ and keeping ‘#define AI_LIGHT’?

Yep removing the “//” means uncommenting thereby defining AI_LIGHT

Sorry for another beginner dumb question… how do I do to install your code as there’s no .ino file. I have never used Arduino so…

@DariBer, I just added a simple example code showing a rainbow effect using my AiLight library. (https://github.com/stelgenhof/AiLight/blob/master/AiLight_Rainbow.ino).

This is truly a super simple example showing just how you can use the library. It doesn’t demonstrate any other capabilities like MQTT or OTA etc. For more advanced uses, have a look at the examples of Xose Pérez library here: https://github.com/xoseperez/my9291.

@mertenats also created a very similar library for the AiLight and has an excellent example with MQTT integration: https://github.com/mertenats/Open-Home-Automation/tree/master/ha_mqtt_rgbw_light_with_discovery

Enjoy!

I did this a few weeks ago. Only thing I don’t like about the bulb:

  • My bulb gets really hot (I only bought one to try out, so it could vary with others)
  • RGB on my Home Assistant passes the color format as “RRR GGG BBB”, which the light does not understand correctly (always blue). I have not found a way to send RGB to the light through the HA UI. Does anyone have a solution to this?
1 Like

Mine don’t get hot at all. How hot do yours get? Hot enough to get burned?

As for the colours, where do you see those RRR GGG BBB values? I am using the MQTT JSON Light component and colours are representated nicely as RGB values from HA (e.g. {"r": 255, "g": 100, "b": 29})

Can anyone tell me where you can currently buy these bulbs for US $10 or thereabouts, and which doesn’t have restrictive shipping? (I am in NZ). All the chinese shops seem to want ~US $20 or more, and the ebay sellers who sell for US $10 don’t ship here.

OTA is that updates 'Over The Air?
So if there’s an Espurna version 1.8 I will be able to update the bulb without needing to solder the cables again?

If yes, is there any document how to do a OTA to these bulbs?

@DariBer Yes, that’s ‘Over the Air’. You don’t necessarily need the Espurna firmware for OTA, but Espurna is great because it contains all the features you need.

In case you want to do it yourself, just include the ArduinoOTA library in your project. Have a look here: https://github.com/esp8266/Arduino/blob/898d28017662ba2b31fbb0b687af9b036b673672/doc/ota_updates/readme.md

Yes, OTA will save you from soldering again. However it is recommended to make sure your code runs fine and you can do OTA without any issues before removing the wires (I can speak from experience, haha).

@nickrout I got mine from this store: https://www.aliexpress.com/item/2016-LED-light-bulbs-E27-Color-temperature-6000K-warm-white-RGBW-Wireless-wifi-night-light-LEDs/32687117804.html They are about $12.50

Seems they are out of stock now :frowning:

I manage to get a deal, 10 for $110 including shipping to Sweden from a seller at Alibaba

But first I bought 2 from Amazon in UK to try if it works for me, will try today and if everything is OK I will buy the 10 from Alibaba. The deal is valid for 15days, so that’s 13 more days.

@stelgenhof thank you so much for all your help, will probably ask some more Q before I get it all :slight_smile:

1 Like

I bought this CP2102 USB to TTL UART and I will use it on my Mac. I wonder will I need to download a driver for it or does Arduino IDE 1.6.11 have built in driver?

If I need a driver, what driver will I need, is it this one, CP210x USB to UART Bridge VCP Drivers for OSX v4

I haven’t personally used the CP2102 specifically, but the web page you referenced for the driver looks like it should work.