Lovelace: Mini Media Player

Okay, I don’t know how I feel about adding this. As @hdaalder mentioned on songs favorite playlists are accessible int he source menu.
Could possibly add this in the future, could be a neat feature.
It’s certainly possible to implement and could be made to work pretty universally, if it’s an actual playlist or just a media url shouldn’t matter. Would require the user to specify content type, media url and name for each entry of the dropdown list in the card configuration.

If anyone is interested in possibly coding this and contributing it through a PR, that would be great.

Strange, never heard of that issue, I’m using denonavr myself and never had the issue.
The card should render the player as off if state === off and as unavailable if state === unavailable.
What does the entity attributes look like when it’s off and what’s the state shown in dev-info?

Try “reinstalling” the card, delete previous files and follow the instructions again. Otherwise try clearing cache / restart HA.

The card will use the default language of the tts service, You can specify the default language of the tts in your configuration.yaml, I guess language would be it for Italian.

tts:
  - platform: google
    language: 'sv'

I’m not that familiar with Sonos, If they are grouped, doesn’t changing source on one of the speakers in the group change them all?

I don’t have any plans to add support for grouping/ungrouping Sonos through the card.

1 Like

nothing to do, keep giving me the card of the first photo

What doesn’t work? I see mini-media-players in both photos. Is it card-modder that doesn’t work?

Yes, right. if you see the first picture there are some gray rectangles around the players that should not be there

1 Like

They are there intentionally, that’s the card background and the color is based on the theme you are using, I did however move the the background from the ha-card to the player class a few updates ago.

I’ll make the card background transparent in next update when group: true is set, should fix the issue you are having.

wow thank you very much!!

1 Like

If you are switching between single play and groups it would be awesome…

Today im doing it by a script but would LOVE to se this integrated i this player :slight_smile:

image

input_select:
radio_station:
name: “Vælg Radio Station”
options:
- DR P3
- DR P4
- NOVA
initial: DR P3
icon: mdi:speaker-wireless
sonos_source:
name: “Vælg Sonos”
options:
- Køkken
- Stue
- Overalt
initial: Køkken
icon: mdi:speaker-wireless

script:
radio:
alias: Play Radio on Sonos
sequence:
- service: media_player.select_source
data_template:
entity_id: media_player.kkken
source: >
{% if is_state(“sonos.source”, “Køkken”) %} media_player.kkken
{% elif is_state(“sonos.source”, “Stue”) %} media_player.living_room
{% endif %}
- service: media_player.play_media
data_template:
entity_id: media_player.kkken
media_content_id: >
{% if is_state(“input_select.radio_station”, “DR P3”) %} : “01-DR P3”
{% elif is_state(“input_select.radio_station”, “DR P4”) %} : “02-DR P4”
{% elif is_state(“input_select.radio_station”, “NOVA”) %} : “03-NOVA”
{% endif %}

Attributes
friendly_name: Woonkamer-TV
supported_features: 20409

