openHAB integration to Spotify Web Connect API (player)

@pmpkk First of all, thanks for your work on your fantastic ‘matrix’ theme, really nice theme and also a great starting point for me to learn how to customize my own panels/themes.

I also installed your spotify script to enable Spotify playback from HABPanel and it’s working great so far. The only thing I cannot seem to get to work (but this is probably related to the Spotify API) is to get access to my different devices for playback.

I have several Sonos speakers in my house, a spotify client on my Windows PC and several mobile devices with a Spotify app. When I query my devices using the ‘spotify.py’ script I cannot see any of my devices - this is not a problem of the script, when I try the Spotify API web console I get the same result. The permissions are okay (scope) and my access key is also working, but I just cannot see my Sonos devices…

Did you have to perform some additional task to get the Sonos devices to show?

EDIT: To elaborate, when I see the Sonos player data from the Spotify API return, it doesn’t show a device_id (NULL), only a device name.

Successfully posted state to OpenHab: spotify_current_track = Sfumato - Kerri Chandler Remix
Successfully posted state to OpenHab: spotify_current_artist = Matthias Tanzmann
Successfully posted state to OpenHab: spotify_current_cover = https://i.scdn.co/image/17aa60d54abd913270aba8680840ae43c2f237d6
Successfully posted state to OpenHab: spotify_current_duration = 432286
Successfully posted state to OpenHab: spotify_current_progress = 132958
Successfully posted state to OpenHab: spotify_current_playing = ON
Successfully posted state to OpenHab: spotify_current_device = Office
Successfully posted state to OpenHab: spotify_current_volume = 12
Successfully posted state to OpenHab: spotify_current_context_uri =     spotify:user:spotify:playlist:37i9dQZF1DX2TRYkJECvfC
Successfully posted state to OpenHab: spotify_current_device_id = NULL
Successfully posted state to OpenHab: spotify_current_progress_percent = 30.76
 -> Success
Successfully posted state to OpenHab: spotify_lastConnectionDateTime = 2017-09-20T19:05:28+0000
Done in 0.819099903107 seconds

Additionally, when I open a Chrome tab and use the Spotify Web Player, it does show up as a ‘device’ and I can control it using the widget…

Hope you can help!