Lovelace: Mini Media Player

I’m aware about that, but I saw some posts here where other users have been able to change colors, but only for all icons and not just one.
Reading the documentation the card has the option to change autmatically the color with other type of services, but not for switch.toggle.
I’ve also tried to use conditional card, but it doesn’t fit my needs cause you can’t change the color to the single button.

Hello all,

I’ve managed to group my chromecast audios together for my home, and everything is working as intended but I’d like to hide chromecasts that are unavailable when I unplug them. Does anyone know how to make a conditional that hides them when their status is listed as “unavailable”?

Appreciate any help, thanks!

type: grid
cards:
  - type: custom:mini-media-player
    group: true
    info: scroll
    toggle_power: false
    volume_stateless: false
    source: icon
    entity: media_player.kitchen_speakers
    name: Kitchen Speakers
    hide:
      power: true
    artwork: full-cover
  - type: custom:mini-media-player
    name: Living Room Speakers
    icon: mdi:cast-audio
    source: true
    volume_stateless: false
    group: true
    toggle_power: false
    entity: media_player.vincent_s_chromecast
    hide:
      power: true
      controls: true
      progress: true
  - type: custom:mini-media-player
    shortcuts: source
    volume_stateless: false
    group: true
    entity: media_player.rx_v685
    source: icon
  - type: custom:mini-media-player
    group: true
    name: Balcony Speakers
    entity: media_player.balcony_speakers
    icon: mdi:cast-audio
    hide:
      power: true
      controls: true
      progress: true
  - type: custom:mini-media-player
    group: true
    entity: media_player.bedroom_speakers
    name: Master Bedroom Speakers
    icon: mdi:cast-audio
    conditions:
      state: 'off'
    hide:
      power: true
      controls: true
      progress: true
  - type: custom:mini-media-player
    group: true
    entity: media_player.office_speakers
    name: Office Speakers
    icon: mdi:cast-audio
    hide:
      power: true
      controls: true
      progress: true
  - type: custom:mini-media-player
    group: true
    entity: media_player.guest_bedroom_speakers
    name: Guest Bedroom Speakers
    icon: mdi:cast-audio
    hide:
      power: true
      controls: true
      progress: true
columns: 1
square: false

Is the state listed as unavailable? Then it should be fairly easy with a conditional card, something like:

type: custom:stack-in-card
title: Media
mode: vertical
cards:
  - type: conditional
    conditions:
      - entity: media_player.living_room_apple_tv
        state: unavailable
    card:
      type: custom:mini-media-player
      (...)

Otherwise you can create a binary sensor that pulls the state, or use entity-filter (that is what I do)

              - entity: sensor.gpodder
                type: custom:podcast-card
                name: Home Assistant Podcasts
                icon: mdi:home-assistant
                default_target: media_player.office_speaker
                show_player: true
                custom_player: true

This is with gpodder and Home Assistant podcasts

How do I stop the source list doing this?

This is due to the removal of paper-list items in 2022.3.0 as part of the move to Material Web Components, waiting on a fix.

Yes I know. There was an update pushed today for mini media and Ian is going to fix goodder on the weekend.

1 Like

Hello could anyone help me please,
When i play radio it only plays on my livingroom chromecast even though iv selected bathroom.
I did not what to click on the dropdown so i seperated the input selects, so i just select the room tab at the top, and the player should be instantly selected with no interacting with the dropdown
I was thinking its something to do with my script, Any ideas?

