Lovelace: Mini Media Player

i’m new to this
nice card!

Anyway, i want to get a single row per player
i know i can do that by hiding or the volume or the controls
but is there a way to get either:

the title , whats its playing and volume controls and a drop down list for the controls
or the other way around?
title, whats its playing and controls and a drop down to get the volume?

i see the power button does this in some sort of way for google home products but not for sonos

thx

anyway set it up like that in some way?

Hello,

I love this card as well. I am using it for my Sonos installation. I have multiple players/groups. I wanted to have (just) on player card visible for each Sonos group.

Example. Say I have only two sonos. If they don’t play, I don’t see any card. I turn on one and I see one card. I turn on the 2nd sonos and the 2nd card. I join both sonos in a group and I see only one card. Less clutter.

This works already. I did that with a condition card based on a sensor which tells me if a Sonos is master in a group. Only for the master the card is shown. Works perfect.

One thing is missing. I want to be able to change the volume of each sonos separatly in one card.

Is there a way to have a volume slider in the mini-media-player for each player in the group?

Regards
Ralf

@rak I had this exact problem and solved it using state-switch based on an Input Boolean for if in group and not master (here) and showed a cut down version of the each player with only volume controls (hide options for info, control, source and power) :+1:

@Jeremy, thats a good idea. Instead of hiding it totally, only show the volume slider for those which are not master. I will try. note to self be ashamed to not come up with the idea by yourself ,-).

2 Likes

Please can you share the code ?
Thanks.
I also have kodi remote but i am not understand how to mix the 2

Here it is:

      artwork: full-cover-fit
      background: url("/local/pictures/cardback.png")
      entity: media_player.nuc
      hide:
        controls: true
        icon: true
        mute: false
        power: true
        source: true
        volume: false
      icon: 'mdi:kodi'
      idle_view:
        when_idle: true
        when_paused: true
        when_standby: true
      name: Kodi nappali
      shortcuts:
        buttons:
          - icon: 'mdi:skip-previous'
            id: script.kr_prev_nuc
            type: script
          - icon: 'mdi:stop'
            id: script.kr_stop_nuc
            type: script
          - icon: 'mdi:play-pause'
            id: script.kr_play_pause_nuc
            type: script
          - icon: 'mdi:skip-next'
            id: script.kr_next_nuc
            type: script
          - icon: 'mdi:rewind'
            id: script.nuc_kodi_player_rewind
            type: script
          - icon: 'mdi:fast-forward'
            id: script.nuc_kodi_player_fast_fwd
            type: script
          - icon: 'mdi:menu-up-outline'
            id: script.kr_up_nuc
            type: script
          - icon: 'mdi:home'
            id: script.kr_home_nuc
            type: script
          - icon: 'mdi:information-outline'
            id: script.nuc_kodi_input_info
            type: script
          - icon: 'mdi:menu-left-outline'
            id: script.kr_left_nuc
            type: script
          - icon: 'mdi:circle-outline'
            id: script.kr_select_nuc
            type: script
          - icon: 'mdi:menu-right-outline'
            id: script.kr_right_nuc
            type: script
          - icon: 'mdi:undo-variant'
            id: script.kr_back_nuc
            type: script
          - icon: 'mdi:subtitles-outline'
            id: script.nuc_kodi_input_next_subtitle
            type: script
          - icon: 'mdi:menu-down-outline'
            id: script.kr_down_nuc
            type: script
          - icon: 'mdi:skip-next'
            id: script.kr_playlist_nuc
            type: script
          - icon: 'mdi:rewind-10'
            id: script.nuc_kodi_player_skip_back_30
            type: script
          - icon: 'mdi:rewind'
            id: script.nuc_kodi_player_skip_back_10
            name: '-10'
            type: script
          - icon: 'mdi:fast-forward'
            id: script.nuc_kodi_player_skip_fwd_10
            name: 10
            type: script
          - icon: 'mdi:fast-forward-10'
            id: script.nuc_kodi_player_skip_fwd_30
            type: script
        column_height: 90
        columns: 4
      show_progress: true
      type: 'custom:mini-media-player'

And the scripts:


kr_up_nuc:
  alias: Kodi Remote Up Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Input.Up
    service: kodi.call_method
kr_down_nuc:
  alias: Kodi Remote Down Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Input.Down
    service: kodi.call_method
kr_left_nuc:
  alias: Kodi Remote Left Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Input.Left
    service: kodi.call_method
kr_right_nuc:
  alias: Kodi Remote Right Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Input.Right
    service: kodi.call_method
kr_select_nuc:
  alias: Kodi Remote Select Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Input.Select
    service: kodi.call_method
kr_home_nuc:
  alias: Kodi Remote Home Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Input.Home
    service: kodi.call_method
kr_back_nuc:
  alias: Kodi Remote Back Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Input.Back
    service: kodi.call_method
kr_next_nuc:
  alias: Kodi Remote Next Nuc
  sequence:
    data:
      entity_id: media_player.nuc
    service: media_player.media_next_track
kr_prev_nuc:
  alias: Kodi Remote Prev Nuc
  sequence:
    data:
      entity_id: media_player.nuc
    service: media_player.media_previous_track
kr_play_pause_nuc:
  alias: Kodi Remote PlayPause Nuc
  sequence:
    data:
      entity_id: media_player.nuc
    service: media_player.media_play_pause
kr_stop_nuc:
  alias: Kodi Remote Stop Nuc
  sequence:
    data:
      entity_id: media_player.nuc
    service: media_player.media_stop
