Lovelace: Mini Media Player

haha oops… I gotta fix that.

Hi I read through the documentation and some of this thread and havent found the answer, I apologize if its been asked, pretty long thread:)

I have an nvidia shield and I use sonos for the audio, is it possible to just use one mini media player card and have the volume control sonos rather than the shields volume?

Thank you.

Hello!
Yes, that’s a perfect use case for a Universal Media Player, create one (with the volume mapped to the sonos entity) and use that entity in a mini media player card.

1 Like

THats awesome, perfect!! Thanks!

hope someone can help me out here?

Great plugin there ! love the minimalist look.

Is it possible to have the cover and or info on what’s playing on my plex or Netflix ? Using it with Nvidia Shield and adb server, love the fact that I can call Apps directly (Netflix from Plex directly without having to come back to the main menu etc…)

Here’s my yaml so far

entity: media_player.nvidia_shield
type: ‘custom:mini-media-player’
artwork: cover
hide:
volume: false
source: false
power_state: false
info: false

Fantastic card !

I wouuld just love to change the layout of the entity info. First of all moving the text to the upper level of the card. How do I do that?

Hello everyone,
I recently started using HA and this card (congratulations @kalkih). I have searched the thread but I have not found the answer to my question: is it possible to hide the volume and play/stop controls at runtime? This is because with an AV receiver I would like to show the controls only if the selected source provides them. Thanks to anyone who can answer me.

Hi there any chance a quick guide to recreate this for a novice. How to make it and what code you have used please?

Here is my lovelace card code:

cards:
  - cards:
      - entity: media_player.sonos_woonkamer
        hide:
          controls: true
          icon: true
          info: true
          max_volume: 50
          min_volume: 0
          name: hide
          play_pause: true
          power: true
          progress: true
          source: true
        type: 'custom:mini-media-player'
      - entity: media_player.sonos_woonkamer
        hide:
          controls: true
          name: true
          play_pause: true
          power: true
          progress: true
          source: true
          volume: true
        info: scroll
        tap_action:
          action: none
        type: 'custom:mini-media-player'
        volume_stateless: true
      - entity: media_player.sonos_woonkamer
        hide:
          icon: true
          info: true
          mute: true
          power: true
          source: true
          volume: true
        mini-media-player-progress-height: 1px
        progress: true
        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
            - data:
                entity_id: script.1586775207572
              icon: 'mdi:television-classic'
              id: script.turn_on
              name: TV
              type: service
            - data:
                entity_id: script.scripts_music_turn_on
              icon: 'mdi:music'
              id: script.turn_on
              name: Music
              type: service
            - data:
                entity_id: script.scripts_power_off
              icon: 'mdi:power-standby'
              id: script.turn_on
              name: Turn OFF
              type: service
          columns: 3
        show_group_count: true
        show_progress: true
        speaker_group:
          entities:
            - entity_id: media_player.sonos_kantoor
              name: Sonos Kantoor
            - entity_id: media_player.sonos_badkamer
              name: Sonos Badkamer
          expanded: true
          platform: sonos
        tap_action:
          action: none
        type: 'custom:mini-media-player'
        volume_stateless: true
    type: vertical-stack
mode: vertical
style: |
  :host {
    font-variant: small-caps;
    background-repeat: no-repeat;
    background-color: rgba(50,50,50,0.3);
    background-size: 100% 68px;
    border-radius: 10px;
    }
    .card-header {
    font-size: 20px;
    }
type: 'custom:stack-in-card'

Please note you have to install: mini-media-player and stack-in-card in order to get this to work.

Hope it helps!

Thank you for that, I have now installed mini-media-player.
and can get code this like to work.

type: custom:mini-media-player
entity: media_player.echo_show
icon: mdi:spotify
artwork: cover
hide:
volume: true
source: true
power_state: false

however i would like to get the buttons that you had for the different radio stations.
I’ve tried creating scripts but that doesn’t seem to work for me. I’ve created an example automation
entity_id: media_player.echo_show
media_content_id: Pink
media_content_type: AMAZON_MUSIC

which i still can not seem to get a button to appear on the mini-media player to run this.

Any help would be great…
Thanks

If you manually call the service to play the music on the Echo or call the script manually, does that work?
I have no experience with Echo devices tbh

this automation runs and works
data:
media_content_id: Pink
media_content_type: AMAZON_MUSIC
entity_id: media_player.echo_show
service: media_player.play_media.

1 Like

I can now get it working as a script. So trying to get the card to show a button. I would of though with this code i would get a button with a cat icon appearing that if i pressed would run the script. Am i understanding that correctly?
Thanks for all your help

entity: media_player.echo_show
type: ‘custom:mini-media-player’
artwork: cover
source: icon
hide: null
volume: true
shortcuts: null
columns: 4
buttons:

  • icon: ‘mdi:cat’
    type: script
    id: script.1588074209892

Please make sure to format your text so it’d readable.
Simply create a script or call the automation to run when you press the button.
For example:

shortcuts:
  buttons:
    - data:
        entity_id: automation.yourautomation
       icon: 'mdi:radio'
       id: automation.trigger
       name: SLAM!
       type: service

I must be doing something wrong, but have managed to get two buttons appearing with this code.

entity: media_player.echo_show
type: ‘custom:mini-media-player’
artwork: cover
source: icon
hide: null
volume: true
columns: 4
shortcuts:
buttons:
- data: null
- icon: ‘mdi:cat’
type: script
id: script.1588074209892

I have these two card inside a custom stack-in-card.

How to make also the mini-media-player card transparent as the first?

Actually this is my styling code:

                - type: custom:mini-media-player
                  style: |
                    ha-card {
                      border-radius: 22px 22px 0px 0px;
                      font-size: 22px;
                      overflow: hidden;
                      position: relative;
                    }
                    ha-card::before {
                      content: '';
                      position: absolute;
                      height: 100%;
                      width: 100%;
                      top: 0;
                      opacity: .05;
                    }
                    .card-content {
                      padding: 8px;
                    }
                    .card-content > div {
                      margin: 0 !important;
                    }
1 Like

I’m using mini media player v.1.7.0 with Mopidy/MPD but I can’t see the correct values of media runtime indicators and progresss bar.
This is a picture of progress bar in the card:


I control also the attributes of mpd media player in home assistant and this is a screenshot of time related attributes:
screenshot.214
As you can see there are the updated values of duration and position but there are not into mini media player card.
How can I solve it?

I’ve seen other people report the same issue, the media_position looks strange “129:309”, it’s not a number and will not be parsed correctly, hence the NaN (not a number) in the card. Not sure if this is a new change in HA or just a bug.

I’ve set up my Sonos speakers now with the buttons for playing radio stations and spotify playlists (by Sonos favorites). Is there a possibility to have the “Shuffle” option available just like in the Sonos app? So I can shuffle my playlists instead of just playing?

Thanks in advance!