play_radio_on_chromecast:
  alias: play radio
  sequence:
  - service: media_player.play_media
    data_template:
      entity_id: '{% if is_state("input_select.livingroom_speaker", "Livingroom") %} media_player.living_room_tv
        {% elif is_state("input_select.girlsroom_speaker", "Girlsroom") %} media_player.girls_room_tv
        {% elif is_state("input_select.bathroom_speaker", "Bathroom") %} media_player.bathroom_tv
        {% elif is_state("input_select.select_speaker", "Everywhere") %} media_player.home_group
        {% endif %}

        '
      media_content_id: '{% if is_state("input_select.radio_stations", "Northsound1")
        %} https://stream-mz.planetradio.co.uk/northsound1.aac?direct=true&listenerid=1645367587852_0.16917221665432358&aw_0_1st.bauer_listenerid=1645367587852_0.16917221665432358&aw_0_1st.playerid=BMUK_html5&aw_0_1st.skey=1645367588&aw_0_1st.bauer_loggedin=false&aw_0_req.userConsentV2=CPUtmLDPUtmLDAGABCENCDCsAP_AAAAAAAwIHANf_X_fb3_D-_59_9t0eY1f9_7_v-0zjgeds-8Nyd_X_L8X_2M7vB36pq4KuR4Eu3LBAQdlHOHcTQmQ6IkVqTPsbk2Mr7NKJ7PEmlMbO2dYGH9_n9XT_ZKY79_____7__-_____77f__-__3_v5_UgEAAACQyAsABQAIYATABHADLgH2AfgBGACOAFLAKuAVsA3gCYgE2ALRAWwAvMBgQDDwGcgM8AZ8MAFADaAHgAWIA6oCPQEnALoAXkA0IB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BSwCoAF6AMCAZkA1gBvADjgHSAOqAeQA-QCEAEewJWAlcBMUCZAJlATaAoUBSACkwFMAKqAV2AsoBagC4oF0AXUAvoBgQDEAGLAMhAZeA0IBowDSgGmgNTAa8A2kBtgDbiEDcABYAFAAMgAuABiAEMAJgAUwAqgBcAC-AGIAMwAbwA9ACOAFiAMIAd8A-wD8AH-ARgAjgBKQCggFDAKeAVeAtAC0gFzAMUAbQA6gB6AEggJEASoAmwBTQCxQFowLYAtoBcAC5AF2gMPAYkAycBnIDPAGfANEAaSA0sBwBABCAAgAH4AaAA_gCRAGWANoAc4A8ACCgE-AKWAWIAzIBvADqgHbAR6Ak4BK4CYgE2gKFAUgApMBdAC8gGBANCAaUA1MBtgDbiUDgABAACwAKAAZAA4AB-AGAAYgA8ACIAEwAKoAXAAvgBiADMAG0AQ0AiACJAEcAKMAUoAtwBhADVAGyAO8AfgBGACOAEnAKeAVeAtAC0gF1AMUAbgA6gB8gEOgIqAReAkQBNgCxQFsALtAXmAw8Bk4DOQGeAM-AaQA1gBt4DgCQBsABwAFwAQgA5ADIAJEAXIAywBqADaAHcAQAAnwBUADMgG8AOqAfYBHoCVgE2gKTAWUAugBiwDSgG5FIIwAC4AKAAqABkADkAHwAggBgAGQANAAeQBDAEUAJgATwApABVACwAF8AMQAZgA5gB-AENAIgAiQBRgClAFiALcAYQAygBogDVAGyAO-AfYB-gEWAIwARwAlIBQQChgFXAK2AXMAvIBtADcAHoAQ6Ai8BIgCTgE2AJ2AUOAsUBbAC4AFyALtAXmAw0Bh4DGAGSAMnAZcAzkBngDPoGkAaTA1gDWQG3lAGgAFwAQgAkAByAD8AKwAZAA2gCOAEiALkAZYA1ABrgDaAHOAO4AeABAACKgEiAJOATYAncBPgE_AKWAWIAuoBigDeAHVAO2AeQA_4CPQExAJlATaApABTACuwFoALoAXkAvoBgQDFgGiANKAabA1IDUwGvAAAA.YAAAAAAAAAAA
        {% elif is_state("input_select.radio_stations", "Radio 1") %} http://stream.live.vc.bbcmedia.co.uk/bbc_radio_one
        {% elif is_state("input_select.radio_stations", "Radio 1 Extra") %} http://stream.live.vc.bbcmedia.co.uk/bbc_1xtra
        {% elif is_state("input_select.radio_stations", "Radio 2") %} http://http://stream.live.vc.bbcmedia.co.uk/bbc_radio_two
        {% elif is_state("input_select.radio_stations", "Capital UK") %} https://media-ssl.musicradio.com/CapitalUK
        {% elif is_state("input_select.radio_stations", "Capital XTRA") %} https://media-ssl.musicradio.com/CapitalXTRANational
        {% elif is_state("input_select.radio_stations", "Capital XTRA Reloaded") %}
        https://media-ssl.musicradio.com/CapitalXTRAReloaded {% elif is_state("input_select.radio_stations",
        "Capital Dance") %} https://media-ssl.musicradio.com/CapitalDance {% elif
        is_state("input_select.radio_stations", "Heart UK") %} https://media-ssl.musicradio.com/HeartUK
        {% elif is_state("input_select.radio_stations", "Heart 70s") %} https://media-ssl.musicradio.com/Heart70s
        {% elif is_state("input_select.radio_stations", "Heart 80s") %} https://media-ssl.musicradio.com/Heart80s
        {% elif is_state("input_select.radio_stations", "Heart 90s") %} https://media-ssl.musicradio.com/Heart90s
        {% elif is_state("input_select.radio_stations", "Heart Dance") %} https://media-ssl.musicradio.com/HeartDance
        {% elif is_state("input_select.radio_stations", "Smooth UK") %} https://media-ssl.musicradio.com/SmoothUK
        {% elif is_state("input_select.radio_stations", "Smooth Chill") %} https://media-ssl.musicradio.com/SmoothChill
        {% elif is_state("input_select.radio_stations", "Smooth Country") %} https://media-ssl.musicradio.com/SmoothCountry
        {% elif is_state("input_select.radio_stations", "RadioX UK") %} https://media-ssl.musicradio.com/RadioXUK
        {% elif is_state("input_select.radio_stations", "Radio Gold") %} https://media-ssl.musicradio.com/Gold
        {% endif %}

        '

