Lovelace: Mini Media Player

You’re not alone, there’re a few threads about this.

My Denon AVR with Spotify Connect seems to stay in the source list, but I have the same issue with all my Chromecasts (even after specifying aliases for them).

I gave up and ended up using assistant relay to start Spotify on desired Chromecast / Chromecast group.

Okay you got my attention now @kalkih, I had a look at assistant relay, but I can’t tell;

  1. how you would activate spotify with it? Is it just simply sending the chromecast a spotify link?
  2. If its meant to be run on the HA system or another box?
  3. how does HA interface with the assistant relay?

I hope you can send me in the right direction :slight_smile:

  1. I’m not sure if you are familiar with the google assistant, but you basically feed normal google assistant commands to the assistant relay - “play music on chromecast bathroom”, “play michael jackson from spotify on chromecast kitchen”.

  2. Sure, why not, I personally run it on the same sever. I believe there’s a docker version out there as well, if you prefer that.

  3. I’ve set up a rest notify component that points to the assistant relay api, you can then call the notify service from a script or anywhere really.

notify:
  - name: ga_relay
    platform: rest
    resource: http://assistant-relay-ip:port/assistant
    method: POST_JSON
    message_param_name: command
    data:
      user: xxx

Here’s a similar project, that does pretty much the same thing:

1 Like

NEW RELEASE v1.0.2

Small update in preparation for HA v0.88.0.

I recommend everyone to update to this release, as all the buttons in the card will be broken in HA v0.88.0 otherwise.

Changelog

  • NEW: Added two theme variables

  • NEW: Option columns for shortcut buttons, to specify max amount of buttons per row (#78)

  • FIXED: Buttons to work with HA > v0.88.0 (#82)

  • CHANGE: Removed enforced uppercase for shortcut buttons (#74)

  • CHANGE: Changed color of media info when artwork is set to cover / full-cover

2 Likes

Can I use this card if I use the Lovelace GUI mode? There is no ui-lovelace.yaml file. Have I to create this file? Even if I use the storage lovelace mode?
Yes you can, you just need to add the resource reference to mini-media-player-bundle.js in the auto generated lovelace file stored in /config/storage/lovelace instead of adding it in ui-lovelace.yaml .

Thanks - this took me a while to find (perhaps it could be included in the github readme)

Thanks for your great work on the card

Or you just add it with the Raw config editor in the GUI.2019-02-20_13-22-42 2019-02-20_13-25-31

good to know - thanks

I don’t know if this is the correct thread but i am having problems with the spotify media player as it (in the list of source devices) shows always and only the echo devices, while the sonos one are never present in that list like the chromecast audio… Is this behaviour depending from the media_player.spotify or from the mini-media-player? I read that the devices will appear after they are powered and in fact the echo devices appear to me always on. How to make sonos and chromecast appear always on so they are listed by default in the available source devices?

It has nothing to do with this card, this card simply displays the source list exposed by the component, so it’s backend related.
You could try adding an alias for each device in your Spotify component configuration, as discussed here, didn’t solve the issue for me with my Chromecasts though.

Also, from a few posts ago:

Ok thanks… i’ll give a try to aliases and see if it works… BTW great card !

1 Like

@kalkih Jut wanted to say great work. Fantastic card for Sonos group control Thanks!

1 Like

Thank you @ronschaeffer, glad you like it :slight_smile:

When I start my radio via google home, BACKGROUND, ICON, and TEXT appear in the player.
When I run the same radio through the button, I do not have these things.

Can they also be displayed somehow? Radio is poured from tunein (button url also downloaded from tunein)

artwork: cover
entity: media_player.biuro
shortcuts:
  buttons:
    - id: 'http://217.74.72.11/rmf_fm'
      name: RMF FM
      type: music
    - id: 'https://zt.cdn.eurozet.pl/zet-tun.mp3'
      name: RadioZET
      type: music
    - id: 'https://ch.cdn.eurozet.pl/chi-net.mp3'
      name: ChillZET
      type: music
    - id: >-
        http://www.pldm.ml/radio.php?id=-1&url=http://www.eskago.pl/radio/eska-malopolska-zakopane
      name: Eska
      type: music
  columns: 4
show_source: icon
type: 'custom:mini-media-player'

Thanks for the clarification

The thumbnail and the station name is probably provided by tunein.

The shortcut buttons simply use the media_player.play_media service to start media playback, which grabs the provided url and streams it, the stream itself does most likely not contain any metadata in this case, and is why you don’t see any media information in your cards.

EDIT: if the stream actually contains metadata, it’s possible that it isn’t supported in the cast component through the default media receiver.

can you force a given icon and background (manual) for each radio station

No, not possible.

is it possible to configure it with the new version of lovelace ie from the fronted without working on the yaml?

Yes, check this out

There will be changes in the card regarding the new alexa_media custom component?