Auto hide of show cards

I have a card of type: horizontal-stack where the text of the radio station (the song currently playing) is scrolling. :slight_smile:
I want the card (the scroll) to only be displayed if the “source” attribute value is “HEOS Music”.
It currently works when the radio status is “playing”, but I now want it to work based on the “source” value.
This is my working code right now:

type: conditional
conditions:
  - condition: state
    entity: media_player.denon_zone2
    state: playing
card:
  type: horizontal-stack
  cards:
    - show_name: true
      type: custom:button-card
      .....
      .....

I can’t get it to work, even with this code:

conditions:
  - condition: state
    entity:  media_player.denon_zone2
    attribute: source
    state: HEOS Music

of this

conditions:
  - condition: template
    value_template: "{{ states('media_player.denon_zone2.attributes.source') == 'HEOS Music' }}"


Snippet current state developer tools

Checking the documentation attributes are not supported. You would be able to make a template helper entity to expose the source to a sensor and then use that in the conditional card.

type: conditional
conditions:
  - condition: template
    value_template: "{{ state_attr('media_player.denon_zone2', 'source') == 'HEOS Music' }}"

Template condition is not a thing in frontend. Need to make an entity, as was previously said.