Lovelace: Mini Media Player

I have a full Sonos setup in my living room and couple of Sonos One’s troughout the house.
To ‘fix’ your problem i made buttons per room to start playing to that individual room.
In this setup you make the first speaker that starts playing the ‘master’ of your complete setup.
If you want to add a speaker, simply group them.
Here you can see that Office is the ‘master’ so i start playing a stream straight to that particular speaker and added the living room speakers afterwards.


office
Ofcourse you can do that the other way around and for every speaker you have in your house.

2 Likes

Thanks for the replay! I am not sure I fully get it just yet. Do you mean that you have a specific media player card for each room or you only have one? Also, on the first photo I see your master speaker that is disabled from removing but on the second everything is clickable. I am not sure how did you archive that? Where are the buttons to play in specific rooms?

If you could share some yaml that would be very helpful!

Yes, every room has it’s own card. You cannot remove by clicking the checkbox because that speaker is not the master. The Office speaker is. In that case you should use the "leave’’ button so you degroup the livingroom. The Office speaker continues in that case.
I mean these buttons:

SLAM!, Radio 538 and Radio 2 are scripts. There scripts start a Sonos Radio station to, in this case, the Living Room speakers.
Use somthing this for your Lovelace card:

shortcuts:
          buttons:
            - data:
                entity_id: script.1560158655836
              icon: 'mdi:radio'
              id: script.turn_on
              name: SLAM!
              type: service
            - data:
                entity_id: script.1560178621235
              icon: 'mdi:radio'
              id: script.turn_on
              name: Radio 538
              type: service
            - data:
                entity_id: script.1560178774058
              icon: 'mdi:radio'
              id: script.turn_on
              name: Radio 2
              type: service

Indentation is a bit off…
(don’t mind the script names i think newly created scripts now have names since 0.113)

For your script you can use something like this:

'1560158655836':
  alias: Sonos SLAM! Living Room
  sequence:
  - data:
      entity_id: media_player.sonos_woonkamer
      volume_level: '0.03'
    service: media_player.volume_set
  - data:
      entity_id: media_player.sonos_woonkamer
      source: SLAM!
    service: media_player.select_source

Make use to add your favorite playlist from Spotify to your favorites in the Sonos app so these will get exposed as a ‘source’ in Home Assistant.

Good luck!

2 Likes

Hey guys, quick question. I’m having issues with the mini media player card not showing album art.
I have this line:

artwork: cover

But it’s not pulling in the album cover. Anyone know whats up there?

HI all, I recently started using IOS theme and very happy with the way it customises all cards with ease, the exception though is Mini Media Player. I have tried playing around with mini-media-player-base-color but it doesn’t seem to have any effect??

The theme has dark and light modes, in dark made MMP is fine but in light mode everything turns white…

Below is an expample but I have about 4 MMP cards and they all do the same…

entity: media_player.googlehome3329
hide:
  controls: true
  info: true
  power: true
  progress: true
icon: 'mdi:google-home'
name: Google Home
tts:
  platform: google
type: 'custom:mini-media-player'

Any ideas??

You don’t say which theme but some theme makers prematurely deprecated one of the variables many custom cards still use. See the release notes (breaking changes last item) for 0.113.0 for details and add the variable back to your theme. If using google-dark theme, the dev has reverted the change…

Thanks David, I will take a look, and it is IOS theme…

as luck would have it I switched to that this week… the ios-dark-mode-blue-red one. It seems ok… did you check for updates?

I just looked and it seems like the latest version. paper-card-background-color: var(–ha-card-background) is in there which apparently is in the breaking changes, so I will play around with it.

Dark mode works fine BTW, just light mode and only with MMP all other cards are fine.

that’s mapping to a valid variable though so should be ok… which specific light theme?

NVM I see it now… I’ll have a lookie…

iOS Light Mode Theme - dark-blue

I’m looking at it now and it states primary-text-color: “#464a47” so I am unsure why MMP is pulling the white text and icon from, possibly from secondary-text-color: “#000000

yeah it’s there…
image
But white text…

Paper-slider-font-color is also #000

FWIW you can search the js for the variables and see if they are used…

Just spotted this is the theme!..

Custom

mcg-title-letter-spacing: .15em
mini-media-player-base-color: white
mini-media-player-icon-color: white

Removed and now all good…

image

I saw that as well… so it’s probably using the default colours now for those? Did you contact the theme dev to see what he thinks about it? He might want to fix the theme?

Yes it’s pulling the defaults now, I may contact the dev later, unsure why he put it in there, maybe it suits his needs.

Thanks for your help

I’m also looking for a similar solution for my Nintendo Switch, where a different background will show on mini media player when the Switch is connected to the TV. I don’t have a solution, but I have a workaround for your Plex option.

I use the Universal Media Player component and link the mini-media player to that. Put your Plex media player at the top of the children list, and your LG WebOS TV at the bottom of the list, and the component is smart enough to display the Plex player (and its artwork) if it is currently playing. It will default back to the LG WebOS TV when Plex stops playing.

1 Like

I love the new 10.0 update that just released! Finally the progress bar is now longer bugged on Safari (I always assumed this was a HA bug). I have one question: is it possible to have the text styling of the new ‘material’ artwork for other artwork styles? I like how the text collr adapts based on the background.

Right now I have the text color set to white with artwork as a full-cover. But with white artwork, the text is unreadable. Is there a way to have adaptable text colors for other art work styles as well?

After the latest update my artwork is not refreshing anymore and i have always the artwork of the first track i played…
What changed ?
EDIT: I think it can depends from the spotify lovelace card… i will ask in that thread…
EDIT2: No, it i think, depends from mini-media-player card… I really have no refreshing or changing about artwork and title track!

Hi,

I try to control a number of radio channels via chortcuts, can’t find what I am doing wrong here.
The channels do switch via the standard pull down menu.

Can someone help me out here ?

radio

artwork: cover
entity: media_player.marantz_nr1510
idle_view: when_idle
info: scroll
max_volume: 100
name: Radio
shortcuts:
  align_text: center
  buttons:
    - id: 'http://icecast.vrtcdn.be/mnm-high.mp3'
      name: MNM
      type: channel
    - id: 'http://playerservices.streamtheworld.com/api/livestream-redirect/JOE.mp3'
      name: JOE
      type: channel
    - id: 'http://playerservices.streamtheworld.com/api/livestream-redirect/JOE.mp3'
      name: 90's
      type: channel
    - id: 'http://icecast.vrtcdn.be/stubru-high.mp3'
      name: Stu Bru
      type: channel
  columns: 4
sound_mode: full
type: 'custom:mini-media-player'
volume_stateless: false

Recent changes have made this card different from every other card in my theme. The volume slider in particular. I managed to get the slider button and active side back to normal by setting this in my theme:

mini-media-player-accent-color: "var(--paper-slider-knob-color)"

However the inactive part of the slider is still different. I don’t seem to be able to find the theme variable to change this:
Screenshot_2020-08-05 Administration - Home Assistant

Normal slider for comparison:

Screenshot_2020-08-05 Overview - Home Assistant

Edit: answering my own question. it seems to be:

mini-media-player-overlay-color:

Screenshot_2020-08-05 Administration - Home Assistant(1)

it would be really nice it this card’s theme options lined up with home assistant’s. Especially considering the new class option coming for card mod 2.0.

1 Like