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

Is there any document how I can flash the bulbs OTA from PlatformIO, can’t find anything when I look around in the app

Excellent!

At the moment the identifier number #### is dynamically determined from the ESP8266 Chip ID and cannot be changed. You can change the part before the ‘_’ by changing the constant “DEVICE_ID” in your config,h file.

From the PlatformIO menu in Atom, select “Run other target…” (F7 key). From the popup window you can scroll / search for a target named “PIO Upload (prod-ota)” or “PIO Upload (dev-ota)”.

Choosing either one of these will start the build and flash process. Keep in mind that you sometimes might need to try a few times to flash via OTA as it isn’t always successful.

When I try to get the ID from the bulb (running serial monitor in PlatformIO) I only get load of “garbage” see bellow. It looks like the settings for the serial port is wrong. Now I have 9600,8,N,1, what do you have?
Or is it cause I’m not using FTDI and using CP2102?
It seems like it’s working when I try to flash the bulb, it gives me no error messages and it counts up to 100% and say success

This is what my serial monitor gives me after I have flashed the bulb:
pio device monitor --port /dev/cu.SLAB_USBtoUART --echo
— Miniterm on /dev/cu.SLAB_USBtoUART 9600,8,N,1 —
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H —
_ ��!Ԋ ��!Ԋ ��!�ʘ1!� ��!ԊI�␐�!␛�␐�!␛␐_

seems like I got it to work now. If looking bellow, is the ID ESP_AC38FB or is it just AC38FB?

[WIFI] SSID : LIBE
[WIFI] IP Address : 192.168.50.101
[WIFI] MAC Address : 5C:CF:7F:AC:38:FB
[WIFI] Gateway : 192.168.50.1
[WIFI] DNS : 192.168.50.2
[WIFI] Subnet Mask : 255.255.255.0
[WIFI] Host : ESP_AC38FB
[WIFI] Channel : 1
[WIFI] PHY Mode : N
[WIFI] Oper. Mode : STA

Nice! The WiFi hostname is not properly set yet. Your ID will likely be “AiLight_AC38FB”, so you can use “AiLight_AC38FB.local” as the upload_port for OTA updates.

so the WiFi hostname isn’t something that can be set in config.h or platform.ini?
I changed to upload_port = “AiLight_AC38FB.local” in platformio.ini but I still get [WIFI] Host : ESP_AC38FB

It can be set, I just didn’t have the time yet to do this properly. For OTA purposes this WiFi hostname isn’t critical and is a separate variable from the OTA hostname (although usually they have the same value).

For now please ignore this one and check the output that says “Hostname : #####.local”. That will tell you the proper name.

I noticed a weird thing.

After I have flashed the bulb, I can ping the IP it received from my DHCP server, but if I disconnect my USB programer before I turn on the power to the bulb, it seems like it lost the network settings, I can’t ping the bulb and I can’t turn on/off.

So after it has been flashed I seems like it must have power connected all the time otherwise it get’s disconnected and I need to flash the bulb again.

I am not sure I follow what you’re saying. After flashing and disconnecting your programmer, you can switch on the power / screw it back in the light socket. Should work fine.

Don’t power on the bulb and connect the programmer at the same time!

my bad, I was in somehow a wifi radio shadow. so my wifi was bad. working much better now.

one feature request: If the power goes of (like turn of from an ordinary (old) light switch) when the power comes back that the bulb turns back on.

I think Espurna called it ‘Switch boot mode’ I would like to be able to set ‘Same as before’ :wink:

Great it’s working for you now! Thanks for your patience.

Yes, having a remember feature is on my todo list :slight_smile:

I’m trying to get OTA to work, I can’t see the hostname, I only see the WIFI hostname.

I will send you a link of the serial monitor output.

Hello everyone,

I loaded the espurna and all went well. I was wondering if there is any way to implement the ‘scenes’ that came with the bulb? thru mgtt?

I just ordered 20 at a total cost of US230 with shipping to NZ. Good call, but man I hate dealing with Alibaba, even their credit card processing seems harder than anywhere else.

Now that mine are ordered, and I contemplate soldering 20 of them, I wonder if it is possible to make some sort of jig to put the bulbs on for programming. Idea is some sort of spring loaded terminal to make firm contact with the contact points, and something (elastic?) to hold the bulb down.

I have no idea if something like that, without solder, would make a good enough electrical contact to program the bulbs, but it would make things a lot easier.

Anyone been own this road?

Using pogo pins might be suitable for this purpose.

Something like this:
https://www.adafruit.com/product/394

you can get them for 10-12 from gearbest

No the RGB ones - they are more like £20
Need to compare RGB price to compare like for like.
Of course this is assuming that the brightness and colour range is similar between the bulbs, but my hunch would be that the extra you pay for a yeelight is not wasted.

Around 15 the rgb, on offer