vaurk
(Robbert)
September 29, 2023, 7:29am
1
Hi!
Use case: I have a Mushroom Media Player card on my dashboard, and I want to display the entity_picture of the media_player entity as the icon on the card. This works fine when I just add a static entity_picture attribute. However, when I try to add an entity_picture_template attribute to the entity, nothing happens. The entity attributes are as follows:
assumed_state: true
device_class: tv
friendly_name: Woonkamer TV
supported_features: 22457
entity_picture_template: >-
{% if state_attr("media_player.woonkamer_tv", "app_id") ==
"nl.uitzendinggemist" %}
https://upload.wikimedia.org/wikipedia/commons/5/59/Npologo.svg
{% elif state_attr("media_player.woonkamer_tv", "app_id") ==
"com.spotify.tv.android" %}
https://upload.wikimedia.org/wikipedia/commons/1/19/Spotify_logo_without_text.svg
{% else %}
https://upload.wikimedia.org/wikipedia/commons/e/e3/Google_TV_Icon.svg
{% endif %}
My question, what am I doing wrong?
Is my template correct?
Is my assumption correct that I should now be able to use entity_picture for this entity and get the correct image?
Does an entity picture template work with mushroom cards at all?
starob
September 29, 2023, 9:52am
2
vaurk
(Robbert)
September 29, 2023, 10:05am
3
Correct, I only shared the media_player entity’s attributes, my bad. Here’s my card:
type: custom:mushroom-media-player-card
use_media_info: true
show_volume_level: false
fill_container: false
media_controls:
- on_off
layout: horizontal
name: TV Woonkamer
entity: media_player.woonkamer_tv
tap_action:
action: navigate
navigation_path: /lovelace-mobiel/tv-woonkamer
hold_action:
action: none
double_tap_action:
action: none
icon_type: entity-picture
starob
September 29, 2023, 2:24pm
4
As you can see in the mushrooms docs there are no options to change the entity picture as far as I can tell. Have a look at the template card. It allows you to build some kind of custom cards that includes pictures.
vaurk
(Robbert)
September 29, 2023, 2:31pm
5
So you mean the entity-picture
value for the icon
attribute of the media card doesn’t support the entity-picture-template
of a media player by design?
Edit by the way: I didn’t choose the template card because I think it doesn’t have the media controls
starob
September 29, 2023, 2:34pm
6
You need to ask author but according to the docs no.