#I use the rgb value of a light to set

1 messages · Page 1 of 1 (latest)

queen bobcat
#

here is the template. Just change to your entity:

icon:
  - color: >
      [[[
        return `rgb(${states["light.fredrik_desk_bulb"].attributes.rgb_color[0]},${states["light.fredrik_desk_bulb"].attributes.rgb_color[1]},${states["light.fredrik_desk_bulb"].attributes.rgb_color[2]})`;
      ]]]
``
#

oh sorry, this picks the rgb ATTRIBUTE of the light, and not the state. So you have to modify a bit for that

slate rapids
#

Thanks for your help, I try this one :

entity: switch.table_pixel_0
icon: none
show_name: false
styles:
  card:
    - background: white
state:
  - value: 'on'
    styles:
      card:
        background: >
          [[[
            return `rgb(${states["light.table"].attributes.rgb_color[0]},${states["light.table"].attributes.rgb_color[1]},${states["light.table"].attributes.rgb_color[2]})`;
          ]]]

I got an error

queen bobcat
#

I get the same error as you when trying to make a new card. But it works well in the card I allready have..... so strange