Lovelace: Mini Media Player

I have installed Music Assistant, Radio Browser and Mini Media Player on my Home Assistant machine, and MPD on my testing Raspberry Pi.

I have setup shortcut buttons for a selection of radio stations, and they are working great … but I note that the device name (“Kitchen”) is showing, and the title of the song that is currently playing … but can I add which radio station is playing (in this case the “Wave FM AAXC” shortcut button) ? A text field in the button definition would be fine.

Separate issue - playlists.

I have been trying to work out how to play a playlist, and have found mentions in the documentation and several examples of spotify playlists, I have not come across any example for a playlist of local files.

I have tried a couple of approaches to play local playlists that work in Music Assistant. Not sure what is relevant here, so trying to dump all the related info…

I have used the HA Storage option to map my _Media network share into the HA /media folder as

And my Mini Media Player Card Configuration is:

type: custom:mini-media-player
entity: media_player.kitchen_2
volume_stateless: false
toggle_power: false
shortcuts:
  columns: 2
  align_text: left
  buttons:
    - name: Il Volo - The Best of 10 Years playlist
      type: playlist
      id: >-
        media-source://media_source/local/_Media/Music/Popera/Il Volo/The Best
        of 10 Years/Il Volo - The Best of 10 Years.m3u
    - name: Il Volo - The Best of 10 Years service
      type: service
      id: media_player.play_media
      data:
        entity_id: media_player.kitchen_2
        media_content_id: >-
          media-source://media_source/local/_Media/Music/Popera/Il Volo/The Best
          of 10 Years/Il Volo - The Best of 10 Years.m3u
        media_content_type: audio/x-mpegurl
    - name: Il Volo - The Best of 10 Years web
      icon: mdi:cat
      type: service
      id: media_player.play_media
      data:
        entity_id: media_player.kitchen_2
        media_content_id: >-
          http://192.168.1.98:8098/media/_Media/Music/Popera/Il Volo/The Best of
          10 Years/Il Volo - The Best of 10 Years.m3u
        media_content_type: audio/x-mpegurl
    - name: Il Volo - Il Mondo
      icon: mdi:music
      type: music
      id: >-
        media-source://media_source/local/_Media/Music/Popera/Il Volo/The Best
        of 10 Years/01-Il Mondo.mp3

Result for all three “best of 10 years” entries is:

In Music Assistant this playlist does show and play the component files proving that the .m3u file is correct.

and the .M3U file contains

#EXTM3U
#EXTINF:261,Il Volo - Il Mondo
01-Il Mondo.mp3
#EXTINF:220,Il Volo - 'O Sole Mio
02-'O Sole Mio.mp3
#EXTINF:243,Il Volo - Surrender (Torna A Surriento)
03-Surrender (Torna A Surriento).mp3
#EXTINF:292,Il Volo - Smile
04-Smile.mp3
#EXTINF:330,Il Volo - Caruso
05-Caruso.mp3
#EXTINF:263,Il Volo - Un Amore Cosi Grande
06-Un Amore Cosi Grande.mp3
#EXTINF:269,Il Volo - Granada
07-Granada.mp3
#EXTINF:235,Il Volo - My Way
08-My Way.mp3
#EXTINF:225,Il Volo - Grande Amore
09-Grande Amore.mp3
#EXTINF:226,Il Volo - Nel Blu, Dipinto Di Blu (Volare)
10-Nel Blu, Dipinto Di Blu (Volare).mp3
#EXTINF:211,Il Volo - Turandot: Nessun Dorma
11-Turandot Nessun Dorma.mp3
#EXTINF:191,Il Volo - La Traviata: Libiamo Ne'lieti Calici
12-La Traviata Libiamo Ne'lieti Calici.mp3

Last but not least, the end of the Music Assistant Log file:

2024-06-21 20:50:59.786 INFO (MainThread) [music_assistant.streams] Start Queue Flow stream for Queue Kitchen - crossfade: False
2024-06-21 20:50:59.802 INFO (MainThread) [music_assistant.streams] Start Queue Flow stream for Queue Kitchen - crossfade: False
2024-06-21 20:51:00.323 INFO (MainThread) [music_assistant.streams] Start Queue Flow stream for Queue Kitchen - crossfade: False
2024-06-21 20:51:21.392 WARNING (MainThread) [music_assistant.player_queues] Skipping http://192.168.1.98:8123/media/local/_Media/Music/Popera/Il%20Volo/The%20Best%20of%2010%20Years/Il%20Volo%20-%20The%20Best%20of%2010%20Years.m3u?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4MTIxMWEzZjM5ZTc0Y2E2OTE4ZDg4NTE5YmVkNmQ1NSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvX01lZGlhL011c2ljL1BvcGVyYS9JbCBWb2xvL1RoZSBCZXN0IG9mIDEwIFllYXJzL0lsIFZvbG8gLSBUaGUgQmVzdCBvZiAxMCBZZWFycy5tM3UiLCJwYXJhbXMiOltdLCJpYXQiOjE3MTg5NjcwODEsImV4cCI6MTcxOTA1MzQ4MX0.wC7ywBZymNKqC4G7pPt384NRVheHuy2Ox5OI2DgecKA: Unable to retrieve info for http://192.168.1.98:8123/media/local/_Media/Music/Popera/Il%20Volo/The%20Best%20of%2010%20Years/Il%20Volo%20-%20The%20Best%20of%2010%20Years.m3u?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4MTIxMWEzZjM5ZTc0Y2E2OTE4ZDg4NTE5YmVkNmQ1NSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvX01lZGlhL011c2ljL1BvcGVyYS9JbCBWb2xvL1RoZSBCZXN0IG9mIDEwIFllYXJzL0lsIFZvbG8gLSBUaGUgQmVzdCBvZiAxMCBZZWFycy5tM3UiLCJwYXJhbXMiOltdLCJpYXQiOjE3MTg5NjcwODEsImV4cCI6MTcxOTA1MzQ4MX0.wC7ywBZymNKqC4G7pPt384NRVheHuy2Ox5OI2DgecKA: Invalid data found when processing input
2024-06-21 20:51:21.392 ERROR (MainThread) [music_assistant.webserver] Error handling message: player_queues/play_media: No playable items found
2024-06-21 21:00:38.825 INFO (MainThread) [music_assistant.music] Sync task for Music Assistant completed
2024-06-21 21:01:18.698 INFO (MainThread) [music_assistant.music] Sync task for Filesystem (remote share) completed
2024-06-21 21:01:18.698 INFO (MainThread) [music_assistant.music] Sync task for RadioBrowser completed
2024-06-21 21:10:54.129 WARNING (MainThread) [music_assistant.player_queues] Skipping /media/_Media/Music/Popera/Il Volo/The Best of 10 Years/Il Volo - The Best of 10 Years.m3u: Unable to retrieve info for /media/_Media/Music/Popera/Il Volo/The Best of 10 Years/Il Volo - The Best of 10 Years.m3u: Invalid data found when processing input
2024-06-21 21:10:54.129 ERROR (MainThread) [music_assistant.webserver] Error handling message: player_queues/play_media: No playable items found
2024-06-21 21:11:05.580 WARNING (MainThread) [music_assistant.player_queues] Skipping http://192.168.1.98:8123/media/local/media/_Media/Music/Popera/Il%20Volo/The%20Best%20of%2010%20Years/Il%20Volo%20-%20The%20Best%20of%2010%20Years.m3u?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4MTIxMWEzZjM5ZTc0Y2E2OTE4ZDg4NTE5YmVkNmQ1NSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvbWVkaWEvX01lZGlhL011c2ljL1BvcGVyYS9JbCBWb2xvL1RoZSBCZXN0IG9mIDEwIFllYXJzL0lsIFZvbG8gLSBUaGUgQmVzdCBvZiAxMCBZZWFycy5tM3UiLCJwYXJhbXMiOltdLCJpYXQiOjE3MTg5NjgyNjUsImV4cCI6MTcxOTA1NDY2NX0.54qn6ueJBqEZO8n9CToqb1WeiPZN_T_z8gKmY49Eqio: Unable to retrieve info for http://192.168.1.98:8123/media/local/media/_Media/Music/Popera/Il%20Volo/The%20Best%20of%2010%20Years/Il%20Volo%20-%20The%20Best%20of%2010%20Years.m3u?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4MTIxMWEzZjM5ZTc0Y2E2OTE4ZDg4NTE5YmVkNmQ1NSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvbWVkaWEvX01lZGlhL011c2ljL1BvcGVyYS9JbCBWb2xvL1RoZSBCZXN0IG9mIDEwIFllYXJzL0lsIFZvbG8gLSBUaGUgQmVzdCBvZiAxMCBZZWFycy5tM3UiLCJwYXJhbXMiOltdLCJpYXQiOjE3MTg5NjgyNjUsImV4cCI6MTcxOTA1NDY2NX0.54qn6ueJBqEZO8n9CToqb1WeiPZN_T_z8gKmY49Eqio: Server returned 404 Not Found
2024-06-21 21:11:05.581 ERROR (MainThread) [music_assistant.webserver] Error handling message: player_queues/play_media: No playable items found

