I am trying to change the colour of an icon based on its state value. I have it working for another couple of entities when the value is a float or a string but can’t get it working when it’s an integer. At the moment it only shows as black but changes to a colour when I put icon color: green for example. Have check Dev tools and it’s defo an int.
What am I missing?
type: vertical-stack
cards:
- type: custom:mushroom-chips-card
chips:
- type: spacer
- type: entity
entity: sensor.heating_on_manual
icon: mdi:hand-pointing-up
icon_color: |-
{% if states('sensor.heating_on_manual') | int == 0 %}
green
{% elif states('sensor.heating_on_manual') | int <= 3 %}
amber
{% else %}
red
{% endif %}
tap_action:
action: navigate
navigation_path: /dashboard-nspanel/Heating_set_to_manual