Retreive metadata of media from media player

Hi,
I would like to create an automation condition for “media player” that matches only if media player, via Sonos integration, is playing a specific source.

I think this is possible because the media player card in dashboard shows the metadata (the radio station name and the profile picture) but I couldn’t figure out how to extract these information for automation condition.

Thanks in advance.

I found how to retrieve the information (media_title) using template
{{state_attr("media_player.speaker", "media_title")}}

2 Likes