Lovelace: Mini Media Player

Yes.
As I expected, the kodi component seem to expose “media_season” and “media_episode” even if it’s a movie playing and they shouldn’t (in my opinion) be there, it does even seem to expose “media_album_name” and “media_series_title”, although those are empty.
I guess I’ll have to add additional logic that checks media type and hide irrelevant attributes.
Please open an issue regarding this on GitHub, thanks.

What are those icon color changes you mention, and where are they coming from?
The icons color is based on the theme variable --paper-item-icon-color.

Sure, it does have the correct media content type exposed, but unlike other components I’m familiar with it also seem to expose “media_season” and “media_episode” even though it’s a movie playing, which in my opinion is wrong and is why you see “S-1 - E-1” it in the media information right now.
As mentioned above I might have to add additional logic to filter irrelevant attributes based on content type.

They are coming from custom ui. I am still trying to figure out what changed in 0.85 everything was fine before that.

so I have a theme:

illuminance:
  label-badge-red: '#fbda84'  
  paper-item-icon-color: '#f9c536'

Also have a custom ui component in customize glob for media players:

media_player.*:
  custom_ui_state_card: state-card-custom-ui
  templates:
    icon_color: >
      if (state === 'on') return 'rgb(249,197,54)';
    theme: >
      if (state === 'on') return 'illuminance';

Icon colors do change in entities card. Other than that I am not able to change the icon color in mini media player when state changes.

Okay, I’ve never used custom-ui, so I’m not familiar with it, I actually didn’t even know it worked with Lovelace, does it?

I don’t think so…

From what I’ve seen, people have used your Button-card to replicate what they previously had in custom-ui due to custom-ui not being compatible with Lovelace

Custom ui worked perfectly with lovelace (for me at least, changing badge colors, icon colors in all the cards I have) until hass 0.85. It still works for entity cards in hass 0.87. But not in mini media player.
So if not with custom ui, would it be possible to change the icon color depending on state, just like power_state?

Okay. can’t help you with custom ui related stuff, sorry.

Sure, put up and issue on GitHub and I’ll see if I can add it.

Just put up an issue on github.
Thank you.

1 Like

@NicoS Are you still using this addon?
If you (or anyone else) are in fact still using it.
How do you send tts messages through it? Utilizing the notify service?
I would like to add tts support for it.

Yes, I’m using the Notify service. However I’m looking for other options atm as Google changed the broadcast to always add “Broadcast from xxxx” before every broadcast. This was not the case before.

notify:
  - name: Google Assistant
    platform: rest
    resource: http://[xxx.x.x.xxx]:5000/broadcast_message
1 Like

Thanks for the info,
Yes, that’s unfortunate.
I think I’ll add support for this anyway, however targeting a specific entity or specifying language won’t be compatible with it.

NEW RELEASE v1.0.1

A smaller update this time, idle view now supports the state standby, shortcuts can trigger scripts, a few fixes & more.

Changelog

  • NEW: Support for Standby state in idle view, see idle_view -> when_standby (#73)

  • NEW: Option icon_state, change icon color depending on entity state (#77)

  • NEW: Shortcut items can now trigger scripts (#76)

  • NEW: TTS Support for hass.io addon: Google Assistant Webserver and similar solutions

  • CHANGE: Artwork border is now hidden by default

  • FIXED: Sonos sync_volume not working as expected (#72)

  • FIXED: Progress not visible with group option and not collapsed (#71)

  • FIXED: Hide season and episode information if current media is a movie

  • UPDATE: LitElement dependency to v2.0.1

1 Like

thank you
sonos sync is now working. perfect

1 Like

I am trying to setup mini media player on hassbian. This is my first custom component and I have created a www folder in my configuration folder in /home/homeassistant/.homeassistant. I have placed the resource line in my ui-lovelace.yaml file (url: /home/homeassistant/.homeassistant/www/mini-media-player-bundle.js?v=1.0.1) but home assistant is still saying custom component does not exist. I am not sure what I am doing wrong.

did you restart home assistant after you created www?

Yes I did. I am unable to access homeassistant on the web browser using .local and have to use the ip address of the pi. Does this affect the resource line that I need to place in the ui-lovelace.yaml file?

did you try /local/mini-media-player-bundle.js?v=1.0.1

1 Like

That works. Thank you.

1 Like

In the shortcut item objects the ID of a source must be the same as in /states ? Or what?
EDIT: I have also problems about artwork for echo devices… no artwork showed.
Here it is an extract of my config:

  - type: custom:card-modder
    card:
      type: entities
      title: Amazon Echo
      show_header_toggle: false
      entities:
        - entity: media_player.echo_spot_di_maurizio
          type: custom:mini-media-player
          group: true
          icon: 'mdi:amazon'
          artwork: full-cover
          icon_state: true
          max_volume: 60
          hide:
            power_state: false
            mute: false
            volume: false
            progress: false
            source: false
          idle_view:
            when_idle: true
            when_paused: true
            when_standby: true

Here it is the screenshot…

47

Actually i am playing another song but the card shows not playing with the title of another song…

Yes, the exact string found in /dev-state.

Again, check dev-state and make sure the data has been updated, sometimes it can take a while and some components are in my experience slower than others. The card just compute and render the entity attributes/state data so if this data isn’t “up to date” there’s nothing I can do.

Ok, and what about the artwork and the icons? Why they are not showed?
And the ID can ben the friendly_name set in /dev-state?