Relevant log entries (I only captured the parts with TV in it, I hope it’s enough…):
2018-11-21 14:16:57 INFO (MainThread) [homeassistant.loader] Loaded media_player from homeassistant.components.media_player
2018-11-21 14:16:57 INFO (MainThread) [homeassistant.loader] Loaded media_player.webostv from homeassistant.components.media_player.webostv
2018-11-21 14:17:02 INFO (MainThread) [homeassistant.components.media_player] Setting up media_player.webostv
2018-11-21 14:17:56 WARNING (MainThread) [homeassistant.helpers.entity] Update of media_player.woonkamertv is taking over 10 seconds
2018-11-21 14:17:57 WARNING (MainThread) [homeassistant.components.media_player] Updating webostv media_player took longer than the scheduled update interval 0:00:10
2018-11-21 14:18:18 INFO (MainThread) [homeassistant.components.discovery] Unknown service discovered: webos_tv {‘host’: ‘192.168.xxx.xxx’, ‘port’: 2047, ‘ssdp_description’: ‘http://192.168.xxx.xxx:2047/’, ‘name’: ‘[LG] webOS TV OLED55C7V’, ‘model_name’: ‘LG Smart TV’, ‘model_number’: ‘OLED55C7V-Z’, ‘serial’: None, ‘manufacturer’: ‘LG Electronics’, ‘udn’: ‘uuid:08xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxbee’, ‘upnp_device_type’: ‘urn:schemas-upnp-org:device:Basic:1’}
2018-11-21 14:18:18 INFO (MainThread) [homeassistant.components.discovery] Unknown service discovered: dlna_dmr {‘host’: ‘192.168.xxx.xxx’, ‘port’: 1117, ‘ssdp_description’: ‘http://192.168.xxx.xxx:1117/’, ‘name’: ‘[LG] webOS TV OLED55C7V’, ‘model_name’: ‘LG TV’, ‘model_number’: ‘1.0’, ‘serial’: None, ‘manufacturer’: ‘LG Electronics.’, ‘udn’: ‘uuid:38xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx86d’, ‘upnp_device_type’: ‘urn:schemas-upnp-org:device:MediaRenderer:1’}
2018-11-21 14:26:48 INFO (MainThread) [homeassistant.components.http.view] Serving /api/media_player_proxy/media_player.woonkamertv to 192.168.xxx.xxx (auth: False)
2018-11-21 14:26:48 INFO (MainThread) [homeassistant.components.http.view] Serving /api/media_player_proxy/media_player.woonkamertv to 192.168.xxx.xxx (auth: False)

I like your header background for the media players! very cool. mind sharing?

thank you Sparky…
my lovelace.yaml:

    type: custom:card-modder
    card:
      type: entities
      title: Mediaplayers
      entities:
        - entity: media_player.kodi_salotto
          icon: mdi:kodi
          type: custom:mini-media-player
          show_source: true
          artwork: cover
          idle_view: true
          power_color: true
          hide_volume: false
          scroll_info: true
          show_progress: true
          hide_info: false
          hide_icon: false
          group: true
        - entity: media_player.kodi_camera
          icon: mdi:kodi            
          type: custom:mini-media-player
          show_source: true
          artwork: cover
          idle_view: true
          power_color: true
          hide_volume: false
          scroll_info: true
          show_progress: true
          hide_info: false
          hide_icon: false
          group: true
        - entity: media_player.camera
          type: custom:mini-media-player
          icon: mdi:google-home              
          show_source: true
          artwork: cover
          idle_view: true
          power_color: true
          hide_volume: false
          scroll_info: true
          show_progress: true
          hide_info: false
          hide_icon: false
          show_tts: google
          group: true
        - entity: media_player.soundtouch_camera
          type: custom:mini-media-player
          show_source: true
          artwork: cover
          idle_view: true
          power_color: true
          hide_volume: false
          scroll_info: true
          show_progress: true
          hide_info: false
          hide_icon: false
          group: true
    style:
      background-image: url("/local/risorse_lovelace/music_reflex.png")
      background-repeat: no-repeat
      background-color: rgba(50,50,50,0.3)
      background-size: 100% 68px
      border-radius: 20px
      border: solid 1px rgba(100,100,100,0.3)
      color: '#999999'
      box-shadow: 3px 3px rgba(0,0,0,0.4)
      padding: 12px
2 Likes

this is the file
style:
background-image: url("/local/risorse_lovelace/music_reflex.png

1 Like

I’m not sure what the problem could be, are you nesting the card inside a conditional card or entity-filter? Do you have the same issue when using the default media-control card, that it disappear?

No nesting, and yes the same problem with the default controls. I even thought it was normal default behavior…

Okay, no idea what the issue could be then, sorry.
I suggest you open a separate topic for your issue, I think you’ll have better luck getting help that way.

Sure, no problem. Thanks for your time.

Is there a way to suppress full-cover when there is no cover (like often with streaming services)?

Yes, that’s the default behaviour for full-cover and all other artwork options.
The artwork is only displayed when the player has the attribute entity_picture and when entity_picture isn’t empty.

Ah, ok, the I guess the entity_picture is not properly defined by the ones I am using. Thanks for your great work!

That’s interesting, which media player components are you seeing this issue with?
I’ve had this issue with denonavr specifically, where it sometimes seem to set the entity_picture attribute even though there’s no actual artwork/cover available. Might not be an issue with the component however, could just as likely be the denon receiver.

Unfortunately I have no way of checking if the exposed entity_picture is actually real or not, so I can’t fix this issue, unless anyone has an idea?

It‘s with a Sonos.