Lovelace: Mini Media Player

Yes, you would simply put the media_content_id as the url.

So like this:

media_buttons:
  - name: Whatever name you want
    type: playlist
    url: 2

Is your card usable with css styles, colors and so on? I mean is the card moddable just like the custom modder-card does?

I’m not really sure what you mean. CSS is used to style the card and yes, you can use card-modder to add your own CSS declarations

As for colors, most elements of the card change color based on the color variables set in your theme.

So adding a theme to the view, the cards of mini-media-player will change accordingly?

@kalkih It will be great if you can submit this to the official repo. This has been adequately tested and seems to be a popular card.

Two questions:

  1. if i set type as music, can i add an URI related to an artist instead a track? And what about album?
  2. Is it possible to set more than one media_player.spotify card to divide the URI related to type of music? I mean, one card for Blues, one for Jazz and so on?

Yes, if I got some time over during the holiday I’ll try to get it done.
Or if anyone else wanna take a stab at it, they are very welcome to do so.

I don’t know, you’ll have to try, If it’s possible to achieve through the media_player.play_media service on the platform you use, it will work through the card.

Sure, why not?

Already tried, not working
 actually it works only for playlists and tracks
 no artists and no albums
 It’s a pity


I just tried and it actually does work for both albums and artists.

media_buttons:
  - name: Album
    type: playlist
    url: spotify:album:1qsQOC4Jn0fnaUZLAbs4dz
  - name: Artist
    type: playlist
    url: spotify:artist:15UsOTVnJzReFVN1VCnxy4

Ah, yes, i was wrong putting ‘music’ as type
 GREAT!!!
I tried also to set more than one card and it was working
 only little problem is the same full-cover showing to both the cards. How to avoid this, but always have the full-cover option set to both the cards?

Not possible, if you set full-cover it will render the artwork in full-cover if artwork exists, as it should?

Yes it is how it’s working now
 maybe i was not clear
 here it is an actual screenshot of my spotify media player:

As you see both cards show the same cover also if i choose a playlist from only one card

What i’d like to see is the full cover only in the card i am actually using


As I said, It’s not possible, both cards are the same media player, they contain and will display the same information.

I think you would be better off by using one mini-media-player and an arrangement of Entity button cards to call the media_player.play_media service.

Hmmm
 sorry don’t understand what you mean
 i don’t want to not use your mini media player

How to use entity button to call a playlist into spotify?

Yes and no. While card-modder does work, it only attempts to style the very base element that creates the card ha-card. As there are more and more elements with the media player, so things may not work as intended when trying to style. I found this out earlier on. See here.

You will just have to experiement and see what works and what doesn’t.

Hey, trying to get the buttons to work, but nothing happens and it throws:

Error on play_media with UPnP Error 714 received: Illegal MIME-Type from 192.168.x.x

Any ideas on why this happens? Play and pause in the controller works like a charm, just not the button
Code is:

  - type: 'custom:mini-media-player'
    entity: media_player.sonos_kontor
    name: Spotify Player
    artwork: cover
    show_source: full
    media_buttons:
      - name: Test
        type: playlist
        url: 'spotify:user:username:playlist:36nJCbrozVo9J3ulxsInE2'

Looks like you are trying this on a Sonos?
The URI is component dependant and a Spotify URI will only work through the Spotify component.

Hey @kalkih one question. Your Github repo says that whenever you reuse things like media_list, media_buttons or sonos_grouping you can put them in an external .yaml-file. Since HASS 0.84 I’ve switched to the new storage-mode to manage lovelace-ui but for this reason I think I can no longer import external yaml-files


This media_player


  - icon: 'mdi:speaker-wireless'
    toggle_power: false
    artwork: full-cover-fit
    show_shuffle: false
    media_buttons: !include bosepresets.yaml
    name: Bose Room2
    show_source: true
    hide_volume: false
    entity: media_player.soundtouch_room2
    group: true
    type: 'custom:mini-media-player'
    power_color: true


 I’ve tried to include the following bosepresets.yaml:

- type: playlist
  name: Deepmix Moscow
  url: 1
- type: playlist
  name: Low-Fidelity
  url: 2
- type: playlist
  name: SomaFM Covers
  url: 3
- type: playlist
  name: Sunday Soul
  url: 4
- type: playlist
  name: Mix der Woche
  url: 5
- type: playlist
  name: Autobahn bei Nacht
  url: 6

But it does not work. Am I missing something?

1 Like

That seems to be the thing I’ve read since posting this as well
 But I can run it as a Spotify component and use Sonos as the location?