Lovelace: Mini Media Player

This is the location

Is it better to use configuration.yaml or lovelace to do my settings?

Lovelace and configuration.yaml are 2 totally different things for totally different uses


2 Likes

@kalkih why not submit this great card to the home assistant repos? :heart:

3 Likes

Would I be right in saying that if you are using storage for Lovelace and not the yaml that I could not use this custom mini media player?

You’ve not followed the instructions correctly, you’ve downloaded the source and not the release.
Please go through the instructions again.

With the release of v1.0.0, I feel like this would be the next step.

No, you can use custom cards in storage mode as well, I just don’t cover the setup process in my instructions.

Check this post

1 Like

Hi, i’ve updated to the last version 1.0.1
now i’m bit confused about the tts config, this is my config :

    entities:
  - entity: media_player.beoplay_m5
    group: true
    icon: 'mdi:speaker-wireless'
    power_color: true
    show_progress: true
    show_source: true
    type: 'custom:mini-media-player'
  - entity: media_player.google_home
    group: true
    icon: 'mdi:google-home'
    power_color: true
    show_progress: true
    show_source: true
    show_tts: google
    type: 'custom:mini-media-player'
  - entity: media_player.google_home_mini
    group: true
    hide_controls: false
    icon: 'mdi:dots-horizontal-circle'
    power_color: true
    show_progress: true
    show_source: true
    show_tts: google
    type: 'custom:mini-media-player'
  - entity: media_player.chromecastsalotto
    group: true
    icon: 'mdi:google-chrome'
    power_color: true
    show_progress: true
    show_source: true
    type: 'custom:mini-media-player'
  - entity: media_player.chromecast_soggiorno
    group: true
    icon: 'mdi:google-chrome'
    power_color: true
    show_progress: true
    show_source: true
    type: 'custom:mini-media-player'
show_header_toggle: false
title: Media Players
type: entities

i’ve to change anything?

Thank you for this card; fantastic!

I’m trying to get the shortcuts to work for a streaming radio station. I pulled the url (id) from the entity.attribute.media_content_id listed in the HA interface. This isn’t working. Can anyone help? Specifically looking at CBC Radio 1 Toronto:

  - type: custom:mini-media-player
    entity: media_player.office
    group: true
    artwork: full-cover
    source: icon
    info: short
    shortcuts:
      buttons:
        - name: CBC
          icon: mdi:heart
          type: music
          id: http://cbc_r1_tor.akacast.akamaistream.net/7/632/451661/v1/rc.akacast.akamaistream.net/cbc_r1_tor

Yes, I’ve updated your configuration to work with the new options, see below.

To summarise the changes relevant to your setup, show_source, show_progress and power_color were moved into the hide object and there renamed to source, progress & power_state. source and progress are visible by default and power_state is hidden.
The tts option now takes an object, to enable the addition of the new optional tts options such as language and target entity.

- type: entities
  show_header_toggle: false
  title: Media Players
  entities:
    - type: 'custom:mini-media-player'
      entity: media_player.beoplay_m5
      group: true
      icon: 'mdi:speaker-wireless'
      hide:
        power_state: false
    - type: 'custom:mini-media-player'
      entity: media_player.google_home
      group: true
      icon: 'mdi:google-home'
      hide:
        power_state: false
      tts:
        platform: google
    - type: 'custom:mini-media-player'
      entity: media_player.google_home_mini
      group: true
      icon: 'mdi:dots-horizontal-circle'
      hide:
        power_state: false
      tts:
        platform: google
    - type: 'custom:mini-media-player'
      entity: media_player.chromecastsalotto
      group: true
      icon: 'mdi:google-chrome'
      hide:
        power_state: false
    - type: 'custom:mini-media-player'
      entity: media_player.chromecast_soggiorno
      group: true
      icon: 'mdi:google-chrome'
      hide:
        power_state: false

Thank you, your configuration looks alright, what is the platform of the media player? Also do you get any errors?

