Trying to change the icon colour on a custom mushroom chips chip

I have a custom mushroom chips card, and I’m trying to show the current temperature in the chip (which works), but change the icon colour depending on whether the heat is on or not (the states are ‘heat’ and ‘off’). I’ve used similar code elsewhere, but this one stubbornly stays white.

  - type: entity
    entity: sensor.master_bedroom_temperature
    icon_color: |-
      {% if is_state('climate.master_bedroom', 'heat') %}
        orange
      {% else %}
        blue
      {% endif %}

Any help appreciated

Here you can find info about styling mushroom cards.
You will need CardMod installed.
url: Mushroom Cards Card Mod Styling/Config Guide

Best regards.

1 Like

@IgorZg @bodger , in this case card mod is not technically required. Could just use a template chip instead of the entity chip :slight_smile:
SmartSelect_20231107_183714_Home Assistant

type: custom:mushroom-chips-card
chips:
  - type: entity
    entity: sensor.bedroom_temperature_humidity_temperature
    icon_color: |-
      {% if is_state('climate.master_bedroom', 'heat') %}
        orange
      {% else %}
        blue
      {% endif %}
  - type: template
    icon: mdi:thermometer
    entity: sensor.bedroom_temperature_humidity_temperature
    content: |-
      {{states(config.entity)}} °C
    icon_color: |-
      {% if is_state('climate.bedroom_heating', 'heat') %}
        orange
      {% else %}
        blue
      {% endif %}

But if you wanted to do anything fancier like change the background color of the chip, then youll definitely need card mod :slight_smile: