How to set the media_title attribute of a media_player

Hi,
I’ve setup some scripts to play internet radio stations on my chromecast media player.
Unfortunately there is not a lot information about those streams shown in the media player lovelace UI, mainly because the chromecast media player doesn’t extract stream data.
So I started creating a sensor that pulls metadata from the stream via a command line sensor using ffprobe. It works quite good so far but I can’t get it to show up in the media player UI.

Is there a way to set e.g. the media_title attribute of a media player? That would make it a much better experience in the Lovelace UI.

You’ll have to check the attributes you have on your media_player entities. I don’t have a Chromecast so I’m not sure what is available, but for my Sonos I have:

  • media_content_type: music
  • media_duration:
  • media_position:
  • media_position_updated_at:
  • media_title:
  • media_artist:
  • media_album_name:

All of which I would assume you can set yourself externally.
If you EVER see data on your Chromecast for the media playing, that’s when you should look in your Developer Tools so you can see the format for each of those attributes.

1 Like

If you set media_title the integration will set it back again - at least that is my experience when casting youtube. Would you like to post your script and I’ll try with one of your streams.