Change icon based on timer status for the button card

I’m trying to change the icon when the timer is running or finished through an automation. The automation and the timer run without any issues, but the icon doesn’t change. Does anyone have an idea?

show_name: true
show_icon: true
type: button
entity: input_button.warm_wasser
icon: |
  {% if is_state('timer.wasserpumpe_pause' , 'idle') %}
    mdi:water-pump
  {% else %}
    mdi:water-pump-off
  {% endif %}
show_state: true

The frontend does not support templates. You’ll have to use a custom card that supports it, like custom button card. Keep in mind, custom button card supports JS templates, not jinja templates. But also, custom button card supports state configurations with just yaml, so you really don’t need a template for this with custom button card.

1 Like

“Got me a bit further, but now I’m stuck again. I’m just starting to dive into this. I’d like to check the status of two timers in a card. This is my attempt. Would appreciate any thoughts or suggestions.”

type: custom:button-card
name: Warm wasser
tap_action:
  action: call-service
  service: automation.trigger
  service_data:
    entity_id: automation.umwelzpumpe_manule
trigger_update: '-timer.umwelspumpe -timer.wasserpumpe_pause'
state:
  - operator: template
    value: |
      [[[
        is_state(timer.umwelspumpe, active)
      ]]]
    icon: mdi:water-pump
    color: green
  - operator: template
    value: '{{ is_state("timer.wasserpumpe_pause", "active") }}'
    icon: mdi:water-pump-off
    color: red
  - operator: default
    icon: mdi:water-pump
    color: withe