Please post your code properly.

That’s looking better, thanks for that.

I think you should look in the script or automation debug for what is happening.

No problem, I forgot about the preformatted button its been a while since iv been on hear
I had a look and it shows it got sent to Livingroom but should have got send to bathroom

In this code (I haven’t quoted the whole thing) you are testing four different input_selects. Why do you have four different input select entities?

I made 4 as i did not want to manual select from the dropdown source menu, I was going to get rid of that as i was just wanting to select the room tab at the top and the source be pre selected and ready to go

Or would i need four scripts one for each input select?

I an trying to get my head around it :slight_smile:

You have four tabs, and when you click on the bedroom tab you want the input_select to change to bedroom so you get music in the bedroom?

Hi Bjorn, thanks for the reply. How would I go about nesting a conditional into the grouped grid cards that I have setup?

Yes thats right i am wanting to have no interaction with the source dropdown, So when you click livingrrom every thing changes to livingroom source, livingroom mini media player, and livingroom Plex playlist dropdown

So why would you need a source dropdown if you are not going to interact with it? Direct the playing to the media player according to which tab you are on, not by what it says in a dropdown box you don’t even want.

Use the popup feature in browser_mod

This is how I have mine setup:

cards:
  - card:
      entity: media_player.lounge_tv
      group: true
      hide:
        icon_state: false
        info: false
        power_state: false
      icon: mdi:television
      type: custom:mini-media-player
    conditions:
      - entity: media_player.lounge_tv
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.everywhere
      group: true
      hide:
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.everywhere
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.all_except_office
      group: true
      hide:
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.all_except_office
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.house
      group: true
      hide:
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.house
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.house_except_office
      group: true
      hide:
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.house_except_office
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.lounge_and_office
      group: true
      hide:
        controls: true
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.lounge_and_office
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.onkyo_amp
      group: true
      hide:
        controls: true
        icon_state: false
        power_state: false
        progress: true
      icon: mdi:amplifier
      type: custom:mini-media-player
      volume_stateless: true
    conditions:
      - entity: media_player.onkyo_amp
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.googlehome3019
      group: true
      hide:
        controls: true
        icon_state: false
        info: true
        power_state: false
        progress: true
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.googlehome3019
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.lounge_speakers
      group: true
      hide:
        controls: true
        icon_state: false
        info: true
        power_state: false
        progress: true
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.lounge_speakers
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.bedroom
      group: true
      hide:
        controls: true
        icon_state: false
        info: true
        power_state: false
        progress: true
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.bedroom
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.gym_speaker
      group: true
      hide:
        controls: true
        icon_state: false
        info: true
        power_state: false
        progress: true
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.gym_speaker
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.office_speakers
      group: true
      hide:
        controls: true
        icon_state: false
        info: true
        power_state: false
        progress: true
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.office_speakers
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.googlehome2136
      group: true
      hide:
        controls: true
        icon_state: false
        info: true
        power_state: false
        progress: true
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.googlehome2136
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.games_room_speaker
      group: true
      hide:
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.games_room_speaker
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.chromecastaudio8002
      group: true
      hide:
        controls: true
        icon_state: false
        info: true
        power_state: false
        progress: true
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
    conditions:
      - entity: media_player.chromecastaudio8002
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.alfresco_sony
      group: true
      hide:
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
      volume_stateless: true
    conditions:
      - entity: media_player.alfresco_sony
        state_not: 'off'
    type: conditional
  - card:
      entity: media_player.shed_speakers
      group: true
      hide:
        icon_state: false
        power_state: false
      icon: mdi:speaker-wireless
      type: custom:mini-media-player
      volume_stateless: false
    conditions:
      - entity: media_player.shed_speakers
        state_not: 'off'
    type: conditional
mode: vertical
type: custom:stack-in-card

Hello

i tried to set this card with the speaker_group settings with my alexa echos.

what must i write in the line 27 —> platform: ?

when i click on the right side on the echo name or the switch it happens nothing.