#Struggling with getting an icon to change colour (I'm new to this)

1 messages · Page 1 of 1 (latest)

kindred fulcrum
#

I've created a badge that uses a helper template which provides me with the count of how may lights are on. This works well but ideally I would like the colour of the light bulb icon to change based on if there are any lights on or not.
When 0 I would like it to be grey/disabled, when more than 0 then it should be yellow/orange.
I've added card mod but just cannot get the icon to change colour, any help would be much appreciated.

worthy sleet
#
{% set light_counter = states("#Your counter sensor") %}

{% if light_counter == 0 %} disabled
{% else %} amber
{% endif %}
cunning latch
#

@worthy sleet does the entity badge accept templates? I don't think it does.
This does, however, work with the Mushroom Template Badge. This concept can also be applied to the icon, too.

worthy sleet
#

don't think it does

#

tbh i primarily use the mushroom template cause it's way more customizable