kr_playlist_nuc:
  alias: Kodi Remote Playlist Nuc
  sequence:
    data:
      entity_id: media_player.nuc
      method: Audio.Details.Album
    service: kodi.call_method
nuc_kodi_input_contectx_menu:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: kodi_ubuntunuc_local
      method: Input.ContextMenu
nuc_kodi_input_next_subtitle:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Player.SetSubtitle
      playerid: 1
      subtitle: next
      enable: true
nuc_kodi_input_info:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Input.Info
nuc_kodi_player_fast_fwd:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Player.SetSpeed
      playerid: 1
      speed: increment
nuc_kodi_player_rewind:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Player.SetSpeed
      playerid: 1
      speed: decrement
nuc_kodi_player_skip_back_10:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Player.Seek
      playerid: 1
      value: smallbackward
nuc_kodi_player_skip_back_30:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Player.Seek
      playerid: 1
      value: bigbackward
nuc_kodi_player_skip_fwd_10:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Player.Seek
      playerid: 1
      value: smallforward
nuc_kodi_player_skip_fwd_30:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Player.Seek
      playerid: 1
      value: bigforward
nuc_update_kodi_library:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: VideoLibrary.Scan
nuc_kodi_input_select:
  sequence:
  - service: kodi.call_method
    data:
      entity_id: media_player.nuc
      method: Input.Select
1 Like

How can I have Roku as the player but the volume slider for the TV through a Harmony? I already have scripts setup for tv_vol_up, tv_vol_dn, and tv_vol_mute which I verified function as entities but what don’t know how to do is have the volume in the Mini Media Player for the TV but have the source selection from the Roku.

Make a universal media_player https://www.home-assistant.io/integrations/universal/

Is there any way the “power” icon be changed into slider/toggle switch?

Hi ,
sorry to bother , how did you manage to have the multiroom with alexas
I added 3 dfferent players Room a room b room a+b , due to i use to “fake” the request to play on the multiroom name created on amazon it start then playng on all the 3 entities.
In your case i see only 1 card , how can yo triggere one or the other layer , or both if you want to play multiroom and what are you streaming from?
Thanks

Thanks for the player/card :slight_smile:

1 Like

Not sure if this is a problem with the lovelace, the card, chrome or my homeassisant… BUT:

I have a mini media player card and whenever i want to edit this in my lovelace code-editor my browsers crash. So far, i only observed it with this specific card:

entities:
  - artwork: full-cover-fit
    entity: media_player.spotify
    group: true
    hide:
      artwork_border: true
      controls: false
      icon: false
      name: true
      power: true
      progress: false
      source: false
      volume: false
    info: fit
    type: 'custom:mini-media-player'
  - entity: media_player.snapcast_wohnzimmer
    group: true
    hide:
      controls: true
      icon: false
      power: true
      progress: false
      source: true
      volume: false
    icon: 'mdi:sofa'
    name: Wohnzimmer
    type: 'custom:mini-media-player'
  - artwork: full-cover-fit
    entity: media_player.snapcast_kuche
    group: true
    hide:
      artwork_border: true
      controls: true
      icon: false
      mute: false
      power: true
      progress: false
      source: true
      volume: false
    icon: 'mdi:food-fork-drink'
    name: Küche
    type: 'custom:mini-media-player'
  - artwork: full-cover-fit
    entity: media_player.snapcast_bad
    group: true
    hide:
      artwork_border: true
      controls: true
      icon: false
      power: true
      progress: false
      source: true
      volume: false
    icon: 'mdi:human-male-female'
    name: Bad
    type: 'custom:mini-media-player'
  - artwork: full-cover-fit
    entity: media_player.snapcast_schlafzimmer
    group: true
    hide:
      artwork_border: true
      controls: true
      icon: false
      power: true
      progress: false
      source: true
      volume: false
    icon: 'mdi:hotel'
    name: Bett
    type: 'custom:mini-media-player'
  - artwork: full-cover-fit
    entity: media_player.snapcast_schlafzimmer_tv
    group: true
    hide:
      artwork_border: true
      controls: true
      icon: false
      power: true
      progress: false
      source: true
      volume: false
    icon: 'mdi:television'
    name: TV
    type: 'custom:mini-media-player'
type: entities

Any idea what the reason could be?

No, try clearing cache, try another browser/incognito, try with a smaller config, and add more step by step to easier pinpoint the issue.

Is there a variable to ALWAYS show the Sonos Group Speakers? I’m building this card as part of a wall-mount tablet setup, and I don’t want the card size to consistently change. I was hoping it to always display the speaker group upon initial load and stick there that way. Anyone else accomplish this?

Yes there’s an option called expanded in the speaker group config, set it to true.

1 Like

after installing it from HACS what need to be done?
I can’t see that card when pressing the + button in Lovelace
I’m using the UI Lovelace

@Barak_Michaeli Add it as a ‘custom card’ when selecting the + sign, like all custom cards need to be added as a lovelace card.

See for example config: https://github.com/kalkih/mini-media-player/blob/master/README.md#compact-card

1 Like

thanks

I want to add a shutouts to a specific source
I saw this example:

buttons:
      # Start predefined playlist
      - icon: mdi:cat
        type: playlist
        id: spotify:user:spotify:playlist:37i9dQZF1DZ06evO2O09Hg

but how can I know the specific id of my pioneer receiver sources?

Go to http:/[/HA-IP]:[PORT]/developer-tools/state, find the device and look for source_list amongst its attributes, there you’ll find the id’s of the available sources.

Nice solution!