Lovelace: Mini Media Player

Does your media_player entity have a source setting?

Yes, but I would like to have an buttons than a down down list.

This example from the documentation includes a shortcut button set to change the player source (in this case to ā€˜Bathroomā€™):

https://github.com/kalkih/mini-media-player#card-with-media-shortcuts

I finally tried grouping google devices but similar to yourself, no errors in the log but also no grouping taking place

Iā€™ve just updated HA to the 2021.11.0b0 release and noticed all the icons, power, volume up/down etc, are missing from my mini media player instances.

Has anyone else found this?

1 Like

Iā€™m about to find out but itā€™s likely just caching?

Hi @DavidFW1960

Iā€™ve cleared the cache but still not showing icons, I saw in the release notes that MDI was updated twice during the month.

A year or so ago there was an issue with icons in this player not showing and I manually define them in the card config now. It may well be something has changedā€¦ as you say 2 updates to MDI in the release. Perhaps try a manual definition of them?
eg

          - type: entities
            title: Google Player Groups
            show_header_toggle: false
            entities:
              - entity: media_player.all_speakers
                type: custom:mini-media-player
                icon: mdi:google-home
                tts: 
                  platform: google_translate
                artwork: full-cover
                hide: 
                  power_state: false
                info: scroll

I am about to upgrade nowā€¦

Iā€™ve defined the main icon and that shows but still no volume up/down, power etc.

Ugh youā€™re right. I see that too.

@DavidFW1960 A new beta release of the card v1.14.0-beta is now up and appears to resolve this issue after clearing the cache.

3 Likes

Here is my take on media controlā€¦ still got some work to do. I need to setup a drop down that changes the device i want to control when i switch between the apple tv and the rokuā€¦ but im really liking the look and flow of everthing on a ipad as my main controller for the media room.

1 Like

Hi @kalkih

A while back you thought of something brilliant, which I use to make my conditional speaker cards disappear if they become a part of another group.

This is an example:

binary_sensor:
  - platform: template
    sensors:
      dining_room_speaker_grouped_not_master:
        value_template: >
          {{ state_attr('media_player.dining_room', 'sonos_group')[0] | string != 'media_player.dining_room'
            and state_attr('media_player.dining_room', 'sonos_group') | length > 1 }}

It has started throwing warnings, but only when I boot, and it looks like this:

2021-11-01 17:39:27 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: None has no element 0 when rendering '{{ state_attr('media_player.dining_room', 'sonos_group')[0] | string != 'media_player.dining_room'
2021-11-01 17:39:27 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('TypeError: object of type 'NoneType' has no len()') while processing template 'Template("{{ state_attr('media_player.dining_room', 'sonos_group')[0] | string != 'media_player.dining_room'

I know warnings, are not to be taken too seriously, but I like to keep things tidy, and I canā€™t grasp templating.

Do you know what to do about it?

This is great! Can you share your yaml code?

Is it possible to separate the Song and Artist into separate text rows?

Tried thisā€¦ but for some reason the play/pause button doesnā€™t work correctly using this method.

