Sonos Binding, SiriusXM - No album art, artist, track, title

With the Sonos binding, I can get the above info when I listen to Pandora and TuneIn Radio.

But with SiriusXM stations, this information is not exposed. It does show up in the Sonos Iphone app, so it should be possible to get it.

Here are some sample logs when I change stations.

17:54:20.827 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTrack changed from Money Radio 1510 - The Investors Edge - Business - 11m remaining to Money Radio 1510 - The Investors Edge - Business - 5m remaining
17:54:31.884 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTrackURI changed from aac:// to x-sonosapi-hls:r%3aclassicvinyl?sid=37&flags=8480&sn=2
17:55:24.438 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTrackURI changed from x-sonosapi-hls:r%3aclassicvinyl?sid=37&flags=8480&sn=2 to x-sonosapi-hls:r%3athebridge?sid=37&flags=8480&sn=2
17:55:24.438 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTrackURI changed from x-sonosapi-hls:r%3aclassicvinyl?sid=37&flags=8480&sn=2 to x-sonosapi-hls:r%3athebridge?sid=37&flags=8480&sn=2
17:56:29.343 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Sonos_Office_Favorite' received command 14 - The Coffee House
17:56:29.352 [INFO ] [arthome.event.ItemStatePredictedEvent] - Sonos_Office_Favorite predicted to become 14 - The Coffee House
17:56:29.366 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_Office_Favorite changed from 18 - The Beatles Channel to 14 - The Coffee House
17:56:29.920 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTrackURI changed from x-sonosapi-hls:r%3athebridge?sid=37&flags=8480&sn=2 to x-sonosapi-hls:r%3acoffeehouse?sid=37&flags=8480&sn=2
17:58:11.599 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTitle changed from Money Radio 1510 to KSLX-FM 100.7
17:58:11.602 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTrack changed from Money Radio 1510 - The Investors Edge - Business - 5m remaining to KSLX-FM 100.7 - Pete Cummings - Classic Rock - 1h, 1m remaining
17:58:11.641 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentAlbumArtUrl changed from to
17:58:11.644 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_State changed from PLAYING to STOPPED
17:58:11.646 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_Controller changed from PLAY to PAUSE
17:58:11.771 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentAlbumArt changed from raw type (image/png): 14323 bytes to raw type (image/jpeg): 4354 bytes
17:58:13.584 [INFO ] [smarthome.event.ItemStateChangedEvent] - Sonos_CurrentTrackURI changed from x-sonosapi-stream:s35395?sid=254&flags=8224&sn=0 to aac://

Any thoughts on how this feature can be added?

I suppose the proper way to do this is to run wireshark and inspect the traffic. Then extract this metadata from the audio stream. I am a novice at wireshark, but in my initial attempts, I don’t see this information coming across. Perhaps it is encrypted, as this is a paid subscription site.

Another way I thought was going polling the “now playing” section of the siriusxm website. For example, if I am listening to the channel called “Deep Tracks”, the webpage has a section called “On the air” that shows the song, artist and album art. For example, when I right click in the chrome browser on the album art, to inspect the html, I get the following reference, which I can put in a browser and get the album art.

Likewise, the webpage shows:

<p class="onair-pdt-artist">John Mellencamp</p>
<p class="onair-pdt-song">China Girl</p>

We’d probably have to ping the website every 10-15 seconds to catch the change of song. You don’t have to be logged on get this information.

I don’t code, but I can test.

I agree that the information shows up on the Sonos App, but does not show though the Sonos Binding. (I’m connected to Harmony FM.)

@jacksteraz were you ever able to get any of this resolved? I can confirm I’m having the same issue and with wireshark I do not see traffic happening. I am not much of a coder myself but I think your thought about creating a rule to go and scrape the page is a great one! Possibly there is a way to request data from the sonos too via the SMAPI directly.

No. I am not a coder and never figured out how to do this.

Old thread, I know, but I recently encountered this issue myself. I’m a coder of sorts and I believe I have tracked down the problem. Unfortunately, I’m running openHAB on a Raspberry PI and, long story short, I’m unable to set up a development environment to test my theory. Even so, here’s what I have found - perhaps someone with a development environment on another platform can test my change and create a pull request to make the changes in openHAB.

I believe the issue is in the file which is located in openhab-addons/bundles/org.openhab.binding.sonos/src/main/java/org/openhab/binding/sonos/internal/handler. More specifically, in line beginning on line 1418, there is a group of cascading if statements that test for various states of the player. Depending on what’s being played (Amazon, Radio, Album, etc.), different tasks are required to save the state of the player. This state is used elsewhere in the add-on to update art, artist, track and title. From what I can tell, there is no test for Sirius XM playback, and so this code falls through to line 1488, which sets the saved state to null, so no updates are issued. It seems likely that the developer lacked a Sirius XM account and was therefore unable to develop/test this use case.

When playing back a Sirius XM station, the URI for the track begins with “x-sonosapi-hls:”. I believe a test for this condition needs to be added in the cascading if statements and the appropriate actions taken to properly update the state information. If someone is willing to take this on, I’d be happy to help track down the right information and test.

1 Like