Lovelace: Mini Media Player

I am still learning and by no means an expert, but I thought it meant full stop for the . and select for the :

Hi everyone

Thanks for the player Karl!

Wondering if anyone can point me in the direction of putting a custom Service when hitting the power button?

Use case is by now I think starting to be frequent: Sonos system, so created service to toggle some smart plugs to turn off and on.

Is the Universal media player the only way to go?

Thanks in advance

I think so, but that isn’t a huge hassle.

1 Like

Artwork only shows on 1 random speaker?

Hello! Using HomePod Mini’s. All working. Just noticed on dashboard that only 1 speaker shows artwork when all playing in a group. Anything I did wrong or that I can change to fix?

Hi,

is it possible to insert/replace a drop down (Harmony activities) in the source drop down menu of the mini media player?

I would like to hide all the controls, the icon and the title in this card. Can somone tells me how to do this with card_mod or css?

image

The mini media player already has this function built in. Does that work for you?

type: custom:mini-media-player
entity: media_player.xxxx
hide:
  controls: true
  icon: true
  info: true
  power: true
  volume: true

All the fields you can hide.

name	
icon
info	
power	
source	
sound_mode	
group_button
controls
next	
play_pause	
play_stop	
jump	
volume	
volume_level	
mute	
progress	
runtime	
runtime_remaining	
artwork_border	
power_state	
icon_state	
shuffle	
repeat	
state_label	
2 Likes

Showing off and asking a question about shortcuts. Is it possible create a light switch using the shortcuts feature? For my ambilight, I’m currently using a service toggle for a script but it doesn’t show on & off states.

Aside that it’s still work in progress:

  • touchpad doesn’t look as good in light mode
  • PS4 artwork material cover isn’t consistent

