Hi, I want the small badge icon to change its color, depending on the data.
This should work, but doesnt:
type: custom:mushroom-template-badge
entity: sensor.humidity
name: Humidity
icon: mdi:water-percent
icon_color: >
{% set h = states('sensor.humidity') | float(0) %}
{% if h < 30 %}
blue
{% elif h < 50 %}
green
{% elif h < 60 %}
orange
{% else %}
red
{% endif %}