Lovelace: Mini Media Player

Hey kalkih, i love your card and i hope that i read the notes correctly.
Is it now possible to call a service via shortcut?
I’m trying to play a radio station via tunein on my echo but i cant get it to work with the card.

cards:
  - cards: null
    entity: media_player.echo_bad
    hide:
      power_state: false
      source: true
    more_info: false
    shortcuts:
      hide_when_off: true
      list:
        - data:
            entity_id: media_player.echo_bad
            media_content_type: radio SAW
          id: media_player.play_media
          name: radio SAW
          type: source
        - data:
            entity_id: media_player.echo_bad
            media_content_type: S._W._R. 3
          id: media_player.play_media
          name: SWR3
          type: source
    type: 'custom:mini-media-player'
type: vertical-stack

Sorry for the bad formation. Its from the UI editor.

ok, nevermind i found the problem. it calls the service now correctly:

cards:
  - cards: null
    entity: media_player.echo_bad
    hide:
      power_state: false
      source: true
    more_info: false
    shortcuts:
      list:
        - data:
            entity_id: media_player.echo_bad
            media_content_id: radio SAW
            media_content_type: TUNEIN
          id: media_player.play_media
          name: radio SAW
          type: service
        - data:
            entity_id: media_player.echo_bad
            media_content_id: S._W._R. 3
            media_content_type: TUNEIN
          id: media_player.play_media
          name: SWR3
          type: service
        - data:
            entity_id: media_player.echo_bad
            media_content_id: R._P._R. 1
            media_content_type: TUNEIN
          id: media_player.play_media
          name: RPR1
          type: service
    type: 'custom:mini-media-player'
  - cards: null
    type: entities
    entities:
      - entity: input_select.echo_bad_radio
type: vertical-stack

But I found a new problem wihch seems to be Home Assistant related?
It isnt possible to set quotes around the values of media_content_id and media_content_type they get removed. It should be "S._W._R. 3"
This way Alexa cant understand the radio stations correctly.

Hey @0rn0lf,
The default shortcut “action” is play_media so you could actually write those shortcuts like this to save some time & lines.

- name: Radio
  type: TUNEIN
  id: radio SAW

Yeah, that’s a yaml thing, how it parse strings, but you could try escaping the quotes.

media_content_id: >
  "hello world"

or possibly (less likely)

media_content_id: "\u0022hello world\u0022"

EDIT: even simpler:

media_content_id: '"Hello world"'

thanks. this one seems to work now :slight_smile:

media_content_id: '"Hello world"'
1 Like

Great work @kalkih!

For the life of me, I can’t figure out how to theme the idle player though, what am I missing here (the Apple TV element)?
35%20PM

Thanks!
The card background is based on paper-card-background-color atm, will prioritize ha-card-background (if set) in the next version.
https://github.com/kalkih/mini-media-player/commit/24453ec978266a59ba1f4cbd714bf3b5cbe6eb3b

Im having issues grouping my monoprice 6 zone audio system with the mini media player. i think my issue is with the platform section. I can see all media players (all 6) in overlay, but get error "Failed to call service media_player/monoprice_JOIN. Unable to find service media_player/monoprice_join

entities:
  - artwork: full-cover
    entity: media_player.homecast
    group: true
    icon: 'mdi:google-home'
    scroll_info: true
    show_source: true
    show_tts: true
    tts: google
    type: 'custom:mini-media-player'
    info: scroll
    speaker_group:
      platform: monoprice
      show_group_count: true
      entities:
        - entity_id: media_player.living_room_audio
          name: Living Room Audio
        - entity_id: media_player.bbq_area_audio
          name: BBQ Audio
        - entity_id: media_player.kitchen_audio
          name: Kitchen Audio
        - entity_id: media_player.master_bedroom_audio
          name: Master Bedroom Audio
        - entity_id: media_player.study_audio
          name: Study Audio
        - entity_id: media_player.jacuzzi_audio
          name: Jacuzzi Audio
title: 'Casting Device:  Homecast'
show_header_toggle: false
type: entities

I do not think the Monoprice component supports grouping of speakers.

TTS for Alexa has been depreciated, Will you be able to add notify in it’s place?

@kalkih is it possible to integrate monopice 6 zone amplifier into your player like you did with sonos?

Sure, It’s been changed to use notify since v1.0.4.

I took a quick peek at the component and as @Dansker said, I don’t think it’s possible, sorry.

After update card to version 1.2.1 icons of media players are black. How to change icon color to --state-icon-color without changing any other colors? mini-media-player-base-color change icon color but also some text color.

Hey, could you provide me with a screenshot of the issue, what is the expected behaviour and what was the behaviour before the update?

This is media-player-card 1.2.0:
0

This media-player-card 1.2.1:
1

And this is media-player-card 1.2.1 with mini-media-player-base-color: 'var(--state-icon-color)' in theme:
1-with-theme

I want colors like in 1.2.0 version.

Thanks for the details, will be fixed in the next version.
https://github.com/kalkih/mini-media-player/commit/dd2d7ca25a43b7d27d34fb5e1165b2dd9bc2e958
The entity icon will be the color of paper-item-icon-color (like the default state-badge), unless mini-media-player-base-color is set.

2 Likes

Do you mind sharing your config for the remote?

Nothing special. I just used the Mini Media Player based on te documentation with these scripts:

Have you had any issues with some devices not accepting commands from relay? Only a subset of my devices appear to work :man_shrugging:

Actually yes, I used it to broadcast messages & start spotify playback on cast devices/groups, but at some point starting playback didn’t function anymore, broadcasting continued to work fine though.
I didn’t really look into it and used this instead, which has been working fine for the last few months.

Probably going to switch to spotcast at some point, since it does seem to support speaker groups now.

Cool. Thanks for the alternatives