Lovelace: Mini Media Player

hi, i cant use sources for my chromecast devices with mini-player. It show me only connected devices, not all. Any idea ?
i use
source: full
In spotcast i can use any of my device. Thanks for support

Just a simple question. May someone can help me? I wrote some scripts to trigger radio stations and spotify playlists on my alexa devices. The problem is, it works perfect for a single device (in the code it is media_player.echo_show_wohnzimmer) but if I change the target into a group of players (media_player.echo_show_wohnzimmer and media_player.echo_kuche are together media_player.erdgeschoss) nothing happens. What do I wrong?

alexaradioeins:
  alias: radioeins
  sequence:
  - service: media_player.volume_set
    data:
      entity_id: media_player.echo_show_wohnzimmer
      volume_level: 0.4
  - delay: 00:00:02
  - data:
      entity_id: media_player.echo_show_wohnzimmer
      media_content_id: radio eins vom rbb
      media_content_type: TUNEIN
    service: media_player.play_media
  mode: single

Groups are not supported for echos/alexas.
See this post
Nevertheless it works with a stereo group here.

TTS with GA (Google Broadcast) to a SPECIFIC DEVICE

Hello, im just sharing here how I have managed to broadcast on google to specific devices from mini-media-player. I had searched for this but been unable to find the answer so hope it helps someone.

@kalkih iā€™ll post on github too and hopefully it can be incorporated into future versions.

Custom Notify service named ga_broadcast as per the documents
(Please note, im using Assistant Relay rather than Google Assistant Webserver)

notify:
  - name: ga_broadcast
    platform: rest
    resource: !secret assistant_relay_url
    method: POST_JSON
    data:
      user: "Home Assistant"
      broadcast: "true"
      talkback: "false"
      command: "{{ message }}" 
      device: "{{ target }}"

Now we need to edit the mini-media-player file as follows

CHANGE

