I’m redoing my dashboards with the new sections layout, and I’m trying to condense things into a heading card for quick reference. I want to do an if/then statement in yaml to change the color of the temperature icon, but the yaml doesn’t seem to work in the card.
I’ve tested it in the template editor, and the expression works and is able to print out Blue or Green. I know the expression is good, but I don’t know why it’s not working in the heading card.
What am I missing to make it work in the heading card?
type: entity
show_state: true
show_icon: true
entity: sensor.apollo_mtr_1_f58774_dps310_temperature
color: >-
{% if (states('sensor.apollo_mtr_1_f58774_dps310_temperature') | float <= 75)
%}
blue
{% else %}
green
{% endif %}
name: Temperature