Overwrite icon_color with customize_glob.yaml

Hi everyone,

I’m looking for quick help to understand how I can overwrite the color on my icon with the customize_glob.yaml.

It’s working for the occupancy sensors (Apple TV and laptop) but not for the lights: Desk [wled integration] and Rainbow [nanoleaf integration].

sensor.*_occupancy:
  templates:
    icon_color: >
      if (state === 'Ethernet') return 'rgb(34, 160, 137)';
      if (state === 'Wifi') return 'rgb(34, 160, 137)';
      if (state === 'Playing') return 'rgb(34, 160, 137)';
      if (state === 'Home') return 'rgb(34, 160, 137)';
      return 'rgb(81, 81, 81)';

light.*:
  templates:
    icon_color: >
      if (state === 'on') return 'rgb(34, 160, 137)'; 
      return 'rgb(81, 81, 81)';

Did I’m missing something?

Thanks

‘Same’ here. I can change the icon, but not the color…

Did you find a solution in the meantime?

  customize_glob:
    "binary_sensor.d01_zimmer5_motion_*":
      icon: mdi:garage
      templates:
        icon_color: >
          if (state === 'Clear') return 'rgb(30, 160, 130)';
          return 'rgb(255, 0, 0)';

Unfortunately, I didn’t find a solution :frowning:

icon_color requires custom-ui install, have you done that?

next thing to note is that not all cards in HA support that, or phrased differently, custom-ui can not customize all cards in HA…

entities work fine, entity card doesnt. Ive summed them in the readme

Hi @Mariusthvdb ,

First, thanks for your reply!

I have Custom-ui: installed, version 20210528 adapted for HA 2021.6+.
I tried different cards and I have the same issue.

did you try those entities in an entities card? because that would be the test.