Lovelace: Mini Media Player

I know my Denon AVR show artwork from internet radio stations.

The artwork is grabbed from what’s reported by the players backend component. Sounds like either the echo or the echo component isn’t supporting artwork for radio stations.
If that’s the case I can’t really do anything about it.

Great card, love it!

I have a small problem though. This card uses ‘toggle’ on a power button press. The default ‘toggle’ behavior for a media player is like this:

if self.state in [STATE_OFF, STATE_IDLE]:
    return self.async_turn_on()
return self.async_turn_off()

I have a KODI player and it is often idle. You card shows a golden power button - and that is correct since it is really powered. When I press the button I expect the power to be turned off, but an attempt is made to turn it on again.
I do not know what is the best way to modify it and which component is responsible, probably the default media player behavior is wrong.
But could it be possible to modify your card as to use explicitly ‘turn_on’ and ‘turn_off’ services as a special option?

1 Like

Thanks for the detailed explanation!
I see what you mean, and understand the issue.

I could add an option to use turn on / turn off services instead of toggle and consider idle as on.
I wonder what I should name the option though :thinking: :laughing:

What do you think about this #aeb990d?

Now you would be able to set toggle_power: false to have the card call turn_on / turn_off instead of toggle. Defaults to true.

New version: v0.8.9

  • Added: toggle_power option, to be able to change power button behaviour

  • Added: show_shuffle option, to display a shuffle button

  • Added: consider_idle_after option, to display player as idle after x amount of time

  • Fixed: error when sending tts message after v0.8.8 update

  • Removed: cleaned up redundant code

4 Likes

I think the artwork issue is something inherent in the way that HA grabs the stream. If I ask my Google Home to stream a radio station to a media player, the mini media player will show the artwork, artist, song etc. but if I use my radio station streaming code within HA to just grab the stream, there is no artwork or artist / song info displayed…

Maybe the streams don’t even provide any metadata?

Maybe… but the same stream has this data if Google grabs it and streams it.

What do you mean, if Google grabs it?

If I use voice and ask a Google Home device “Hey google, stream blah blah from Tune-in radio”, then the mini media player (and also the standard one) will show all the artist / track data, but if I use a link that I obtained for that same stream and send it to the Google Cast device (home or chromecast audio) then that data is not displayed.

Just ran into this, it’s spectacular. Are there rules here about fawning praise posts?

1 Like

Ok, I would guess that TuneIn probably is responsible for that metadata, and not the actual raw stream.

Haha, thank you! Not that I’ve heard of :wink:

Thanks a lot for such a quick response! I will check a bit later and report.

1 Like

Thanks a lot once more! Works perfectly!

1 Like

Perfect, thanks for the feedback!

New version: v0.9.0

  • Added: bundle version, to avoid externally loaded dependency #21

  • Updated: instructions to include bundle instead of source #21

  • Updated: tracker.json with bundle version #21

I recommend everyone to go through the install instructions again. You don’t have to, BUT if you don’t, you’ll continue loading the external dependency.

Bundling the dependencies instead of loading them externally will both make the card load faster and available offline.

2 Likes

Amazing work @kalkih this is really taking shape!

I’ve been playing with TileBoard to setup on a few tablets / phones around the house and this media player being so much better it has made be reconsider at least for the controllers I will largely use for audio!

https://community.home-assistant.io/t/tileboard-new-dashboard-for-homeassistant

Great work on this!

1 Like

Love this and works great! Thanks a lot!

One question - is it possible to hide media information alone? My use case is that I have three Sonos speakers that always are grouped and playing the same thing. Would love to list them with only entity name, mute and volume.

03

1 Like

Sure, will add this next update :+1:

Thanks a lot :slight_smile: