Entity Icon color & custom icon color based on state (customise icon_color)

@ Mariusthvdb

yes this is remarkable as i remember a discussion about a year ago about not using hs_color in favour of rgb when using icon_color with custom ui (you’re name rings a bell to me on this one)

I can confirm however this is functioning using hs_color, although choosing a hs color value is frought with a bit of complexity

the best guess i can see is that this uses HSB HSV value which i found a color picker from here

http://colorizer.org/

much easier defining rgb values

custom ui version i am using is 20190113
and Hass 88.2

for example

  templates:
    hs_color: >
      if (state > 2500) return [0,100,100];
      else if (state > 1500) return [60,100,100];
      else if (state > 1000) return [240,100,100];
      else if (state > 200) return [120,100,50];
      else return [120,100,20];
2 Likes