RGBWW lights not working as expected using Esphome and Homeassistant


I recently flashed one of my OffDarks brand RGBWW ceiling lights with Esphome. The lights came with a firmware which uses Magic Home Pro app for controlling the light. But since the flux_led component of HA does not work smoothly i decided to flash it off it Tasmota or Esphome.

I tried tasmota first using this link as reference. All worked but somehow my Alexa was not able to set the color warm white or cool white. This worked perfectly with factory firmware so i am sure there is no issue with lights itself.

I then decided to flash it with esphome and Now I have a different problem. The RGB Lights and CWWW lights are working independently. They turn on together which should not be happening. Also the brightness setting controls the brightness of RGB lights only. The CWWW lights are controlled by Color temperature and White Value.

This is not something I want. I want only one type of light to be on and not both. Also brightness should control either RGB or CWWW which ever is in use. Can someone please help me in rectifying the code below. I used this code as per esphome wiki pages:

  name: mb_light_left
  platform: ESP8266
  board: nodemcuv2

  ssid: 'myssid'
  password: 'mypassword'
  fast_connect: on
># Enable fallback hotspot (captive portal) in case wifi connection fails
    ssid: "Mb Light Left Fallback Hotspot"
    password: "mypassword"


  password: 'mypassword'


  password: 'mypassword'

  port: 80

  - platform: sntp
    id: sntp_time
    timezone: Asia/Kolkata
  - platform: rgbww
    name: "Master Bedroom Light Left"
    red: output_component1
    green: output_component2
    blue: output_component3
    cold_white: output_component4
    warm_white: output_component5
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K

  - platform: esp8266_pwm
    id: output_component1
    pin: D1

  - platform: esp8266_pwm
    id: output_component2
    pin: D2
  - platform: esp8266_pwm
    id: output_component3
    pin: D5

  - platform: esp8266_pwm
    id: output_component4
    pin: D7
  - platform: esp8266_pwm
    id: output_component5
    pin: D6


I’m thinking about buying a Offdarks light and would like to flash it. Do you have a guide?

Offdarks lights are very good quality but very difficult to flash as it uses ESP M2 chip and RX and TX are not exposed to main circuit board. Hence I had to de-solder the ESP M2 chip from RGBWW controller and replaced it with my own ESP (NodeMCU v1.0). After that I just wire it like Arilux LC11 (Pinout explained here). Then I just flashed my nodemcu with tasmota and seleted Arilux LC11 as device in Tasmota. Voila it worked like charm.

All thought I couldn’t get it working with ESPHome as explained in my first post in this thread. I am still looking for the solution for the same as I prefer ESPHome vs Tasmota. I hope someone will post the solution for the same.

Hope you understood. If not let me know.

I have similar problems with a Magichome controller flashed with ESPHome that I’m using to drive an RGBWW lightstrip. I’m able to control control the white color_temp and white_value(brightness), but only while the RGB colors are on at the same time.

From the Home Assistant light color picker I am able to pick RGB colors, set the brightness, and set the white value, but changing the color temperature slider gives me the following error:

Failed to call service light/turn_on. value must be at least 1 for dictionary value @ data[‘color_temp’]

Strangely, I can go to the services in the developer tools section and call the light_on service on my light with the following values and it works:

entity_id: light.living_room_rgbcw_strip
color_temp: 500
white_value: 255

But as you mentioned, there seems to be no way to control them correctly. Using service calls, I can control RGB color and brightness, and I can control white color_temp and white_white value, but only if the RGB colors are on. There seems to be no way to turn RGB completely off and turn on only the WW/CW leds because the brightness value controls the brightness of all LEDs, and setting RGB colors to 0,0,0 results in the all being set to full brightness, weirdly enough.

I agree … I searched a lot but could not do it with ESPHome. Maybe I will open a issue on ESPHome Github. In the meantime i am using this code which works fine with Magichome devices. May be you can give it a try.

Thanks for the link, I’ll give that a try. If you do open an issue, drop a link to it here in this thread if yu have a chance. I’ll help out with any additional feedback. Otto is really responsive and on top of things, so I’m sure we could get it sorted out.

No one has posted any yaml files, so it’s pretty hard to diagnose anything. If you really want the whites separated from the color, you could just make two different light components controlling them.

The OP posted his original yaml, what additional yaml do you need, @ssieb? I’d like to see the white channels and the rgb channels independent of each other as well, but have not worked out how to make that happen.

I don’t know how I missed that then. If you want to separate them, then make an rgb light with just the rgb outputs and make a cwww light with the whites.

You said basically the same thing in your earlier post, but this time I finally understood to have two “lights” in the same device. Thank you! This works exactly as I needed, and all I need to add is an automation or node-red flow to turn off the white light if it’s on when the rgb light comes on, and turn off the rgb if it’s on when the white light comes on. All controllable with Alexa, too! Thanks again!

Did this ever get fixed? It’s almost impossible to use the lights correctly at the moment. Can we make this behave like a hue light?

This comes up quite often lately. Just split your rgb(cw)ww bulbs/strips into 2 lights one pure rgb and one pure cww

Here’s Example config of a Teckkin rgbw bulb:




change it to your pins and you should be fine

Thank you. I would prefer to have one light (like my hue) but this works for now.

I don’t have much to contribute yet, other than a caution. I burned out my first ESPhome flashed RGBW bulb while trying to get a handle on why the white channel was hard to control (it seems like I need to have some RGB channels on by a few % to get control of white).
I think what happened is at the time I had White on 100% and unknown to me the RGB was also at 100% while I was tapping away for 30 mintues on the PC re-coding (or trying too). In that time the lamp got so hot it died…
I’ve read the thread above now, I’ll try to split the bulb up into two via ESPhome.

This works ok for me until it’s integrated better. In Lovelace there are two separate ‘bulbs’ but I place them in the same card. It’s up to me then to make sure RGB and White is not on at 100% at the same time in my automations…

The guts of my ESPhome YAML

  - platform: esp8266_pwm
    id: output_red
    pin: GPIO4
  - platform: esp8266_pwm
    id: output_green
    pin: GPIO12
  - platform: esp8266_pwm
    id: output_blue
    pin: GPIO14
  - platform: esp8266_pwm
    id: output_white
    pin: GPIO5

  - platform: monochromatic
    name: "Cocoon Bulb #3 -W"
    id: w_light3
    output: output_white

  - platform: rgb
    name: "Cocoon Bulb #3 -RGB"
    id: rgb_light3
    red: output_red
    green: output_green
    blue: output_blue
#    white: output_white

Bit of a +1 post - I have some Arlec branded lights flashed with ESPHome (great integration btw!). Went through the same drama - rgbww comes up as some weird component where you have a ‘white’ slider separate to the ‘brightness’ slider. When in white mode, the ‘brightness’ parameter does nothing. Can’t help but think this is maybe a HA thing rather than an ESPHome issue?

I’ve ended up with two devices and a generic software interlock in node-red (which prevents the white and RGB components of any one bulb being on at the same time), then used conditional entities in Lovelace, along with a tidy RGB card, to merge the two back into one controllable element.

All I wanted was a simple replacement for my [overpriced] LiFX bulbs…

Check here CW/WW and Colour Temperature slider support in custom Light Output for a work around/fix.

+1 for this workaround. It just about gives us what we want.
I’ve got it up and running on an Arlec RGBWW downlight and it works albeit with a couple of oddities - see my comment in the linked thread.

Glad it helped

Thanks! I’ll check it out.