Change state of button card based on a sensor


I build a Dashboard for my media control.
I use the Harmony Hub with activities to control my devices.
It works very well, but what I am missing is to show the current state via a button.

As you can see on my screenshot, I have several buttons which trigger an activity on my harmony hub. For example Spotify.

  - entity: remote.wohnzimmer
    icon: 'mdi:spotify'
    icon_height: 32px
    name: Spotify
    show_icon: true
    show_name: true
      action: call-service
      service: remote.turn_on
        activity: 36772906
        entity_id: remote.wohnzimmer
    theme: Backend-selected
    type: entity-button 

I want to change the color of the button if the activity is active.
I was only able to include the activity in the picture card with a template sensor.

I would be very happy if someone could help me :slight_smile:



custom:button-card or custom:card-mod is your friend, both have their topics on the forum.