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

Thanks @lxz! Glad to hear

Still keeping my eye out for the 9W bulbs also. Haven’t seen any yet.

Hi All,

If you don’t only want/can’t use MQTT, you can now use the newly added REST API integration! This is still in development, however, works pretty well so far.

There is a Wiki Page describing how to use the REST API. Not all documentation is complete, but working on it…

A screenshot from Postman, showing the results of “GET /api/light”:

Note that you need to update your config.h file (check config.example.h)!

Happy to hear your feedback! If you have any issues, please use the issue tracker on Github.

Cheers! Sacha

1 Like

As I am adding new features to the AiLight firmware, I’d like to know what you think is still missing in the firmware.

Some of these are on my list:

  • Track uptime (running time and ‘on’ time)
  • Effects (Rainbow, Color Loop, ColorCycle, ??)
  • MQTT TSL.SSL Support
  • HTTPS Support
  • …

Anything else you’d like to see added? Also, if have suggestions for changes to the Web UI, love to hear them!

Thanks! Sacha

Thanks so much! Great work! :slight_smile:

I’m wondering, is there a way to turn the bulb into an AP and have a Wifi light switch connect directly to it acting as an MQTT broker between Home Assistant and the bulb? With the switch publishing the MQTT topics? Long shot but it was just something that ran through my mind when trying to decide on switches.

On another note, is this the 9W version you mentioned? https://www.alibaba.com/product-detail/RGBW-WiFi-Smart-LED-Bulb-E26_60574888375.html

Cheers!

Just another thought, my hallway light fittings take x3 E27 bulbs and I have two light fitting so x6 bulbs in total. How about an option to group them together to act as “one bulb” I guess giving them the same MQTT topics would achieve this?

I bought a Lohas branded bulb that looks very similar on Amazon when it was on a flash sale. You can install Sacha’s code on the bulb, but it will not act the way you expect. I do not remember the specifics but it does things along the lines of the red slider turns the bulb blue. The green slider turns the color white, etc.

The reason is that this bulb actually uses different chips. If you have the know how it may be possible to play with the code and get it to work. If you do, that may not be a bad deal. If not, I would pass.

The bulb doesn’t need to be in AP mode for that. If the WiFi switch is publishing MQTT messages to the light’s MQTT command topic, your switch will work :slight_smile: I am planning on doing the same but with NRF24L01 transceivers instead of WiFi.

As for the 9W bulb, these look like LOHAS branded ones and as @gumbo already replied these might have a different LED driver, so the AILight firmware will not work. (Only MY9291 LED Driver are supported).

1 Like

Yes, the easiest and quickest would indeed be using the same MQTT topics. Alternatively you could also configure this behavior in HA (haven’t tried it though).

1 Like

Ended up buying x15 of these, they arrived today. Shame but two are broken, will see what the outcome of that will be.

I’ve already put AiLight on 13 of them using the AiLight Jig that I had 3D printed :slight_smile:

Lots of work to do now, still waiting for my Xiaomi switches to arrive so I can control them

I’ll see if I can post a comparison of the 5w and 7w, there’s a BIG difference in brightness!

Nice, how long was the delivery?
Please do post a comparison with regular no wifi bulbs too :grinning:

Delivery took about a week!

I will post a comparison as soon as possible.

My Xiaomi switches turned up this afternoon but that gateway I’m still waiting on so for now they will go on regular switches and lamps.

First thing I’m going to try is putting x6 into my hallway light fittings with the same MQTT topic.

Try asking for a refund for the 2 broken bulbs
I usually just google translate with the seller

They’ve just said they’re going to send two more free of charge. Will wait and see.

I’ve put the x6 bulbs in today. Haven’t had chance to do a comparison yet but will do so on my lamps.

3 Likes

Wow! Looks very cool using my AiLight firmware :). So I guess it did work if you used the same MQTT topic for all the lights.

1 Like

Yes thank you @stelgenhof it’s amazing firmware. Have linked to your git in the YouTube video, hope you don’t mind.

Yeah set the MQTT topics the same. The change instantly and pertly in sync! Really pleased.

I’ve got another x3 ceiling cluster to do now but need to remove the dimmer switch as it’ll try and dim at the switch.

Got x2 outside wall lights to do and x3 lamps.

Decided to control them all using Xiaomi switches for now, waiting on the gateway to arrive. It won’t send dim commands to the bulb through HomeAssistant.

When a wall switch comes along that can send dimming to HASS and doesn’t require Neutral I’ll probably replace them.

Also, the colour change works perfectly using homebridge-HomeAssistant into Apple HomeKit on iOS. You have to have the white_value set to 0 though as Apple HomeKit won’t do the the white value.

Happy to hear you like it. Personally I think it needs some more work :slight_smile: More changes are coming

1 Like

I look forward to it! Happy to provide feedback for different uses.

One thing I have already done is set an automation when the bulbs come on they are set to white.

I plan to only use colours for notifications (blue for rain coming, flashing red for alarm, purple for cold temperature, green to confirm alarm disarmed etc)

I’ve created a colour loop script for fun and exposed it to alexa for voice activation

Wish they were available for GU10 bulbs for my kitchen. Wonder if they could be built.

1 Like

I found a workaround for getting the colours to display correctly when using HomeKit… As HomeKit doesn’t control white_value and I like my white_value set to max when I’m using the bulb in a normal white colour.

I use this automation to set my light default to white when they turn on:

- alias: White - Hallway Lights
  trigger:
    - platform: state
      entity_id: light.hallway_lights
      to: 'on'
  action:
    service: light.turn_on
    entity_id: light.hallway_lights
    data:
      rgb_color: [255, 136, 13]
      white_value: 255

I then use this automation which triggers when the colour is changed to anything other than the default [255, 136, 13] which sets the white_value to 0 so that you get “proper colours”:

- alias: Hallway - Colour Set White Value
  trigger:
    platform: template
    value_template: "{% if is_state_attr('light.hallway_lights', 'rgb_color', [255, 136, 13]) %}false{% else %}true{% endif %}"
  condition:
    condition: state
    entity_id: light.hallway_lights
    state: 'on'
  action:
    service: light.turn_on
    entity_id: light.hallway_lights
    data:
      white_value: 0

It’s not perfect and needs tweaking but it’s working quite well so far.

Only issue I have is if I set the light on to a colour from an off state, it will sometimes change to the default colour. I might be able to get around this by setting the default colour when the light turns OFF via a MQTT pub?

Also controlling the colours via Alexa now!

Have posted a project:

1 Like