I want to have a couple of TuneIn channels start on different occasions, which I am doing with a script:
sequence:
- service: media_player.play_media
target:
device_id:
- ab1375438eb866229dc620c2f93fb856
- 153737b0746a4585374a87bc1a5281af
data:
media_content_id: >-
x-rincon-mp3radio://listen.radiotunes.com/premium_high/hit70s.pls?listen_key=XXXXXXX
media_content_type: music
mode: single
alias: Play 70s Hits
But when I do this, the Sonos shows in the âNow playingâ view, not the radio channelâs name, but instead the last part of the URL, after the last â/â. This is not pretty, and a bit annoying. Is there some way to make it show something else there instead? I tried with âmedia_channel: â70s Hitsââ and âsource: â70s Hitsââ, but that wasnât accepted.
I use Mini Media Player and have some button presets within it that allow me to pick from UK stations on Tune In - bit different to what youâve done but might help?
buttons:
- id: media_player.select_source
cover: /local/bbcradio5.png
type: service
data:
entity_id: media_player.kitchen_sonos
source: BBC Radio 5 live
- id: media_player.select_source
cover: /local/bbcradio2.png
type: service
data:
entity_id: media_player.kitchen_sonos
source: BBC Radio 2
- id: media_player.select_source
cover: /local/timesradio3.png
type: service
data:
entity_id: media_player.kitchen_sonos
source: Times Radio
I think I got the source name from the name of the station when itâs playing. The cover is just a local image so it looks better in the widget. Iâd have thought you could use the same type of source in your automations.
I think the difference is youâre using âplay_mediaâ rather than âselect_sourceâ.
Some of the radio station names/metadata were bothering me so I opened this PR. Hopefully this will fix the display for other stations without needing to add them as a favorite.
Do you have any advice about radio station metadata? Seems related but apologies if I am posting in the wrong place.
So good when BBC recently became a music source on Sonos - I can listen to my radio subscriptions using the Sonos app - excellent. However most of the time I just listen to live radio controlled by HA. Perfect. No more TuneIn radio stations for BBC.
Apart from a tiny niggle. Not crucial but it annoys me that I canât find a solution.
When I select a BBC radio station (set as a Sonos favourite) my mini-media player Lovelace card momentarily shows the correct name of the programme. A few seconds later it changes to add some unparsed data. And it never updates - itâs static - it doesnât update to show the next programme.
Using developer tools, the entity state attributes include for example:
media_title: âSketches: Stories of Art and Peopleâ
but if I refresh a couple of seconds later, this changes to:
media_title: 'Sketches: Stories of Art and People ⢠BR P|TYPE=SNG|TITLE |ARTIST |ALBUM â
and then the media_title is static thereafter.
Seems odd behaviour. If you have any suggestion as to what is going on, I would appreciate a nudge in the right direction - but I accept I may just need to live with this.
Possibly bad metadata provided with the radio station. Can you create a github issue here for the Sonos integration? Iâm guessing it may need to be addressed in the underlying library, but would need to gather some info from you first.
Edit: Iâm not sure if BBC is region-locked, but Iâm not able to add it as a source in the US to test.