I am open to suggestions of what I have missed here (probably something simple), or even better an example of a button which plays a .m3u playlist.

Noob question: I have a very simple implementation of mini media player:

type: custom:mini-media-player
artwork: none
source: icon
info: short
entity: media_player.denon_avr_x1200w

The issue is that the volume slider for the Denon X1200W is sometimes greyed out in the mini media player. When this occurs, only the mini player slider is greyed out, if I click the player to get access to the full set of AVR controls, the slider is usable. It could be because the AVR is started outside of HA (e.g., by the Denon iPhone control app). Reloading the Denon AVR Network Receivers integration for that device fixes it, but I’m curious whether others have encountered this and whether there is any fix. I noticed the option to replace the slider with buttons and haven’t tried that yet to see if it’s just the slider.

A couple of questions!

  1. Can someone help me understand why the progress bar never shows up for me? It’s there, I can drag it around and that works fine, it’s just not visible on web regardless of browser, or companion app.
    The setup is a little convoluted, it’s a view for the Apple TV, but the Sonos volume element is manually moved in with some wonky CSS, but it works. Progress bar no-show is not related to this, it’s not showing with the most simple fresh card either.

  2. Can I change the jump icons?

type: entities
entities:
  - type: custom:mini-media-player
    entity: media_player.apple_tv
    artwork: material
    name: Sjónvarp
    jump_amount: 10
    hide:
      source: true
      icon: true
      power: true
      jump: false
      next: true
      prev: true
      runtime: true
      volume: true
      progress: false
    card_mod:
      style: |
        ha-card {
          padding-bottom: 40px !important;
        }
        .entity__info__media {  
          font-size: 14pt;  
          font-weight: bold;
        }
        .entity__info__name {
          font-size: 8pt;
          }
  - type: custom:mini-media-player
    entity: media_player.sonos_stofa
    artwork: material
    hide:
      source: true
      name: true
      info: true
      icon: true
      power: true
      runtime: true
      volume: false
      controls: true
    card_mod:
      style: |
        ha-card {
          height: 20px;
          margin-top: -20px;
        }
        .mmp__bg {
          margin-top: -35px;
          margin-bottom: 18px;
          margin-left: 16px;
          margin-right: 20px;
        }
card_mod:
  style: |
    ha-card {
      background: none;
    }

This is you card when added to my dashboard. The progress bar is there, but you do have a odd overlap.

Do you see it when the cards aren’t combined?

Interesting! No I don’t see it no matter how simple the card is. But this tells there’s probably CSS somewhere else that is messing with it so it’s definitely helpful!

Does an apple tv show a progress bar on a normal media card?

Yes it does.

1 Like

Which HA theme are you using? Try setting it to the default.

I have no Lovelace theme enabled.

I really like this card, i like the format with the dog, cat buttons. I currently use Spotify and have google speakers throughout the house. I have 3 groupings of them. Can i make it so that the buttons allow me to swap speaker groupings?

For instance let’s say i hit play, i want it to play on my ‘main floor group’ and then if i want to change to ‘whole house’ or ‘whole house and outside’

Did you ever find a solution for this? even with another player?
I am thinking of just figuring out how to make each button tell google to “move to speaker group” because you can say it to google assistant.

I would like to use this but would like to stream the music from the computer that is running HA.
What media player do I setup on the host OS for HA and how do I select this media player in the mini media player?
any instructions for this?

Hello everyone,
first of all, thank you very much :slight_smile: I have not yet managed to make the control elements (play, pause etc.) and the volume slider larger. Card Mod is installed. Also with ChatGPT I did not manage it. Does anyone have a solution? :slight_smile:

Many thanks in advance
inseljohn

Anyone got an idea how to solve the disapperaing name of the media player that is selected?


Looks like a caching issue.

Do you mean via speakers physically attracted to the ha machine? If so, install squeezelite. There is an addon.

These are all Spotify players on devices. Like a phone, AppleTV and a laptop.

Then they are the media players.

That’s what I stated. Problem is the name is vanishing as soon it is selected. Music is playing through the selected media player tough.