Home Assistant Community

Wrong template?

#1

What is wrong in this template customization?

  switch.tvlg:
    friendly_name: TV LG
    templates:
      icon: >
        if (state === 'on') return 'mdi:television';
        return 'mdi:television-off';
      icon_color: >
        if (state === 'on') return 'rgb(251, 210, 41)';
        return 'rgb(54, 95, 140)';

I cannot have this working properly.

#2

you have custom-ui installed? without that this won’t work.

#3

Yes, i have it installed. How to check if it’s properly installed?
And if not installed how to have the check of the status for changing icon and color?

#4

click on dev-info and it should say the install:

41

#5

Ok i have it installed but i had an old version … now i upgraded to the last… i need to restart HA to have it working again?

#6

you guessed correctly…

#7

Ok, thanks…