Media Player Card - entity_picture bzw. Media Cover wie einbinden?

Hi, ich habe mir am Wochenende eine Media-Player Card zusammengebastelt und sie funktioniert soweit einwandfrei. Die Karte soll mehrfach für meine ganzen Echos zum Einsatz kommen. Man kann zwischen Lautstärke und Player Tasten wechseln, sieht was aktuell gespielt wird und kann über Vorauswahlbutton gewisse Radiostationen anwählen. Für die Button nutze ein Script, was auf dem entsprechendem Echo den Radiosender startet (könnte man sicherlich auch für spotify nutzen).

Mein Problem ist das Media Cover Bild oder entity_picture
Wie kann ich immer das aktuelle Bild anzeigen?

entity_picture: https://cdn-profiles.tunein.com/s8715/images/logog.png?t=636698665510930000

Screenshot 2024-12-09 184553
Screenshot 2024-12-09 184525
Screenshot 2024-12-09 184459

Hier mein code zur Card:

type: custom:vertical-stack-in-card
cards:
  - type: horizontal-stack
    cards:
      - type: custom:vertical-stack-in-card
        card_mod:
          style: |
            ha-card {
              background: transparent !important;
              border: 0px !important;
              border-radius: none !important;
              box-shadow: none !important;
            }
        cards:
          - type: horizontal-stack
            cards:
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: playing
                card:
                  type: picture-elements
                  image: >-
                    api/media_player_proxy/media_player.wohnzimmer?token=afb95c22d749baf1a014b39adce82d9d8d1d139bf15ee2cec8e620d4e6f116f1&cache=ddbb7504c72f5690
                  elements: []
                  card_mod:
                    style: |
                      ha-card {
                        background: transparent !important;
                        border: 0px !important;
                        border-radius: none !important;
                        box-shadow: none;
                        padding: 15px;
                        width: 60%;
                        height: 60%;
                      } 
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: paused
                card:
                  type: markdown
                  content: |
                    ## Echo Show Gruppe Wohnzimmer (Pause)
                  card_mod:
                    style: |
                      ha-card {
                        background: transparent !important;
                        border: 0px !important;
                        border-radius: none !important;
                        box-shadow: none;
                        padding: 15px;
                      }
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: idle
                card:
                  type: markdown
                  content: |
                    ## Echo Show Gruppe Wohnzimmer
                  card_mod:
                    style: |
                      ha-card {
                        background: transparent !important;
                        border: 0px !important;
                        border-radius: none !important;
                        box-shadow: none;
                      }
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: "off"
                card:
                  type: markdown
                  content: |
                    ## Echo Show Gruppe Wohnzimmer (Ausgeschaltet)
                  card_mod:
                    style: |
                      ha-card {
                        background: none;
                        border: none;
                        border-radius: none;
                        box-shadow: none;
                        padding: 20px;
                      }
      - type: picture
        image: /local/bilder/echogruppe.png
        aspect_ratio: 1/1
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
              border-radius: none;
              box-shadow: none;
              width: 150px;
              height: 150px;
              margin-left: auto;
  - type: custom:vertical-stack-in-card
    card_mod:
      style: |
        ha-card {
          border: none;
          border-top-right-radius: 0px !important;          
          border-top-left-radius: 0px !important;
        }
    cards:
      - type: custom:mushroom-media-player-card
        entity: media_player.wohnzimmer
        media_controls:
          - play_pause_stop
          - next
          - previous
        volume_controls:
          - volume_mute
          - volume_buttons
          - volume_set
        show_volume_level: true
        collapsible_controls: false
        use_media_info: true
        icon: mdi:cast-audio
        card_mod:
          style: |
            ha-card {
              background: none;
              box-shadow: none;
            }
      - type: custom:mushroom-chips-card
        card_mod:
          style: |
            ha-card {
              margin-bottom: 8px !important; 
            }
        alignment: center
        chips:
          - type: entity
            entity: script.bb_radio_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: BB Radio
          - type: entity
            entity: script.radio_fritz_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: Fritz
          - type: entity
            entity: script.bb_radio_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: Radio 1
          - type: entity
            entity: script.radio_berliner_rundfunk_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: 91,4

Ich habe auch schon einen Sensor angelegt um den Link vom Foto darin abzuspeichern und abrufen zu können, da sich der Link eh immer wieder dynamisch ändert, je nach dem was halt abgespielt wird.

- sensors:
    media_cover_img:
      friendly_name: "Media Cover Image"
      value_template: "{{ state_attr('media_player.echo_show', 'entity_picture') }}"

