I have an issue with my sonos binding. All the media items (currenttitle, currentalbum, currentalbumarturl, currenttrack) stay UNDEF. Other items like volume, control and mute are working. But I see the track information in the log:
2022-12-27 20:24:28.356 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'LastChange':'<Event xmlns="urn:schemas-upnp-org:metadata-1-0/AVT/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/"><InstanceID val="0"><TransportState val="PLAYING"/><CurrentPlayMode val="NORMAL"/><CurrentCrossfadeMode val="0"/><NumberOfTracks val="1"/><CurrentTrack val="1"/><CurrentSection val="0"/><CurrentTrackURI val="x-rincon-mp3radio://https://orf-live.ors-shoutcast.at/wie-q2a"/><CurrentTrackDuration val="0:00:00"/><CurrentTrackMetaData val="<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="x-rincon-mp3radio:*:*:*">x-rincon-mp3radio://https://orf-live.ors-shoutcast.at/wie-q2a</res><r:streamContent>Adele - Water Under The Bridge</r:streamContent><r:radioShowMd></r:radioShowMd><r:streamInfo>bd:0,sr:0,c:0,l:0,d:0</r:streamInfo><upnp:albumArtURI>https://cdn-profiles.tunein.com/s44255/images/logoq.jpg?t=637855740180000000</upnp:albumArtURI><dc:title>wie-q2a</dc:title><upnp:class>object.item</upnp:class></item></DIDL-Lite>"/><r:NextTrackURI val=""/><r:NextTrackMetaData val=""/><r:EnqueuedTransportURI val="x-rincon-mp3radio://https://opml.radiotime.com/Tune.ashx?serial=AET4KLYN4G3DI77GHPQ4NZNCHCNQ&formats=aac,mp3&id=s44255&partnerId=rjyYMwEH"/><r:EnqueuedTransportURIMetaData val="<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><dc:title>89.9 Radio Wien Wien, Austria</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/"></desc><r:tiid>7862e956-934d-456a-b36e-0c227917d47b</r:tiid><upnp:albumArtURI>https://cdn-profiles.tunein.com/s44255/images/logoq.jpg?t=637855740180000000</upnp:albumArtURI><r:contentService id="254" imageUrl="https://msp-wordmark-logos.s3.amazonaws.com/tunein_wordmark_white.svg" name="TuneIn"/></item></DIDL-Lite>"/></InstanceID></Event>' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.361 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'EnqueuedTransportURIMetaData':'<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><dc:title>89.9 Radio Wien Wien, Austria</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/"></desc><r:tiid>7862e956-934d-456a-b36e-0c227917d47b</r:tiid><upnp:albumArtURI>https://cdn-profiles.tunein.com/s44255/images/logoq.jpg?t=637855740180000000</upnp:albumArtURI><r:contentService id="254" imageUrl="https://msp-wordmark-logos.s3.amazonaws.com/tunein_wordmark_white.svg" name="TuneIn"/></item></DIDL-Lite>' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.362 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentTrackURI':'x-rincon-mp3radio://https://orf-live.ors-shoutcast.at/wie-q2a' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.363 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'NextTrackMetaData':'' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.363 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'InstanceID':'0' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.364 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentTrackMetaData':'<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><res protocolInfo="x-rincon-mp3radio:*:*:*">x-rincon-mp3radio://https://orf-live.ors-shoutcast.at/wie-q2a</res><r:streamContent>Adele - Water Under The Bridge</r:streamContent><r:radioShowMd></r:radioShowMd><r:streamInfo>bd:0,sr:0,c:0,l:0,d:0</r:streamInfo><upnp:albumArtURI>https://cdn-profiles.tunein.com/s44255/images/logoq.jpg?t=637855740180000000</upnp:albumArtURI><dc:title>wie-q2a</dc:title><upnp:class>object.item</upnp:class></item></DIDL-Lite>' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.364 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentCrossfadeMode':'0' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.365 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'NextTrackURI':'' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.365 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentPlayMode':'NORMAL' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.366 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentTrackDuration':'0:00:00' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.366 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentTrack':'1' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.367 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'NumberOfTracks':'1' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.367 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'EnqueuedTransportURI':'x-rincon-mp3radio://https://opml.radiotime.com/Tune.ashx?serial=AET4KLYN4G3DI77GHPQ4NZNCHCNQ&formats=aac,mp3&id=s44255&partnerId=rjyYMwEH' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.367 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentSection':'0' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.380 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentTuneInStationId':'' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
2022-12-27 20:24:28.381 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentTuneInStationId':'' (service 'AVTransport') for thing 'sonos:Five:sonosWohnzimmerLinks'
2022-12-27 20:24:28.382 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentTuneInStationId':'' (service 'AVTransport') for thing 'sonos:Five:sonosWohnzimmerRechts'
2022-12-27 20:24:28.383 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'TransportState':'PLAYING' (service 'AVTransport') for thing 'sonos:One:sonosKueche'
Is it when using TuneIn?
For TuneIn, I got the radio title and the radio logo.
I see in your example that you have info in the XML tag “r:streamContent”. I am not sure we are parsing it but I will check.
It’s is TuneIn, but startet with an Amazon echo (Alexa).
I’am not sure what I should provide. I do not find an AVTransportURI on my sonosKueche which is playing:
Only:
'CurrentTrackURI':'x-rincon-mp3radio://https://orf-live.ors-shoutcast.at/wie-q2a' (service 'AVTransport') for thing 'sonos:zoneplayer:sonosKueche'
2022-12-27 19:53:19.655 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair
'EnqueuedTransportURI':'x-rincon-mp3radio://https://opml.radiotime.com/Tune.ashx?serial=AET4KLYN4G3DI77GHPQ4NZNCHCNQ&formats=aac,mp3&id=s44255&partnerId=rjyYMwEH' (service 'AVTransport') for thing 'sonos:zoneplayer:sonosKueche'
2022-12-27 19:53:19.658 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair
I found this for my sonosWohnzimmer, which is part of the group:
'AVTransportURI':'x-rincon:RINCON_48A6B8DBE3AE01400' (service 'AVTransport') for thing 'sonos:zoneplayer:sonosWohnzimmer'
The sonos app shows the radio station, interpret and title and a TuneIn logo.
The relevant information seems to be here:
'EnqueuedTransportURIMetaData':'<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="-1" parentID="-1" restricted="true"><dc:title>89.9 Radio Wien Wien, Austria</dc:title><upnp:class>object.item.audioItem.audioBroadcast</upnp:class><desc id="cdudn" nameSpace="urn:schemas-rinconnetworks-com:metadata-1-0/"></desc><r:tiid>7862e956-934d-456a-b36e-0c227917d47b</r:tiid><upnp:albumArtURI>https://cdn-profiles.tunein.com/s44255/images/logoq.jpg?t=637855740180000000</upnp:albumArtURI><r:contentService id="254" imageUrl="https://msp-wordmark-logos.s3.amazonaws.com/tunein_wordmark_white.svg" name="TuneIn"/></item></DIDL-Lite>' (service 'AVTransport') for thing 'sonos:zoneplayer:sonosKueche'
'CurrentTrackURI':'x-rincon-mp3radio://https://orf-live.ors-shoutcast.at/wie-q2a' (service 'AVTransport') for thing 'sonos:zoneplayer:sonosKueche'
For radio, you should get information through the channel “currenttrack”. In your example, this channel should cumulate your radio title follwoed by " - Adele - Water Under The Bridge".
The channels 'currentalbum" and “currentartist” are not set in case of radio.
Edit: no logic was implemented to extract artist and album from the “r:streamContent” XML tag, probably because there is not one unique pattern.
Please also check that you did not enter a URL for OPML in the binding configuration parameter. In that case, the retrieval of content information for radio is a little different and uses a specific HTTP request to get them.
This is does not work in my case. I have tested now, there is a difference between starting TuneIn radio station from the Alexa (my case) or with the Sonos App. If I start it from the Sonos App, then everything is working fine.
That is not a good news to me, because it seems that this is the only location where info can be found. I’am wondering, how the Sonos App is working because in the App, the radio station and title information is shown, regardless if started from Alexa or from the app.
Normally, tunein started from Amazon Echo is already implemented.
What I really need is your value of AVTransportURI or CurrentURI, something like this:
2023-01-02 19:26:22.492 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'AVTransportURI':'x-sonosapi-stream:s6586?sid=254&flags=32' (service 'AVTransport') for thing 'sonos:PLAY5:chambre'
2023-01-02 19:26:22.495 [TRACE] [s.internal.handler.ZonePlayerHandler] - Received pair 'CurrentURI':'x-sonosapi-stream:s6586?sid=254&flags=32' (service 'AVTransport') for thing 'sonos:PLAY5:chambre'
This will be log only if before you were playing something else than tunein (spotify or a local MP3 file for example).
What I expect when tunein is started from Amazon Echo is that this value contains x-rincon-mp3radio: and http://opml.radiotime.com/Tune.ashx.
If it does not contain both, something changed and a fix is needed.
They are missing only if they do not change.
So you just need first to start a different audio service and then when you start tunein through Alexa, they should finally appear.
Hi, feature id was correct and the binding is working now.
I can confirm that the fix is also working and the informations about the current title and album is working now with my Alexa.
Thank you very much for the fast bugfix!
Best,
Michael