Home Assistant Light wont accept 0,0,0 RGB value

I’m having trouble configuring an RGBW light bulb I’m using.

If I send a state for a light, and use an rgb_color of (0,0,0), Home Assistant receives that state okay, but in the Home Assistant state machine, the rgb_color is set to (255,255,255). Am I unable to send all zeros for the RGB color of my light?

I need to do this in order to turn off my RGB LEDs so I can just use the W LED in my light.

Thanks!

Please post the YAML of what you’re trying to do.

I’m just making a service call of light.turn_on, with the service data:

entity_id: light.xx_lamp
rgb_color:[0,0,0]

If I then look in the home assistant state machine, the rgb_color state for that the light is not [0,0,0] but is actually [255,255,255]. I know the service call is working because I can set other RGB values, just not all 0’s. If I can’t get the state machine to accept rgb_color equal to [0,0,0], then using the scene snapshot and restore features restore the bulb back to an RGB value of 255,255,255, which is RGB white, when I really want the W LED to be used.

If your bulb is RGBW is it not expecting 0,0,0,0 ? Or
rgb_color: [0, 0, 0]
white_brightness: [255]

Prety sure you still have to fees it the W channel even if nothing is changing on that channel

1 Like

If I feed it the W channel, and RGB [0,0,0], the white LED turns on and RGB bulbs turn off. BUT, Home Assistant state machine won’t store an RGB value of [0,0,0] and instead stores it as [255,255,255]. That means that if I use the scene snapshot and restore, it saves an RGB value of all 255’s and restores that, not using the W LED.

Hmmm, the only thing I can say is set RGB to 1, 1, 1

Doesn’t fix it, but does mean it should store it.

What light platform are you using?

FWIW, for light components, the rgb_color attribute and light turn on option aren’t really RGB, are they? True RGB would imply both color and brightness, but the light component is really only using it for color. So (0,0,0), (255,255,255), or any (x,x,x) are the same “color”, right? (I mean all shades of grey, including full white and full black.)

I can look into the implementation of the light platform you’re using to see how it uses rgb_color, white_value & brightness.

Ah yeah thanks for the suggestion. Unfortunately one of the RGB channels has to be set to 255.

I’m using the built in light integration. And yeah you’re right about that.

Which one? There are a zillion: Integrations - Home Assistant

Its an MQTT based light: https://www.home-assistant.io/integrations/light.mqtt/

The light is running Tasmota.

Edit: I just tried this with a LIFX based light, and set the rgb_color to [0,0,0], in the state machine the rgb_color disappears and the W LED turns on, the RGB LEDs turn off - this is what I am trying to do with the MQTT lights.

Oh. That’s a pretty complicated light platform. I don’t have any practical experience with MQTT, nor a light that can change color, whether or not it has a separate white channel. (The closest I come is a couple of Z-Wave dimmers.) Although I’m fairly familiar with the light component level code.

After browsing through the mqtt light platform code, there does appear to be some interactions between rgb_color (well, hs_color, which rgb_color is converted to/from) and brightness, if there’s no brightness topic (whatever that means.)

Bottom line, I’d guess that the issue is with Tasmota, or maybe how you have it and/or the mqtt light configured in HA. But that’s just a guess. You’d have to get someone who has practical experience with Tasmota, or at least the mqtt light platform.

1 Like

I appreciate the response and help! I think I’ve narrowed it down to being an issue with the mqtt light integration as I can bypass Tasmota by sending MQTT commands directly to the mqtt integration, and it just wont set the state right.

None of this had been an issue until I started using the scene snapshot and restore. I’ve been looking for a reason to switch from Tasmota to espHome and this is looking like it may be it.

I know in the latest 0.104 release, for WLED, pure white support was improved #30477 by setting the the RGB channels to 0’s (turning them off) and just using the W channel only. It looks like this might be a similar issue, only with the built in light integration. If I send a service call rgb_color = [0,0,0], this is a valid RGB color, and home assistant should accept it and turn the RGB channels off accordingly.

mqtt & wled are both “built-in” integrations, and both provide light platforms that are used in conjunction with the light component-level code.

Some of the handling of rgb_color, brightness and white_level (both in implementing services and creating entity attributes showing current state) is done at the component level, but the platform level (i.e., mqtt or wled) can override/enhance that.

Regarding your use of mqtt, maybe it has more to do with your configuration. What is your mqtt light configuration for the RGBW light(s) you’re using?

They lights are auto discovered by Home Assistant (through the MQTT integration). It’s an option that can be set on Tasmota to allow for auto discovery and configuration for Home Assistant.

I haven’t changed anything from what is explained in this Wiki

The lights are added to HA through the MQTT integration