You can set a background image.
Thanks, but I’m using artwork: full_cover
and am looking to use substitute album art to maintain the size/shape/look of the card, for example when there is nothing in the queue rather than to have as a full card background.
EDIT: Solution here Lovelace: Mini Media Player - #2771 by ronschaeffer
I think the background only shows if there is no available artwork.
Have you tried it, or should someone come over and do it for you?
I think that even with a background image set, the card returns to its default mini size when the player is powered off or the queue is empty. This makes it smaller than when artwork is set to full-cover
and the player is on.
To keep the card a consistent size, I 've found I have to play around with card-mod
to set the height of the card. You might need to experiment to find the right height - this value keeps the player square in the app on my Pixel 4.
- type: custom:mini-media-player
card_mod:
style:
.: |
ha-card {
height: 385px;
}
artwork: full-cover-fit
Thanks, @nickrout . Perhaps I’m missing a setting, but this is what background:
like for me with no artwork. My goal is to maintain the 1:1 aspect ratio and size when there is no album art.
entity: media_player.dining_room
group: false
hide:
controls: false
icon: true
info: true
mute: true
name: true
power: true
progress: true
source: false
volume: true
info: 'no'
progress: false
tap_action:
action: url
url: app://com.sonos.acr2
type: custom:mini-media-player
volume_stateless: true
artwork: full-cover
background: /local/images/idle_art_1.png
EDIT: Slight revision here Lovelace: Mini Media Player - #2771 by ronschaeffer
@reste_narquois , thanks so much. That’s it.
Here’s what I ended up with as a test card:
type: custom:mini-media-player
entity: media_player.dining_room
card_mod:
style: |
ha-card {
height: 385px;
}
artwork: full-cover-fit
background: /local/images/idle_art_1.png
What are the dimensions of the jpg?
640x640
But, @reste_narquois 's suggestion worked. Would be nice to be able to do it without card_mod
. I’ll raise a feature request.
Thanks!
No, thanks.
It will size to the size of the background image, so make the background image the size of the typical album art. It really is as simple as that. The question was: I want an image displayed when there’s no art, keeping the sizing in tact.
You don’t need card mod. See above.
Source: I’m doing it all, which is why I suggested it in the first place. Just an image, sized correctly.
If you’ve got that working, please post your YAML.
For whatever reason, without card_mod
, the card always collapses when there is no cover art to what I showed here using either full-cover
or full-cover-fit
, and with the image sized to 385x385, 640x640 or 1600x1600.
1600x1600 is what’s recommended for Spotify cover art, so I assume that’s what you mean by typical.
Well, there seems to be at least 2 of us whose experience is different from yours - would be helpful if you posted your code as requested.
I’m doing it for the cover
artwork option. It only transpired later that there’s a requirement for the full-cover
and full-cover-fit
options, and in that case, I don’t see another option. It’s ironic (to me) to make something that was designed to be mini not-so-mini, but to each their own.
Re: Mantaining card aspect ratio when using artwork: full-cover
if no cover art is available or when the target player is idle.
Currently, if there is no cover art available or when the target payer is idle, the card will collapse from the 1:1 ratio of cover art to the minimum size needed to fit any configured control and information elements of the card. For better control over the position of cards on a dashboard, it can be desireable to maintain the same size and shape of the card
If you’re looking to do this, the most consistent way appears to be setting the overall card aspect_ratio
with the custom component card_mod. At least, this has worked for @reste_narquois and me in testing.
Here’s a comparison using a square background image:
And here is the configuration for the rightmost card:
type: custom:mini-media-player
entity: media_player.dining_room
card_mod:
style: |
ha-card {
aspect-ratio: 1 / 1;
}
artwork: full-cover-fit
background: /local/images/idle_grid_dark.png
Note that artwork: full-cover
and artwork: full-cover-fit
have the same result in this case.
Is it possible to get a volume slider for each Sonos speaker in my group?
If I use the volume slider in the top of the card, it only changes the volume for the master speaker (The first speaker I used as entity when the card was created).
I would like to be able to change the volume for each speaker…
Code for the card:
type: custom:mini-media-player
entity: media_player.koekken
hide:
power: true
speaker_group:
platform: sonos
show_group_count: true
entities:
- entity_id: media_player.koekken
name: Sonos Køkken
- entity_id: media_player.stue
name: Sonos Beam Stue
- entity_id: media_player.badevaerelse
name: Sonos Badeværelse
entities:
- type: custom:mini-media-player
entity: media_player.multiroom_player
group: true
source: icon
artwork: cover
info: short
hide:
volume: false
power: true
- type: custom:mini-media-player
entity: media_player.koekken
group: true
hide:
controls: false
- type: custom:mini-media-player
entity: media_player.stue
group: true
hide:
controls: false
- type: custom:mini-media-player
entity: media_player.badevaerelse
group: true
hide:
controls: false
artwork: cover
source: full
sound_mode: full
Quick Question.
How would I change the name of the dropdown list?
> > type: custom:mini-media-player
> > entity: media_player.kitchen_2
> > name: Kitchen Speaker
> > artwork: cover
> > source: full
> > sound_mode: full
> > background: /local/radio/radiobackround.jpg
> > show_tts: true
> > shortcuts:
> > name: Radio
> > columns: 2
> > list:
> > - type: script
> > name: Wild Country Radio
> > id: script.wild_953
> > - type: script
> > name: Amp Hits Radio
> > id: script.amp_radio
> > group: false
> > info: scroll
> > speaker_group:
> > platform: sonos
> > show_group_count: true
> > entities:
> > - entity_id: media_player.kitchen_3
> > name: Sonos Kitchen
> > - entity_id: media_player.sonos_roam_3
> > name: Sonos Bedroom
I’m not sure if you can configure individual volume controls, however you are able to make the main slider control all speakers in the group using sync_volume:
. I know its not what you asked for, but maybe could help your use case?
speaker_group:
platform: sonos
show_group_count: true
sync_volume: true
....
Thanks for the reply!
It’s way better then before, I will implement this and give it a try.
I’m kinda new til HA/YAML, so not that strong with this yet.
Could I make it so the speakers volume slider is always available, and not just under the “grouping” menu? That way I could have a card that I could expand or something, and then change it individual.
Another question regarding this also:
I have tried to create some buttons to start spotify playlists from, but I can’t start the stream to my speakers. I get the same results, when I test in the ‘Developer Tools’ under ‘Services’.
I have tried to stream to both the ‘Køkken’ and ‘Stue’ speakers with no luck.
I use the information in the ‘Name’ field, as I understand i should’n be the ‘Entity ID’.?
type: custom:mini-media-player
entity: media_player.koekken
max_volume: '35'
hide:
power: true
speaker_group:
platform: sonos
show_group_count: true
sync_volume: true
entities:
- entity_id: media_player.koekken
name: Sonos Køkken
- entity_id: media_player.stue
name: Sonos Beam Stue
- entity_id: media_player.badevaerelse
name: Sonos Badeværelse
entities:
- type: custom:mini-media-player
entity: media_player.multiroom_player
group: true
source: icon
artwork: cover
info: short
hide:
volume: false
power: true
- type: custom:mini-media-player
entity: media_player.koekken
group: true
hide:
controls: false
- type: custom:mini-media-player
entity: media_player.stue
group: true
hide:
controls: false
- type: custom:mini-media-player
entity: media_player.badevaerelse
group: true
hide:
controls: false
artwork: cover
source: full
sound_mode: full
icon: mdi:music
background: /local/spotify/radiobackground.jpg
shortcuts:
columns: 3
buttons:
- name: Tessa
type: service
id: spotcast.start
data:
device_name: Køkken
uri: spotify:playlist:3pJK3CUpbnyX7ogDfAwa9J
random_song: true
shuffle: true