Lovelace: Mini Media Player

Ok here’s the deal…
Ill asked this before but it seems support
Didn’t pick it up…
Ill try again :grinning:

I wanted to add an simple stream url.

Bla.bla.listen.pls

But i could not get it working
Im using scripts for other valid streams…
But they ain’t use the.pls file
Any help is appreciated
Ty…

Hi everybody!

I have been out of the world last year, and i just recovered my Home Assistant installation.

I am aware that Android TV integration has changed last year. Regarding this, as far as i remember, when i used media player lovelace card it showed the name of the movie / video / content i was playing on TV, and it displayed the content as background of the card. I used to have mini media player card also.

I triyed both now, but they just show the app is launched, and no background image.

Are this two feautres deprecated? or am i doing something wrong?

I search here and google it, but i didnt find the answer.

Thanks a lot, good to be back :slight_smile:

@francoislegrange what did you eventually do to control your Monoprice 10761 from the HA Dashboard?

I have 3 problems.

When i use buttons option, script loading is very slow. The sound of the radio is coming after 20 seconds.

          buttons:
            - id: script.ecouter_france_info
              name: France Info
              type: script

If i use the script in a different card, radio is launching immediately.

My script :

ecouter_france_info:
  alias: Ecouter France Info
  sequence:
  - service: media_player.play_media
    data:
      media_content_id: http://icecast.radiofrance.fr/franceinfo-lofi.mp3
      media_content_type: music
      enqueue: play
    target:
      device_id: c2f2317789b8454e2ea840badc362aa8
  mode: single

If i ask to google home with voice (direct), radio is launching immediately.
Futhermore i have the card covered using ths way, not if i use “button” option.

I would like the button in use be in color to know wich one is in use.

Thanks for your help for those 3 issues.

hello, is there anyway to move the position of the track info and media controls? would like to position more like the default media player


Is it normal for a custom background to replace the artwork for playing media like what’s happening with my PlayStation or am I missing a css or ifthen code line?

type: custom:mini-media-player
entity: media_player.playstation_4
volume_stateless: false
toggle_power: true
artwork: material
hide:
  volume: true
  source: true
  controls: true
  play_pause: true
  play_stop: true
  mute: true
  name: true
group: false
idle_view:
  when_idle: true
  when_paused: false
  when_standby: true
source: full
scale: '1.1'
mini-media-player-background-opacity: 0.5
background: /local/PS4.png

Hi, I have Mini Media player installed and it works, but I am only getting the background art on my Apple TV units at this time. I have a Sony OLED TV that has the Google TV O/S and I’m only getting “Prime Video” on the card if I’m watching Prime Video…no title, etc.

Any ideas?

That’s a question for the integration used or wherever the underlying media player comes from.

hi all!
what code i have to use to play music by google home?
i have a script to start spotcast:

    sequence:
    - service: spotcast.start
      data:
        entity_id: media_player.soggiorno_google_home 

and then?
thank you

I have the same issue.

As for now I call scripts to do what I want to be done but it feels kind of unnecessary if it could be done directly from the card.

My Marantz amplifier doesn’t work with the integration as far as toggling power is concerned and needs to use a switch which is configured to send a telnet command, is it possible to change the switch that the power button on the media player card toggles? I’ve tried creating a universal media player and adding that as the mini media player player but that doesn’t seem to work.

Using a universal media player entity does not show the mute and volume buttons when “call service” remote.send_command is used for those items.

Just wanted to share a design I made for my homepods.

In the screenshot example I have it nested inside of a pop-up bubble-card, but none of that code is below.

Required: Custom-State-Switch card for all the available states and Card-Mod for light styling and transparent backgrounds.

When in the state of: playing, paused

And in the state of: unavailable, off, standby, idle.

Feel free to customize.

(PS, I’m no coder, apologies for in-elegant, but working, code.)

