bokub / rgb-light-card

💡 A Lovelace custom card for RGB lights
MIT License
412 stars 24 forks source link

RGBW (and RGBWW?) support #44

Closed PaoloTK closed 3 years ago

PaoloTK commented 3 years ago

Home Assistant 2021.5 changed the way lights work so that RGBW and RGBWW lights can use 4 and 5 entries lists to control each channel. After updating I've noticed that the card doesn't work anymore with the white_value attribute, which is to be expected since it's been deprecated. However trying to use "rgbw_color" doesn't work either. I've verified it to work on the light by issuing a command from the developers tool menu. Here's an example from one of my cards:

type: entities
entities:
  - entity: light.bedroom
    name: Bedroom Light
  - type: 'custom:rgb-light-card'
    entity: light.bedroom
    justify: around
    colors:
      - rgbw_color:
          - 0
          - 0
          - 0
          - 255
        brightness: 255
        transition: 1
      - rgb_color:
          - 0
          - 0
          - 0
        white_value: 255
        brightness: 255
        transition: 1

I would expect the RGBW light to turn on the white channel at max brightness but neither option works.

PaoloTK commented 3 years ago

I've now tried setting up the card for another light (I used a Shelly RGBW2 before, now I'm using WLED) and the colors work correctly, so I'm not sure what's wrong with the Shelly (as I said I can set the RGBW color correctly from the developers menu). However even if the card works fine the buttons are all grey, so I guess supports needs to be added for the automatic color generation to work with RGBW and RGBWW lights.

bokub commented 3 years ago

Well, apart from the grey icon, the service call should work, because the card just sends whatever you put in the config to the light.turn_on service...

When I add your config in a card and click the icon, the service call seems ok

image

bokub commented 3 years ago

Can you please send a screenshot of the "command from the developers tool menu" ?

bokub commented 3 years ago

Looks like you don't need help anymore, I'll close the issue