Lovelace: Mini Media Player

That is not mini-media-player is it?

Yes, it is of “type: custom:mini-media-player” that I have in a browser_mod.popup.

Then I think the support thread for that is what you want.

Ok, posted in browser_mod support. Thanks.

That looks strange, mini-media-player does not display the state, so I guess the media player state is not off and the media information is reported as off? What integration is the media player using?

You could try the idle_view options I guess when_paused might work?

How do I integrate stateful switches as shortcuts?

E.g. I would like to integrate the buttons inside the media player card but can’t figure out how to show their states

Below are 3 renderings:

  1. Left is right on the view.yaml
  2. Middle is via a browser_mod.popup
  3. Right is via a browser_mod.popup and lovelace_gen macro

Left - observe that “Off” does not show under the “Nook Speaker” media player.

Middle - again, observe that “Off” does not show under the “Nook Speaker” media player.

Right - now, observe that “Off” shows under the “Nook Speaker” media player.

How do I remove the state text? I tried the media_player idle_view options but no luck.

I will post in lovelace_gen.

Maybe you should post your yaml code instead of posting pictures on different threads. That way people can see your actual code an help you. Your card looks a lot more like entity card, not mini-media-player. Please post your code of that card.

Here is the code:

# lovelace_gen

{% macro tap_action_entities(entity) -%}
                    - entity: {{ entity }}
{% if media_player %}
                      type: 'custom:mini-media-player'
                      group: true
{% else %}
                      tap_action:
                        action: none
{% endif %}
{%- endmacro %}

title: Test
path: test
panel: true
icon: ''

cards:

  - type: custom:layout-card
    layout: vertical
    cards:

      - type: entities
        entities:
          - entity: 'switch.gosund_dc4f229cc629_relay_2'
            name: "Cat Water"
          - entity: 'media_player.nook_speaker'
            name: "Nook Speaker"
            group: true
            type: 'custom:mini-media-player'

      - break

      - type: entities
        entities:
          - type: 'custom:button-card'
            name: "via browser_mod.popup"
            tap_action:
              action: call-service
              service: browser_mod.popup
              service_data:
                title: " "
                card:
                  type: entities
                  show_header_toggle: false
                  entities:
                    - entity: 'switch.gosund_dc4f229cc629_relay_2'
                      name: "Cat Water"
                    - entity: 'media_player.nook_speaker'
                      name: "Nook Speaker"
                      group: true
                      type: 'custom:mini-media-player'
                deviceID:
                  - this

      - break

      - type: entities
        entities:
          - type: 'custom:button-card'
            name: "via browser_mod.popup and lovelace_gen macro"
            tap_action:
              action: call-service
              service: browser_mod.popup
              service_data:
                title: " "
                card:
                  type: entities
                  show_header_toggle: false
                  entities:
                    {{ tap_action_entities('switch.gosund_dc4f229cc629_relay_2') }}
                      name: "Cat Water"
                    {{ tap_action_entities('media_player.nook_speaker') }}
                      name: "Nook Speaker"
                deviceID:
                  - this
1 Like

Ok, I’ve never used lovelace_gen but just from looking at the screenshots and code I’m pretty confident in saying this is a lovelace_gen configuration issue and would recommend continuing this discussion in the lovelace_gen thread.

You’re most likely not rendering a mini-media-player card but instead just a normal entity row of the media player, that would explain the look of the card. You can pretty easily confirm this by inspecting the card in the browser developer tools (right click, inspect element) and look for the element name.
Or manually by specifying some specific mini-media-player options to the card and see if they are applied in the card or not.

First of all,

Thank you for this awesome media player.

If have add one for my sonos speakers and using the grouping ability, i’m able to add my other speakers to what’s currently playing.
But with one speaker being the master, i need a card for each sonos speaker, in order to play the other speakers individually. Is there a way to change the cards entity (master speaker) using a media shortcut button?

I’m sure this is somewhere in the posts above but there are so many and basic terms are hard to search for and narrow down. I have two questions.

first one. Is there a way for me to show which source is currently playing. I see the music song/artist, but I’d like to show which source is playing.

Here is what I’m working on
image

I’d like to know which of these stations is playing. My preference would be to highlight the button of the station playing,but I suspect that might be a bit tricky. I’d still be happy if it could show somewhere in the player.

Second question. In idle view can I display an image, or just a backround color of my choice. I cannot see the settings for what to add to idle_view, just how to turn it on.

I found that hiding the volume also hid the input.

hide:
  icon: true
  next: true
  power: true
  power_state: true
  prev: true
  volume: true

Shows the info above
Removing the hide volume gets me this

image

I am second for this, i’d really like an option for both your questions


Hiding either volume and/or controls will collapse the card into a more “compact mode”, this does by default hide the source & only displays the icon, use the option source: full to override this and display the full source name.

To highlight the active shortcut, see the below link (examples inside).

Did you try the background option?

How can i make the mediaplayer background transparent when nothing is playing?
i tried many things but im pretty new to this! =)

how to install it

By reading and following the instructions (linked in the first post). https://github.com/kalkih/mini-media-player#install

no, it’s not working

Why not use a conditional card? You can insert the mini media card inside a conditional card and hide it when state is off. It will be hidden completely when nothing is playing/paused.