type: custom:state-switch
entity: media_player.homepod
states:
  unavailable:
    type: vertical-stack
    cards:
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        info: scroll
        idle_view:
          when_idle: true
          when_paused: true
          when_standby: true
          after: 5
        hide:
          name: true
          power: true
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          icon_state: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
  'off':
    type: vertical-stack
    cards:
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        name: HomePod Mini
        idle_view:
          when_idle: true
          when_paused: true
          when_standby: true
          after: 5
        hide:
          name: false
          power: false
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          icon_state: false
          state_label: false
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
  standby:
    type: vertical-stack
    cards:
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        name: HomePod Mini
        idle_view:
          when_idle: true
          when_paused: true
          when_standby: true
          after: 5
        hide:
          power: true
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          icon_state: false
          state_label: false
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
  idle:
    type: vertical-stack
    cards:
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        name: HomePod Mini
        idle_view:
          when_idle: true
          when_paused: true
          when_standby: true
          after: 5
        hide:
          power: true
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          icon_state: false
          state_label: false
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
  paused:
    type: vertical-stack
    cards:
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        artwork: full-cover-fit
        scale: '1'
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        scale: '1.5'
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: false
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
      - type: markdown
        group: true
        content: >
          <center>

          <b>{{ state_attr('media_player.homepod','media_title')
          }}</b><br>

          {{ state_attr('media_player.homepod','media_artist') }}<br>

          </center>
        card_mod:
          style: |
            ha-card { font-size: 1.25em !important;
                      --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; 
                      --ha-card-border-width: 0; }
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        scale: 1.5
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        scale: 1
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          progress: true
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
    card_mod:
      style: |
        ha-card {
          aspect-ratio: 1 / 1;
        }
  playing:
    type: vertical-stack
    cards:
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        artwork: full-cover-fit
        scale: '1'
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        scale: '1.5'
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          controls: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: false
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
      - type: markdown
        group: true
        content: >
          <center>

          <b>{{ state_attr('media_player.homepod','media_title')
          }}</b><br>

          {{ state_attr('media_player.homepod','media_artist') }}<br>

          </center>
        card_mod:
          style: |
            ha-card { font-size: 1.25em !important;
                      --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; 
                      --ha-card-border-width: 0; }
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        scale: 1.5
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          jump: true
          volume: true
          volume_level: true
          mute: true
          progress: true
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
      - type: custom:mini-media-player
        entity: media_player.homepod
        group: true
        scale: 1
        hide:
          name: true
          icon: true
          info: true
          power: true
          source: true
          sound_mode: true
          prev: true
          next: true
          play_pause: true
          play_stop: true
          jump: true
          progress: true
          runtime: true
          runtime_remaining: true
          artwork_border: true
          power_state: true
          icon_state: true
          shuffle: true
          repeat: true
          state_label: true
        card_mod:
          style: |
            ha-card { --ha-card-background: rgba(0, 0, 0, 0); 
                      --ha-card-box-shadow: none; }
    card_mod:
      style: |
        ha-card {
          aspect-ratio: 1 / 1;
        }
1 Like

Thank you, I just hit this wall today and with a bit of googling you are saving me from having to re-ask this question.
It seems it is still the case in Sep/2023. I guess I’ll go the route of predefining groups.

1 Like

Hi Andrea,

The code I put together a while back for our Google Home is:

type: custom:mini-media-player
entity: media_player.kitchen_display
hide:
  volume: true
shortcuts:
  columns: 2
  buttons:
    - cover: >-
        https://cdn.mediaworks.nz/morefm_christchurch/Content/shows/images/1545356271665_morefmlogo-1100x620.png
      type: service
      id: media_player.play_media
      data:
        entity_id: media_player.kitchen_display
        media_content_id: http://tunein-icecast.mediaworks.nz/more_chc_128kbps
        media_content_type: music
        extra:
          metadata:
            metadataType: 3
            title: Today's best music
            artist: More FM Canterbury
            images:
              - url: >-
                  https://static-media.streema.com/media/cache/35/10/3510429f45f4461d91a7caa9634d5d75.jpg
    - cover: https://cdn.webrad.io/images/logos/radio-org-nz/compass-fm.png
      type: service
      id: media_player.play_media
      data:
        entity_id: media_player.kitchen_display
        media_content_id: https://stream.compassfm.org.nz:8443/Compass_FM_104.9
        media_content_type: music
        extra:
          metadata:
            metadataType: 3
            title: Compass FM
            artist: LIVE
            images:
              - url: >-
                  https://compassfm.org.nz/wp-content/uploads/2023/03/CompassFM-Facebook-Cover-02.jpg
    - cover: >-
        https://www.rnz.co.nz/x/logos/rnz-national-lockup-b4946037cac3bbc328c7307ebef8ff0f7926ec6d3904c335f85db966531c2827.svg
      type: service
      id: media_player.play_media
      data:
        entity_id: media_player.kitchen_display
        media_content_id: http://radionz-ice.streamguys.com/national.mp3
        media_content_type: music
        extra:
          metadata:
            metadataType: 3
            title: RNZ National
            artist: LIVE
            images:
              - url: https://static.mytuner.mobi/media/tvos_radios/zdcW4dPE8E.jpg
    - cover: /local/img/bonjovi2.jpg
      type: service
      id: spotcast.start
      data:
        entity_id: media_player.kitchen_display
        uri: spotify:playlist:1jzkhaU0ZyYMgAEcFZtGly

Hey everybody!
Did someone know a way for templating an MMP icon??
Tried this but do not work!

type: custom:mini-media-player
entity: media_player.entity
name: BoxTV
icon: "{{ is_state_attr('media_player.entity','app_id','Netflix') | iif ('si:netflix','mdi:box') }}"

hi all, i want to view video animation as spotify app.
now i have a cover:

can i have video animation instead?

thank you

1 Like

Hello

image

Is it possible to change the size of the shortcut image?

.mmp-shortcuts__button > div > img {
    height: 24px;

to height: 50px;

That’s nice do you have the code for that media card

I must be doing something wrong… I am on the latest version of HA and the latest version of mini-media-player. When I add the card, the presentation is all messed up. You can’t use the UI to select the media_player. Nothing there works. You can show the code editor, but the display of the mini-media-player has all of its buttons missing and the formatting is all messed up. If I’ve researched correctly, the problem may be with the use of ha-icon-button in custom cards with the newer versions of HA? If that’s the problem, why hasn’t mini-media-player been updated to address that? Seems like a very popular add-on, so I must be doing something wrong. Hope somebody can help. Thanks.