RGB lights color brightness

I’m trying to wrap my head around the RGB lights in Home Assistant.

You can have RGB and brightness but how do you achieve the two combined? So how can you set your light to “red” and then make it darker. Sliding the brightness to a lower value resets the colour to white which is not what I want.

I just don’t know how to do this using the standard light card nor using ljmerza/light-entity-card.

I’m controlling a DIY ws2811 light through MQTT.

What device is driving the ws2811 led’s?

And what’s the code that the device uses?

If the device is part of the esp8266 or esp32 family I recommend WLED as the code allows what you want.

It is an ESP32. There’s no issue on the ESP side. I don’t know how to do it on the Home Assistant side.

For example (simplified): I send 255,0,0 to the RGB topic. When I set the brightness to 50%, I want to have 127,0,0 instead of 127,127,127.

I’ve not had an opportunity to use that light-entity-card.
However it looks possible with the correct options combinations. What options are you using?
Card options link

Perhaps the author of the light-entity-card could help? Post the question on the github issue page.

BTW when using WLED w/Hass, it will auto populate a working card. no muss no fuss. just saying :slight_smile:

Thanks for your suggestions. I’ve implemented brightness on the ESP32. I used to calculate brightness on the client side based on the chosen colour (using this colour picker: iro.js). I understand HA expects this to be implemented on the device side.

I have made my favourite colors here is my color setup for RGB colours are (true red, sand yellow, pinky purple,lightish green, dark blue, true white) in that order. I copied and pasted my hole card color part things lol

type: custom:rgb-light-card
entity: light.bedroom_light
colors:

  • rgb_color:
    • 255
    • 0
    • 0
      brightness: 255
      transition: 1
  • rgb_color:
    • 251
    • 180
    • 50
      brightness: 200
      transition: 1
  • rgb_color:
    • 225
    • 0
    • 237
      brightness: 150
      transition: 1
  • rgb_color:
    • 150
    • 300
    • 50
      brightness: 200
      transition: 1
  • rgb_color:
    • 10
    • 19
    • 237
  • rgb_color:
    • 255
    • 255
    • 255
      brightness: 200
      transition: 1

Hi with following setting

rgb_color:
255
255
255
brightness: 200
transition: 1

Are You getting work white color? I have done same setting and white is not working, all other colors are ok. I’m using RGB led strip.

I can control directly from Shelly app and than white is working, from other card from HA as well. Is only not working with preset as above.