Wie kann ich jetzt das Bild aus dem gespeichertem Link einbinden? Ich bekomme es einfach nicht hin. Selbst eine einfach Picture Card ruft das Bild nicht wie gewünscht ab. Oder gibt es eine viel einfachere Lösung? Würde mich sehr über Hilfe freuen, danke.

Grüße Jayson

Schau mal hier vielleicht ist das ja was für dich - oder du kannst teile des Codes verwenden.

1 „Gefällt mir“

Super, danke schön. Habe die Lösung darin gefunden.

type: custom:button-card
entity: media_player.wohnzimmer
show_state: false
show_name: false
show_icon: false
show_entity_picture: true
size: 120px
card_mod:
  style: |
    ha-card {
      background: transparent !important;
      border: 0px !important;
      border-radius: 0px !important;
      box-shadow: none !important;
      margin-top: 8px !important;
    }

Hier die funktionierende Variante… Jetzt wird das Cover auch links eingebunden. So gefällt es mir. :slight_smile:

type: custom:vertical-stack-in-card
cards:
  - type: horizontal-stack
    cards:
      - type: custom:vertical-stack-in-card
        card_mod:
          style: |
            ha-card {
              background: transparent !important;
              border: 0px !important;
              border-radius: none !important;
              box-shadow: none !important;
            }
        cards:
          - type: horizontal-stack
            cards:
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: playing
                card:
                  type: custom:button-card
                  entity: media_player.wohnzimmer
                  show_state: false
                  show_name: false
                  show_icon: false
                  show_entity_picture: true
                  size: 120px
                  card_mod:
                    style: |
                      ha-card {
                        background: transparent !important;
                        border: 0px !important;
                        border-radius: 0px !important;
                        padding: 15px !important;
                      }
                      #img-cell {
                        display: flex !important;
                        align-items: flex-start !important;
                        justify-content: flex-start !important;
                        margin: 0 !important;
                      }
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: paused
                card:
                  type: markdown
                  content: |
                    ## Echo Gruppe Wohnzimmer (Pause)
                  card_mod:
                    style: |
                      ha-card {
                        background: transparent !important;
                        border: 0px !important;
                        border-radius: none !important;
                        box-shadow: none;
                        padding: 15px;
                      }
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: idle
                card:
                  type: markdown
                  content: |
                    ## Echo Gruppe Wohnzimmer
                  card_mod:
                    style: |
                      ha-card {
                        background: transparent !important;
                        border: 0px !important;
                        border-radius: none !important;
                        box-shadow: none;
                      }
              - type: conditional
                conditions:
                  - entity: media_player.wohnzimmer
                    state: "off"
                card:
                  type: markdown
                  content: |
                    ## Echo Gruppe Wohnzimmer (Ausgeschaltet)
                  card_mod:
                    style: |
                      ha-card {
                        background: none;
                        border: none;
                        border-radius: none;
                        box-shadow: none;
                        padding: 20px;
                      }
      - type: picture
        image: /local/bilder/echogruppe.png
        aspect_ratio: 1/1
        card_mod:
          style: |
            ha-card {
              background: none;
              border: none;
              border-radius: none;
              box-shadow: none;
              width: 150px;
              height: 150px;
              margin-left: auto;
  - type: custom:vertical-stack-in-card
    card_mod:
      style: |
        ha-card {
          border: none;
          border-top-right-radius: 0px !important;          
          border-top-left-radius: 0px !important;
        }
    cards:
      - type: custom:mushroom-media-player-card
        entity: media_player.wohnzimmer
        media_controls:
          - play_pause_stop
          - next
          - previous
        volume_controls:
          - volume_mute
          - volume_buttons
          - volume_set
        show_volume_level: true
        collapsible_controls: false
        use_media_info: true
        icon: mdi:cast-audio
        card_mod:
          style: |
            ha-card {
              background: none;
              box-shadow: none;
            }
      - type: custom:mushroom-chips-card
        card_mod:
          style: |
            ha-card {
              margin-bottom: 8px !important; 
            }
        alignment: center
        chips:
          - type: entity
            entity: script.bb_radio_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: BB Radio
          - type: entity
            entity: script.radio_fritz_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: Fritz
          - type: entity
            entity: script.bb_radio_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: Radio 1
          - type: entity
            entity: script.radio_berliner_rundfunk_skript_fur_echo_wohnzimmer_gruppe
            tap_action:
              action: toggle
            content_info: name
            name: 91,4


1 „Gefällt mir“