"ga" === b.platform ? this.hass.callService("notify", "ga_broadcast", {
      message: c
 }

TO

"ga" === b.platform ? this.hass.callService("notify", "ga_broadcast", {
      message: c,
      target: b.target
 }

Now on your mini-media-player card, add the target option for the device you want to broadcast too

tts:
  platform: ga
  target: Kitchen display

I hope people find this useful as this was the final missing link between Mini Media Player and TTS for me.

1 Like

hiā€¦ if someone can help me!
how can i put a speaker selection on mini media cardā€¦

i have google mini, google home and group speaker ā€¦

thanks in advance ;).

Hi guys. Is there anyone of you who knows if it is possible to resize/enlarge only the Play/Pause and Previous/Next buttons?

Or move them to a totally different location, for instance in the center of the cover?

MiniMediaPlayer

Or change the look of the play/pause-buttons totally?

Do you have samples of your join scripts? The ones you call with those slick buttons at the bottom of the card?

yeah something like this:

sonos_office_join_unjoin:
  alias: Sonos Kantoor Join/Unjoin
  sequence:
  - choose:
    - conditions:
      - condition: state
        entity_id: media_player.sonos_kantoor
        state: playing
      sequence:
      - service: sonos.unjoin
        data:
          entity_id: media_player.sonos_kantoor
    - conditions:
      - condition: state
        entity_id: media_player.sonos_kantoor
        state: paused
      sequence:
      - service: sonos.join
        data:
          entity_id: media_player.sonos_kantoor
          master: media_player.sonos_woonkamer
    - conditions:
      - condition: state
        entity_id: media_player.sonos_kantoor
        state: idle
      sequence:
      - service: sonos.join
        data:
          entity_id: media_player.sonos_kantoor
          master: media_player.sonos_woonkamer
    default: []
  mode: single

So iā€™m checking if the speaker is playing, if true, it will unjoin. If itā€™s paused or idle i join the speaker in the living room, because thatā€™s te room where the music normally starts playing in our case. In this case i only have to create one script.

1 Like

Why us your mini media player showing the plex fanart? mine isnā€™t!

Excellent - that works great, thanks. I understand what you were going for with the single script; I just wish it would indicate grouping (by colored icon) even when the master is not playing.

How do you mean? It does indicate whether the speaker is playing or not. If you play music on that particular speaker the icon and color changes. What else would you like to see?

Oh yes, it does! And actually, your code allowed me to make this small change so I see what I was looking for (see code comments)

state:
              - color: '#216491'
                icon: 'mdi:speaker-wireless' #grouped and playing
                value: playing
              - color: '#8C8C8C'
                icon: 'mdi:speaker' #grouped and NOT playing
                value: paused
              - color: '#8C8C8C'
                icon: 'mdi:speaker-off' #ungrouped
                value: idle

!

1 Like

that is great but unfortunately I have google speakers

i use condition and input_select

          - type: entities
            entities: 
                - input_select.chromecast_audio
            group: true

          - type: conditional
            conditions:
              - entity: input_select.chromecast_audio
                state: "Bathroom"
            card:
                type: "custom:mini-media-player"
                entity: media_player.bathroom_speaker
                icon: mdi:spotify
                artwork: cover
                hide:
                  volume: false
                  source: false
                  power_state: false
                shortcuts:
                  columns: 4 # Max buttons per row
                  buttons:
                    # Start predefined playlist
                    - icon: mdi:alpha-r-box
                      type: playlist
                      id: https://rj1.rjstream.com/
                    # Change the source to bathroom
                    - icon: mdi:numeric-1-box
                      type: playlist
                      id: https://live-radio-cf-vrt.akamaized.net/groupa/live/014a9eea-af85-4da6-aab2-c472ca8d0149/live.isml/.m3u8
                    # Trigger script
                    - icon: mdi:alpha-m-box
                      type: playlist
                      id: https://live-radio-cf-vrt.akamaized.net/groupa/live/014a9eea-af85-4da6-aab2-c472ca8d0149/live.isml/.m3u8
                hide_controls: true
                show_tts: true
                group: true

          - type: conditional
            conditions:
              - entity: input_select.chromecast_audio
                state: "Living Room"
            card:
                type: "custom:mini-media-player"
                entity: media_player.living_room_speaker
                icon: mdi:spotify
                artwork: cover
                hide:
                  volume: false
                  source: false
                  power_state: false
                shortcuts:
                  columns: 4 # Max buttons per row
                  buttons:
                    # Start predefined playlist
                    - icon: mdi:alpha-r-box
                      type: playlist
                      id: https://rj1.rjstream.com/
                    # Change the source to bathroom
                    - icon: mdi:numeric-1-box
                      type: playlist
                      id: https://live-radio-cf-vrt.akamaized.net/groupa/live/014a9eea-af85-4da6-aab2-c472ca8d0149/live.isml/.m3u8
                    # Trigger script
                    - icon: mdi:alpha-m-box
                      type: playlist
                      id: https://live-radio-cf-vrt.akamaized.net/groupa/live/014a9eea-af85-4da6-aab2-c472ca8d0149/live.isml/.m3u8
                hide_controls: true
                show_tts: true
                group: true

          - type: conditional
            conditions:
              - entity: input_select.chromecast_audio
                state: "Group Speaker"
            card:
              # - type: vertical-stack
              #   cards:

                  # - type: entities
                  #   entities:
                        type: "custom:mini-media-player"
                        entity: media_player.group_speaker
                        icon: mdi:spotify
                        artwork: cover
                        hide:
                          volume: false
                          source: false
                          power_state: false
                        shortcuts:
                          columns: 4 # Max buttons per row
                          buttons:
                            # Start predefined playlist
                            - icon: mdi:alpha-r-box
                              type: playlist
                              id: https://rj1.rjstream.com/
                            # Change the source to bathroom
                            - icon: mdi:numeric-1-box
                              type: playlist
                              id: https://live-radio-cf-vrt.akamaized.net/groupa/live/014a9eea-af85-4da6-aab2-c472ca8d0149/live.isml/.m3u8
                            # Trigger script
                            - icon: mdi:alpha-m-box
                              type: playlist
                              id: https://live-radio-cf-vrt.akamaized.net/groupa/live/014a9eea-af85-4da6-aab2-c472ca8d0149/live.isml/.m3u8
                        hide_controls: true
                        show_tts: true
                        group: true
                          # type: "custom:mini-media-player"
                          # entity: media_player.living_room_speaker
                          # group: true
                          # hide:
                          #   controls: true

Hello, I just love this thingā€¦
Is there a way to add multiple MPD servers to be controled as group or be able to select which server to interact with?

Thanks

@pdefoy, the card is well documented. Here is what it says:

Speaker group object

See Speaker group management for example usage.

Supported platforms

  • sonos
  • soundtouch
  • squeezebox2
  • bluesound2
  • snapcast2
  • yamaha_musiccast1
  • linkplay3

I donā€™t see mpd in there.

Hey pixeye33.

Could you share the code fir this setup with the buttins?

Thanks

Does this allow for an interruption TTS to music and then music resuming afterwards in the same way that Assistant Relay does when broadcasting to all devices?

Yes , that is exactly what it does.

Thatā€™s great! Perhaps you could submit a PR to the Assistant Relay repo as I know he was hoping to see targeted broadcasts possible.