I want to show a picture that is derived from an atribute of a media_player. Is there a way to dynamically change the entity_picture in a custom buitton card to that of this dynamic attribute ( entity_picture attribute of my media_player changes based on the content watched).
hi, the media artwork image is kept in the media player attributes. You can find this in ‘Developer Tools’ → ‘Template’ and enter this in the Editor
{{ state_attr('media_player.kitchen', 'entity_picture') }}
(Note change the media player to your entity)
The result will be the path/token to the image. I tried to enter the above into a picture card but the card will not accept yaml code. It does work in a mushroom template card (in the picture section).
Note if you copy / paste the result (of the above code) into a picture card, it does return the correct image. But, that image path is static and doesnt change when the media source changes.
I’m sure the experts will be able to chime in to help.
Folks, keep in mind they said:
This uses JavaScript, not Jinja.
I ended up just using custom:mini-media-player that has a cover bg.