I would assume that the custom mini card doesn’t support templates as most lovelace does not support templates.
FYI, searched the Mini Media Player thread for “image:” and couldn’t find an example that employed a template. That thread contains over 2000 posts so there ought to be at least one if the option supported a template. I think the conclusion here is that it doesn’t.
Yeah, I just tried to do the attribute directly with
- type: 'custom:mini-media-player'
entity: media_player.living_room
name: Music
image: {{ state_attr('media_player.living_room', 'entity_picture') }}
speaker_group:
sync_volume: true
platform: sonos
show_group_count: true
expanded: false
entities:
- entity_id: media_player.Living_Room
name: Sonos Play
- entity_id: media_player.Living_Room_2
name: Sonos SL
and it doesn’t let me save, as if there is an issue with the code,
if I do multiline it doesn’t work either, it just quotes it out . so I guess it doesn’t do templates
Thanks for all the help, I hope this helps anyone that is pulling their hair out looking for the same solution
This is because you don’t have the template wrapped in quotes. It think’s it’s an object otherwise. Which is tripping you up. The editors in the UI do not validate your code, they only validate valid yaml. I.e. They don’t check if templates work, they don’t check if your data is correct. They just look at the shape of the yaml.
What helps is to review the custom card’s documentation, and its discussion thread, to learn how it works. This prevents making erroneous assumptions about how it works. The documentation for Mini Media Player doesn’t mention if any of its many options support templates and its associated discussion thread contains no examples of image:
with a template.
Like Petro said, most cards don’t support templates. The standard cards don’t and only a few custom cards do (and when they do it’s usually documented because it’s a special feature).
Hello,
First of all, your lovelace config looks great and I tried to find the homekit add-on card without success. Maybe you could direct me to where I could find it.
Secondly, did you manage to find a solution for the dynamic picture entity?
Thanks.