Closed SurreyMichael closed 2 years ago
Hey there @cgtobi, @jjlawren, mind taking a look at this issue as it has been labeled with an integration (sonos
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
sonos documentation sonos source (message by IssueLinks)
Additional info:
I checked with the Sonos app on my laptop (i.e. not HA). When I select a radio station, the Sonos app shows the station and name and a station picture. After a few seconds this changes to show a picture of the specific programme playing. On talk channels it continues to show the station name. On a music channel, it updates to show the track/artist currently playing.
So Sonos seems to know what the metadata means.
(I tried to paste a screenshot but it didn't work)
I was about to ask you to run some python scripts using the underlying library, but then I realized an upcoming HA feature would make this way easier. In 2022.2 you'll be able to grab a diagnostics dump from an integration, so I added this: https://github.com/home-assistant/core/pull/64576. That should give us all of the raw information we'll need to figure out what's going on here.
If you're feeling adventurous, you can run a 2022.2 beta release (once it's out) to collect the data, but otherwise hopefully you can live with this until the next release.
No worries about waiting - this is a nice to have, not need. I'll look out for the beta - but I confess to knowing enough to get me into trouble and not enough to get me out.
Can I take the opportunity to thank you for what you do? And your collaborators. Home Assistant has been useful in my home and fun to learn - I use the Sonos integration every day of my life and it is better for it. Many thanks.
@SurreyMichael if you're on 2022.2.X, grabbing diagnostics for the Sonos integration (or the specific speaker) after the metadata appears incorrect should hopefully give us enough info to understand what's going on.
OK - here is a diagnostics file. I am playing a radio station - BBC Radio 4. My lovelace card shows the title correctly for the program that was playing when I first selected the station "The Curious Case of Rutherford and Frye" - but has not updated now that the program has changed. When I play a music radio station, it correctly shows the track being played and updates.
sonos-616bda02be3f436bae503709c8f08738-Living Room-c91e1c69d76c4859a671e7f5b4792872.json-2.txt
Okay, looking at the diagnostics, the best we can make is "Radio 4 • The Curious Cases of Rutherford & Fry" which is "<channel>
• <radio_show>
". There's just nothing else provided by BBC in the metadata.
Although I can't seem to add the BBC music service, I can access a few BBC stations through TuneIn. Are you able to reproduce the same issues with those BBC stations? If so, then I could try to reproduce locally. I've tried a couple stations but none seem to include any info besides the radio show name--no artist/track/etc.
If those TuneIn stations don't behave in the same way, having a comparison that includes the integration diagnostics along with a screenshot of what the native Sonos app is showing would be very useful.
Thanks for looking at this. So "Radio 4 • The Curious Cases of Rutherford & Fry" was perfect info and displayed correctly when I started listening. The niggle is that it doesn't update. 30 minutes later the
I guess that may just be because of the Sonos feed rather than the integration.
This really is only a niggle - please don't feel you need to spend time on this!
I'll install a TuneIn version of the station and see what happens - and post more data.
OK - this is diagnostic with a TuneIn version of the station. This time my Lovelace card just shows the radio station name but doesn't show the programme playing - even though it is there in the diagnostic file (following copied from file): "stream_content": "BBC Radio 4 FM", "radio_show": "From Our Own Correspondent Podcast,p111"
If I examine the entity state on the developer tab in HA, I find these entries: (NB the radio show has changed to 'Money Box' since the diagnostic file)
using TuneIn/BBC station....
media_title: BBC Radio 4 FM
media_channel: BBC Radio 4 • Money Box
[Lovelace card displays "BBC Radio 4 FM" - i.e.
I waited for the next radio programme and the
So my workaround is to put a separate Lovelace entity card to show
Back to my much preferred Sonos stations using the BBC Sounds service (sadly not yet available outside UK).... media_title: Radio 4 • Money Box media_channel: Radio 4 • Money Box [Lovelace card displays "Radio 4 • Money Box". So although this metadata happens to include the programme when started, it is static info]
I think
If I switch to a music station (Sonos/BBC Sounds station - BBC Radio 3) media_title: Cantata BWV 36, 'Schwingt freudig euch empor' (VI. Der du bist dem Vater gleich; VII. Auch mit gedämpften) media_artist: Johann Sebastian Bach media_channel: Radio 3 • Inside Music
In this case the
Conclusions:
Many thanks for looking this. Happy to close issue unless you have any further insight.
sonos-616bda02be3f436bae503709c8f08738-Living Room-c91e1c69d76c4859a671e7f5b4792872.json-5.txt
Thanks, that's very thorough. If the data is there it's solvable.
Any chance you've upgraded to 2022.3.1 yet? There's a minor metadata fix included, I'm curious if it has any effect here.
Now updated to 2022.3.1 - can't see any difference on this issue.
But I now realise the problem is with the metadata feed rather than the integration. Listening via Sonos/TuneIn, the
Okay, so it seems the BBC music service simply doesn't update with the new radio show name. It would require keeping the native Sonos app open & active during a transition (which could be hard to time), but that test could prove the theory. If it doesn't change, there's no message we can receive to do the same.
I've contacted the BBC to see if there is a glitch with their BBC Sounds service for Sonos.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
The problem
I have set up BBC Sounds as a music service on Sonos, and added some BBC Radio stations as favourites.
In Home Assistant I use the mini-media player card to control my Sonos system and can successfully select those radio stations. The card correctly picks up from metadata the radio station name against 'source' and also 'media_channel'.
However 'media_title' but this has some strange behaviour:
I suspect this may be a problem with how BBC have implemented their Sonos service but thought I would report.
Examples: (copied from media_player entity attributes in developer tools)
media_content_id: >- x-sonosapi-hls:stations%7eplayable%7e%7ebbc_radio_fourfm%7e%7eurn%3abbc%3aradio%3anetwork%3abbc_radio_four?sid=325&flags=288&sn=15 media_content_type: music media_duration: 0 media_title: Think with Pinker media_channel: 'Radio 4 ' source: Radio 4
a couple of seconds later, the media_title line changes to: media_title: 'Think with Pinker • BR P|TYPE=SNG|TITLE |ARTIST |ALBUM '
subsequently media_title does not change unless I restart the radio station
What version of Home Assistant Core has the issue?
core-2021.12.10
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Sonos
Link to integration documentation on our website
https://www.home-assistant.io/integrations/sonos
Example YAML snippet
Anything in the logs that might be useful for us?
No response
Additional information
No response