Its just a mix of vertical stack cards and grid cardsā€¦ here is my codeā€¦

 - title: Theater Room Remote
    path: theater-room-remote
    badges: []
    cards:
      - type: vertical-stack
        cards:
          - type: button
            tap_action:
              action: navigate
              navigation_path: menu
            icon: mdi:menu
            icon_height: 55px
            name: Menu
          - type: horizontal-stack
            cards:
              - type: button
                tap_action:
                  action: call-service
                  service: remote.send_command
                  service_data:
                    command: home
                  target:
                    device_id: 07dd6d0543b546368346201ca1bcf188
                icon_height: 55px
                icon: mdi:home
                name: Home
              - type: button
                tap_action:
                  action: call-service
                  service: remote.send_command
                  service_data:
                    command: up
                  target:
                    device_id: 07dd6d0543b546368346201ca1bcf188
                name: Up
                icon: mdi:arrow-up-bold
              - type: button
                tap_action:
                  action: toggle
                name: Power
                icon: mdi:power
                icon_height: 55px
                show_state: true
                entity: input_boolean.theater_switch
          - type: horizontal-stack
            cards:
              - type: button
                tap_action:
                  action: call-service
                  service: remote.send_command
                  service_data:
                    command: left
                  target:
                    device_id:
                      - 07dd6d0543b546368346201ca1bcf188
                name: Left
                icon: mdi:arrow-left-bold
              - type: button
                tap_action:
                  action: call-service
                  service: remote.send_command
                  service_data:
                    command: select
                  target:
                    device_id:
                      - 07dd6d0543b546368346201ca1bcf188
                icon_height: 55px
                name: OK/Select
                icon: mdi:alpha-k-circle-outline
              - type: button
                tap_action:
                  action: call-service
                  service: remote.send_command
                  service_data:
                    command: right
                  target:
                    device_id:
                      - 07dd6d0543b546368346201ca1bcf188
                name: Right
                icon: mdi:arrow-right-bold
          - type: horizontal-stack
            cards:
              - type: button
                tap_action:
                  action: call-service
                  service: media_player.volume_up
                  service_data: {}
                  target:
                    entity_id: media_player.onkyo_receiver
                name: Vol +
                icon: mdi:volume-plus
                icon_height: 54px
              - type: button
                tap_action:
                  action: call-service
                  service: remote.send_command
                  service_data:
                    command: down
                  target:
                    device_id:
                      - 07dd6d0543b546368346201ca1bcf188
                name: Down
                icon: mdi:arrow-down-bold
              - type: button
                tap_action:
                  action: call-service
                  service: remote.send_command
                  service_data:
                    command: back
                  target:
                    device_id:
                      - 07dd6d0543b546368346201ca1bcf188
                name: Back
                icon: mdi:undo
          - type: horizontal-stack
            cards:
              - type: button
                tap_action:
                  action: call-service
                  service: media_player.volume_down
                  service_data: {}
                  target:
                    entity_id: media_player.onkyo_receiver
                name: Vol -
                icon: mdi:volume-minus
                icon_height: 55px
              - type: button
                tap_action:
                  action: call-service
                  service: media_player.media_play_pause
                  service_data: {}
                  target:
                    entity_id: media_player.roku_ultra
                name: Play/Pause
                icon: mdi:play-pause
                show_state: true
                entity: media_player.roku_ultra
              - type: button
                tap_action:
                  action: call-service
                  service: media_player.volume_mute
                  service_data: {}
                  target:
                    entity_id: media_player.onkyo_receiver
                name: Mute
                icon: mdi:volume-mute
          - type: grid
            cards:
              - type: button
                tap_action:
                  action: toggle
                entity: switch.open_masking_system
              - type: button
                tap_action:
                  action: toggle
                entity: switch.close_masking_system
                show_icon: true
                icon_height: '-1px'
            columns: 2
            square: false
      - type: grid
        cards:
          - type: picture-glance
            image: /local/netflix.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: Netflix
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            entities: []
            image: /local/plex.png
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: Plex - Free Movies & TV
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/disney1.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: Disney Plus
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/appletv.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: Apple TV
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/amazon1.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: Prime Video
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/discovery.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: discovery plus
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/hbo.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: HBO Max
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/bravo.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: Bravo
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/frndly.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: Frndly TV
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/foxnow.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: FOX NOW
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/espn.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: espn
              target:
                entity_id: media_player.roku_ultra
          - type: picture-glance
            image: /local/roku.png
            entities: []
            tap_action:
              action: call-service
              service: media_player.select_source
              service_data:
                source: bluray
              target:
                entity_id: media_player.onkyo_receiver
        columns: 4
      - type: horizontal-stack
        cards:
          - type: light
            entity: light.media_room
          - type: vertical-stack
            cards:
              - type: entity
                entity: sensor.lamplife
                name: Lamp
                icon: mdi:projector
              - type: entity
                entity: sensor.projector_lamp_hours
                icon: mdi:projector
                name: LampHrs
              - type: entity
                entity: sensor.projector_lamp_status
                name: Status
                icon: mdi:projector
      - type: vertical-stack
        cards:
          - type: media-control
            entity: media_player.epson_projector
          - type: media-control
            entity: media_player.onkyo_receiver
          - type: media-control
            entity: media_player.roku_ultra
          - type: entity
            entity: sensor.aspect_ratio
            icon: mdi:theater
          - type: entity
            entity: sensor.plex_status
            icon: mdi:plex
1 Like

Anyone knows how to customize the look and feel of the media source ā€œbuttonā€. I would like to either be able to edit the default down-arrow to something else, position, size etc, or call the same source list from a template button. Any ideas to this?

image

Yeah itā€™s a shame, smart home industry is still so fragmented still. Iā€™m not sure whether Iā€™m getting old and being more particular with my time or Iā€™m getting lazier but Iā€™m losing motivation in this space and thinking of just living a simple life :joy:

@pdefoy did you ever find a solution for this?