type: custom:vertical-stack-in-card
cards:
  - type: custom:mini-media-player
    entity: media_player.main_hall_tv
    artwork: none
    source: full
    icon: mdi:television
    hide:
      volume: true
      controls: true
      source: true
      power_state: false
    shortcuts:
      columns: 1
      hide_when_off: true
      buttons:
        - type: service
          id: script.toggle
          data:
            entity_id: script.hyperion_mini_media_player_toggle
          icon: mdi:television-ambient-light
    toggle_power: false
    sound_mode: icon
    volume_stateless: false
    group: false
    scale: '1.1'
  - type: custom:mini-media-player
    entity: media_player.main_hall_tv
    artwork: none
    source: full
    icon: mdi:television
    hide:
      volume: true
      controls: true
      source: true
      power: true
      power_state: true
      name: true
      icon: true
    shortcuts:
      columns: 5
      buttons:
        - icon: mdi:movie-play
          type: source
          id: HDMI 1
        - icon: mdi:sony-playstation
          type: source
          id: HDMI 2
        - icon: mdi:raspberry-pi
          type: source
          id: HDMI 3
        - icon: mdi:microsoft-xbox
          type: source
          id: HDMI 4
        - icon: mdi:desktop-tower-monitor
          type: source
          id: HDMI 5
        - icon: mdi:hdmi-port
          type: source
          id: HDMI 0
    toggle_power: false
    sound_mode: icon
    volume_stateless: true
    group: false
    scale: '1.1'
  - type: custom:mini-media-player
    entity: media_player.android_tv_192_168_1_216
    name: Main Hall Cast
    source: icon
    artwork: material
    tap_action:
      action: none
    hide:
      power: true
      controls: false
      toggle_power: true
      runtime: false
      jump: false
      play-pause: false
      source: true
      mute: true
    shortcuts:
      columns: 4
      hide_when_off: true
      buttons:
        - icon: mdi:youtube-tv
          type: source
          id: com.teamsmart.videomanager.tv
        - icon: mdi:vlc
          type: source
          id: VLC
        - icon: mdi:youtube
          type: source
          id: YouTube
        - icon: mdi:cast
          type: source
          id: HDMI 4
    group: true
    max_volume: '25'
    min_volume: '1'
    volume_stateless: true
    show_progress: true
    sound_mode: full
    scale: '1.1'
    info: scroll
  - type: custom:collapsable-cards
    title: Cast Controls
    buttonStyle:
      - 'font-size: 16px;'
      - bold
    cards:
      - type: custom:android-tv-card
        card_mod:
          style: |
            }    ha-card {
            margin-bottom: 20px;    }
        remote_id: media_player.android_tv_192_168_1_216
        keyboard_id: media_player.android_tv_192_168_1_216
        media_player_id: media_player.android_tv_192_168_1_216
        rows:
          - - power
            - home
            - menu
          - - navigation_touchpad
          - - back
            - keyboard
        button_style:
          '--size': 32px
          color: grey
          border-width: 3px;
          box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.9);
          border-radius: 50%;
          backgound-color: black;
          background-opacity: 50%;
          padding: 8px;
        touchpad_style:
          background-image: url("/local/fingerprint.png")
          background-size: 150px
          background-repeat: no-repeat
          background-position: center
          opacity: 0.5
          box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.9);
          height: 200px
          width: 200px
        enable_double_click: true
        double_click_keycode: menu
        custom_keys:
          power:
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: POWER
          back:
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: BACK
          home:
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: HOME
          menu:
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: MENU
          up:
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: UP
          left:
            icon: local/16x16.png
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: LEFT
          center:
            icon: mdi:arrow-expand-all
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: ENTER
          right:
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: RIGHT
          down:
            service: androidtv.adb_command
            service_data:
              entity_id: media_player.android_tv_192_168_1_216
              command: DOWN
  - type: custom:button-card
    color_type: blank-card
  - type: custom:mini-media-player
    entity: media_player.playstation_4
    volume_stateless: false
    toggle_power: true
    artwork: material
    tap_action:
      action: none
    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
  - type: conditional
    conditions:
      - entity: media_player.playstation_4
        state_not: standby
      - entity: media_player.playstation_4
        state_not: unavailable
      - condition: state
        entity: media_player.playstation_4
        state_not: unknown
    card:
      type: custom:collapsable-cards
      buttonStyle:
        - 'font-size: 20px;'
      title: PS4 Remote
      cards:
        - cards:
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-share
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: share
                  entity_id: media_player.playstation_4
              type: custom:button-card
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-up
              show_icon: true
              show_name: false
              style:
                height: 40px
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: up
                  entity_id: media_player.playstation_4
              type: custom:button-card
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-options
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: option
                  entity_id: media_player.playstation_4
              type: custom:button-card
          type: horizontal-stack
        - cards:
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-left
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: left
                  entity_id: media_player.playstation_4
              type: custom:button-card
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-x
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: enter
                  entity_id: media_player.playstation_4
              type: custom:button-card
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-right
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: right
                  entity_id: media_player.playstation_4
              type: custom:button-card
          type: horizontal-stack
        - cards:
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: ps_hold
                  entity_id: media_player.playstation_4
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: ps
                  entity_id: media_player.playstation_4
              type: custom:button-card
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-down
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: down
                  entity_id: media_player.playstation_4
              type: custom:button-card
            - aspect_ratio: 3/1
              entity: media_player.playstation_4
              hold_action:
                action: more-info
              icon: custom:ps4-o
              show_icon: true
              show_name: false
              tap_action:
                action: call-service
                service: ps4.send_command
                service_data:
                  command: back
                  entity_id: media_player.playstation_4
              type: custom:button-card
          type: horizontal-stack
  - type: tile
    name: Hyperion ambilight
    icon: mdi:television-ambient-light
    entity: light.first_led_hardware_instance_component_usb_capture
    features:
      - type: light-brightness
    tap_action:
      action: more-info

use “cover:” instead of “image:”

image

Hi,

I have a lg soundbar integration. This soundbar is also integrated with google cast. So, I have have two entities :

  • Lg soundbar entity. With mini media player, I can modify source and sound level but artwork deosn’t display when I listen music on spotify.
  • Google cast entity. With media player I can see artwork when I play music with spotify, increase sound level, change music. But when source is set to hdmi, no way to increase sound level. It’s like the soundbar is power off.

Is there a possibility to merge mini media player with this 2 entities ?

The First media player with google cast entity, the second with lg soundbar entity when I play music with spotify.

The First media player with google cast entity, the second with lg soundbar entity when I play movie on my tv.

I would like the sound slider when I play a movie or music on spotify and the artwork when I play music and the possibility to change the source.

Do you have an idea ?

Thank you

I use a Moode entity (DLNA) in combination with this Mini Media Player. I initiate the music from Music Assistant, choosing the Player (DLNA). I also have the Moode available as MPD entity.

If the Mini Media Player is configured for the DLNA entity:

  • The buttons on the front don’t function (can’t call service …).
  • When i klick on the Player name and the pop-up shows, the buttons on the pop-up do function.

Is there a difference in the buttons on the pop-up and on the face of the card, and how can i get the buttons on the face of the card working again (because it used to work).

If i use Mini Media Player with the MPD entity, i can use the buttons on the face of the card, but in that case i do not get the nice artwork.

Hello,

I have my player setup for my Alexa, to play whatever song I type in the text field. works great

However, when I click on stop, the music DOES stop, but the song info does not go away. Does anyone know what I could do to fix this?

I’ve tried the idle commands, but cant seem to code it right. If that even works with Alexa

Thanks

I have 2 input_select drop down menus

Can someone tell me how I can make the bottom drop down change to amazon, when i select amazon in the top drop down?

type: custom:stack-in-card
card_mod:
  style: |
    ha-card {
      overflow: visible !important;
      
    }
    ha-card > div {
      overflow-x: clip;
    }
cards:
  - type: custom:yet-another-expander-card
    title: ''
    cards:
      - type: custom:mini-media-player
        entity: media_player.movie_room
        icon: mdi:speaker-multiple
        name: ' '
        hide:
          power: true
          prev: true
          icon: true
          source: true
          info: true
          progress: true
          play_pause: true
          artwork: true
        sound_mode: full
        source: full
        volume_stateless: false
        artwork: none
        replace_mute: stop
        toggle_power: true
        group: false
        card_mod:
          style: |
            ha-card {
            margin: 0px 0px -20px 0px;
            --mmp-icon-color: #999999 !important;
            --md-slider-inactive-track-color: black;
            --md-slider-active-track-color: gray;
            --md-slider-handle-color: gray;
            }
    title-card:
      type: custom:mini-media-player
      entity: media_player.movie_room
      icon: mdi:speaker-multiple
      name: Backyard Music
      hide:
        controls: true
        power: true
        prev: true
        artwork: true
        progress: true
        icon: null
        volume: true
        source: true
        play_pause: true
      sound_mode: full
      source: full
      volume_stateless: false
      artwork: none
      replace_mute: stop
      toggle_power: true
      group: false
      card_mod:
        style: |
          ha-card {
          margin: 0px 0px -20px 0px;
          --mmp-icon-color: #999999 !important;
          --md-slider-inactive-track-color: black;
          --md-slider-active-track-color: gray;
          --md-slider-handle-color: gray;
          }
    gap: 0em
    padding: em
    child-padding: ''
    title-card-padding: ''
    title-card-button-overlay: true
    overlay-margin: 1.1em
    card_mod:
      style: |
        ha-card {
        margin: 0px 0px -20px 0px;
        --mmp-icon-color: #999999 !important;
        --md-slider-inactive-track-color: black;
        --md-slider-active-track-color: gray;
        --md-slider-handle-color: gray;
        }
  - cards: null
    card_mod:
      style: |
        ha-card {
        margin: 0px -6px -30px -6px;

        }  
    type: entities
    entities:
      - entity: input_select.content
        card_mod:
          style:
            hui-generic-entity-row $: |
              state-badge {
                display: none;
              }
              :host {
                color: red;
                --mdc-theme-primary: gray;
                    }
  - type: entities
    entities:
      - entity: input_select.pandora_stations
        card_mod:
          style:
            hui-generic-entity-row $: |
              state-badge {
                display: none;
              }
    card_mod:
      style: |
        ha-card {
        --card-mod-icon-color: gray;
        --card-mod-button: gray;
        padding: 10px 0px 0px 0px;
        margin: 0px -6px 0px -6px;

        }
        :host {
          color: red;
          --mdc-theme-primary: gray;
        }
  - type: entities
    entities:
      - type: call-service
        name: ' '
        icon: mdi:pandora
        action_name: Play Music
        service: script.alexa_backyard_pandora
        data:
          - PANDORA
    card_mod:
      style: |
        ha-card {
        --card-mod-icon-color: gray;
        --card-mod-button: gray;
        padding: 10px 10px 0px 10px;
        margin: -35px 0px 0px -12px;

        }
        :host {
          color: red;
          --mdc-theme-primary: gray;
        }

Here’s my current iteration and how I’m using the Mini Media Player card. I have a Yamaha MusicCast system in the house so I wanted to be able to group players throughout the house. I have three Lenovo ThinkSmart tablets located in three of the four locations (the garage location I just use myself from my phone but sometimes I like to have the music from the house playing out there too). For the main master player, I have a Yamaha WXC-50 MusicCast Streaming Pre-Amplifier set to be “Media Player”. So either myself or my wife will play music from Spotify on our phone and select “Media Player” as the speaker destination. Then we just go to one of the rooms in the house where the Media Control Tablets are and select the rooms we want to play music in. Each room has separate volume controls and the volume control on the iPhone that is playing the source material will increment or decrease the volume throughout the home.

Here’s my interface dashboard:

And here’s the source code for it if anyone’s interested:

square: false
type: grid
cards:
  - type: entities
    entities:
      - type: custom:mini-media-player
        group: true
        entity: media_player.media_player
        name: MEDIA PLAYER
        artwork: none
        hide:
          power: true
          icon: true
          toggle_power: false
          info: true
          volume: true
          group_button: true
        power_color: true
        show_source: true
        expanded: true
        speaker_group:
          platform: media_player
          sync_volume: false
          show_group_count: false
          expanded: true
          icon: mdi:link
          entities:
            - entity_id: media_player.home_theater_room
              name: Link Home Theater
            - entity_id: media_player.living_room
              name: Link Living Room
            - entity_id: media_player.patio
              name: Link Patio
            - entity_id: media_player.garage
              name: Link Garage
      - type: custom:mini-media-player
        entity: media_player.media_player
        icon: mdi:spotify
        name: Now Playing
        artwork: material
        info: scroll
        hide:
          volume: true
          source: true
          power_state: true
          power: true
          controls: true
    state_color: true
    card_mod:
      style: |
        ha-card
          {background: transparent; 
           border-style: none;
    header:
      type: picture
      image: local/musiccast-logo-new.png
      tap_action:
        action: none
      hold_action:
        action: none
  - type: vertical-stack
    cards:
      - type: custom:bubble-card
        card_type: separator
        name: Home Theater
      - type: custom:bubble-card
        card_type: button
        button_type: slider
        entity: media_player.home_theater_room
        icon: mdi:power
        name: ' '
      - type: custom:bubble-card
        card_type: separator
        name: Living Room
      - type: custom:bubble-card
        card_type: button
        button_type: slider
        entity: media_player.living_room
        icon: mdi:power
        name: ' '
      - type: custom:bubble-card
        card_type: separator
        name: Patio
      - type: custom:bubble-card
        card_type: button
        button_type: slider
        entity: media_player.patio
        icon: mdi:power
        name: ' '
      - type: custom:bubble-card
        card_type: separator
        name: Garage
      - type: custom:bubble-card
        card_type: button
        button_type: slider
        entity: media_player.garage
        icon: mdi:power
        name: ' '
columns: 2
4 Likes

An automation that sets the second one on changing of the first one?
So it would trigger like:

trigger:
  - platform: state
    entity_id:
      - input_select.number_one

And call input_select.select_option on the second one with the state of the first one.
Untested but overall something like this which takes the state of the trigger (the first input) when it changes and sets the value of the second one with the state it went to (the selection):

description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - input_select.number_one
condition: []
action:
  - service: input_select.select_option
    metadata: {}
    data:
      option: "{{trigger.to_state.state}}"
    target:
      - input_select.number_two

That actually worked beautifully thank you

I have one more thing to finish this. Is it possible to change the icon based on the entithy state. ON an Entity card.

I know how to do the if/else thing on mushroom template card but how about a normal entityi card?

Using the state-switch card would be one way, you could show different cards depending on the state.

There is probably 20 ways more to “skin-that-cat” but that card I use frequently. Essentially,

if this state
   show this
if that state
   show that
... and so on ...

Obvious this and that could be entity card with different icons.

Hi, Is there a way to reserve the space on the card so that it does not shrink when nothing is being played, for example by reserving the space with the background image?

Thanks in advance

Hi, is it possible to add buttons shown on the picture below mini media player to shortcuts? so the art work would be behind them?

Is it possible to have de same thing will th this card ? : when i click on a speaker, l’ d like the speaker joins the active speaker.

Thanks