Thanks for the link and information. Worked like a charm

1 Like

Hi !
The “full-cover” artwork option actually does not display the entire cover in case of vertical artworks (movie posters for instance). See example below:
Capture%20d%E2%80%99%C3%A9cran%20(16)

So I tried “full-cover-fit” option, which works great in this case. see screenshot below:
Capture%20d%E2%80%99%C3%A9cran%20(17)

However, when the artwork is in ‘landscape’, the ‘full-cover-fit’ options adds black margins on top and bottom of the image :
Capture%20d%E2%80%99%C3%A9cran%20(18)

So, is there a way to have a fit-to-width option or something similar ?

Thanks !

thanks :slight_smile:

The media player is a Google Chromecast Audio.

Right now the card looks for the media_content_type, if it’s music the card assumes the artwork is a perfect square 1:1 (album cover). If it’s video the artwork expects a thumbnail in 16:9 format and resizes the card accordingly.
This behaviour is very similar to the default media-control card.

full-cover-fit always displays in a square but instead of cropping the artwork it will resize it to fit and then display black bars if the aspect ratio isn’t 1:1.

I don’t think I’ll add any more artwork parameters, but I’m open to consider pull requests.

Just tried on one of my own CCAs and it worked, took a good 10-15sec for it to start playing though.

You’re correct
 clearly I was just being impatient!

Thanks

seems I found a bug with the sync_volume options for the Sonos Group
evenif I have not grouped my Sonos Player the volume will be synced across both players (see video)

I get also two error messages in my log

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 241, in _step
result = coro.throw(exc)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/service.py”, line 289, in _handle_service_platform_call
await func(entity, data)
File “/usr/lib/python3.5/asyncio/futures.py”, line 380, in iter
yield self # This tells Task to wait for completion.
File “/usr/lib/python3.5/asyncio/tasks.py”, line 304, in _wakeup
future.result()
File “/usr/lib/python3.5/asyncio/futures.py”, line 293, in result
raise self._exception
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/media_player/init.py”, line 515, in set_volume_level
raise NotImplementedError()
NotImplementedError

and

Not passing an entity ID to a service to target all entities is deprecated. Use instead: entity_id: “all”

Okay, interesting!
I’ve no Sonos myself so I’m not able to test the Sonos specific features very well unfortunately.

Next time you have this bug (or if it’s present all the time), please send me the attributes of both Sonos entities.
You can find the attributes by opening the sidebar and pressing the < > icon at the bottom, or navigate to /dev-state

The errors you posted are most likely related to this bug.

Thanks!

Attributes from the master player:

shuffle: false
sonos_group: media_player.schlafzimmer
supported_features: 64063
media_content_type: music
volume_level: 0.2
source_list: B5 aktuell,ego FM,PULS,Superfly FM
friendly_name: Schlafzimmer
entity_picture: /api/media_player_proxy/media_player.schlafzimmer?token=fc9a990b7b815d96a423b762c3a5bf45a832357d25dea9c3d8457330f3da75a5&cache=bef7ea045c969302
source: Superfly FM
is_volume_muted: false
media_title: Superfly FM
media_artist:

Attributes from the second player:

shuffle: false
sonos_group: media_player.bad
supported_features: 64063
media_content_type: music
volume_level: 0.13
source_list: B5 aktuell,ego FM,PULS,Superfly FM
friendly_name: Bad
entity_picture: /api/media_player_proxy/media_player.bad?token=61c77b9d8b325ae63561a9c872b5b881defa4cb412b030cdab9b1050b62f7252&cache=078729dbdf6a88fe
source: Superfly FM
is_volume_muted: false
media_title: Superfly FM
media_artist:

when ever I can help to test please let me know

1 Like

Thanks, I’ll see if I can find the bug, I’ll let you know when/if I need help testing, thanks a lot!

BTW, I did open an issue#72 on github for tracking this.

great. thank you