[SOLVED] Sonos - Cover Art not working

Hi :slight_smile:

Im trying to set up Sonos in openHAB, and I’m using Spotify (premium) as music source

Things file (udn part anonymised)

Thing sonos:PLAY1:living [ udn="RINCON_xxxxxxxxxxxxxx400", refresh=60, notificationVolume=25]  //Left speaker
Thing sonos:PLAY1:living [ udn="RINCON_yyyyyyyyyyyyyy400", refresh=60, notificationVolume=25]  //Right speaker

sonos.item file

Player	Sonos_Controller   "Controller"                          	(gSonos) {channel="sonos:PLAY1:living:control"}
Dimmer	Sonos_Volume       "Volume [%.1f %%]" <soundvolume>      	(gSonos) {channel="sonos:PLAY1:living:volume"}
Switch	Sonos_Mute         "Mute"             <soundvolume_mute>	(gSonos) {channel="sonos:PLAY1:living:mute"}
Switch	Sonos_LED          "LED"              <switch>           	(gSonos) {channel="sonos:PLAY1:living:led"}
String	Sonos_CurrentTrack "Now playing [%s]" <text>             	(gSonos) {channel="sonos:PLAY1:living:currenttrack"}
String	Sonos_State        "Status [%s]"      <text>             	(gSonos) {channel="sonos:PLAY1:living:state"}
String	Sonos_CurrentAlbumartUrl 	"AlbumCoverUrl [%s]" 			(gSonos) {channel="sonos:PLAY1:living:currentcoverarturl"}
Image	Sonos_CurrentAlbumArt 	"AlbumCover [%s]"					(gSonos) {channel="sonos:PLAY1:living:currentcoverart"}

sonos.sitemap file

sitemap sonos label="Sonos"
{
		Frame label="Sonos" {
			Default item=Sonos_Controller
			Slider  item=Sonos_Volume
			Switch  item=Sonos_Mute
			Switch  item=Sonos_LED
			Text    item=Sonos_CurrentTrack		
			Text    item=Sonos_State
			Image	item=Sonos_CurrentAlbumartUrl
		}
}

Everything is working just fine (Volume up/down, play, Current Track etc.) execpt from AlbumArt :frowning:
I guess I’m missing something, but cannot figure ou what I’m missing ??

I’m not seeing any errors in the openhab.log, but I do see this warning when I open the Sonos.Sitemap

2018-11-03 16:40:07.761 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /proxy
java.lang.NullPointerException: null

Does anyone have any ideas what I have done wrong/ am missing?

/Lars

Hey Lars,

Here’s my stuff for Sonos and I play Spotify all day long and everything works.

Things:

Thing sonos:PLAY1:LivingRoom				[ udn="RINCON_7828CAAabc123", refresh=60, notificationVolume=40 ]

Items:

Player Sonos_LivingRoom_Controller  			"Controller"                        				        { channel="sonos:PLAY1:LivingRoom:control" }
Dimmer Sonos_LivingRoom_Volume      			"Volume [%.1f %%]" <soundvolume>    				(Sonos) { channel="sonos:PLAY1:LivingRoom:volume" }
Switch Sonos_LivingRoom_Mute        			"Mute"             <soundvolume_mute>				(Sonos) { channel="sonos:PLAY1:LivingRoom:mute" }
String Sonos_LivingRoom_CurrentTrack			"Now playing [%s]" 			        				(Sonos) { channel="sonos:PLAY1:LivingRoom:currenttrack" }
String Sonos_LivingRoom_CurrentAlbumCoverArtURL	"URL [%s]"											(Sonos) { channel="sonos:PLAY1:LivingRoom:currentalbumarturl" }
Switch Sonos_LivingRoomPlayOrPause				"LivingRoom [MAP(sonos_play_pause.map):%s]"			(Sonos)	[ "Switchable" ]
Switch Sonos_LivingRoom_StandAlone            	"Stand Alone"               								{ channel="sonos:PLAY1:LivingRoom:standalone" }
String Sonos_LivingRoom_ZoneGroupID           	"Zone Group ID [%s]"               							{ channel="sonos:PLAY1:LivingRoom:zonegroupid" }
String Sonos_LivingRoom_ZoneName              	"Zone Name [%s]"                    						{ channel="sonos:PLAY1:LivingRoom:zonename" }
String Sonos_LivingRoom_Coordinator           	"Coordinator [%s]"          								{ channel="sonos:PLAY1:LivingRoom:coordinator" }
String Sonos_LivingRoom_Remove                	"Remove [%s]"                           					{ channel="sonos:PLAY1:LivingRoom:remove" }
Switch Sonos_LivingRoom_LocalCoordinator      	"Local Coordinator"                     					{ channel="sonos:PLAY1:LivingRoom:localcoordinator" }
Switch Sonos_LivingRoom_Stop        			"Stop Player"                     							{ channel="sonos:PLAY1:LivingRoom:stop", autoupdate="false" }
Switch Sonos_LivingRoom_ClearQueue      		"Clear Queue"                     							{ channel="sonos:PLAY1:LivingRoom:clearqueue" }

Sitemap:

	Frame label="Sonos Living Room" {
		Default item=Sonos_LivingRoom_Controller
		Slider  item=Sonos_LivingRoom_Volume
		Switch  item=Sonos_LivingRoom_Mute
       	Text	item=Sonos_LivingRoom_CurrentTrack
		Text	item=Sonos_LivingRoom_CurrentAlbumCoverArtURL		label=""
		Switch  item=Sonos_LivingRoom_StandAlone
		Text	item=Sonos_LivingRoom_ZoneGroupID
		Text	item=Sonos_LivingRoom_ZoneName
		Text	item=Sonos_LivingRoom_Coordinator
		Text	item=Sonos_LivingRoom_Remove 
		Switch	item=Sonos_LivingRoom_LocalCoordinator
		Switch	item=Sonos_LivingRoom_Stop
		Switch	item=Sonos_LivingRoom_ClearQueue
	}

Hope this helps . . .

Best, Jay

Lars,

I use the Plex binding and had similar issues with displaying the cover art.
One thing that might be worth trying is change your sonos.item file to remove the formatting for the cover art url
Try this

String	Sonos_CurrentAlbumartUrl 	"AlbumCoverUrl" 			(gSonos) {channel="sonos:PLAY1:living:currentcoverarturl"}

This could help as you want to resolve the url and not display it.
Mick

Hi both

Thank you both, for pointing me in the right direction
The issue was me - I had made a typo

The description says “Cover art URL of the album currently playing” but the Channel Type ID is “currentalbumarturl” (I had typed “currentcoverarturl”) :roll_eyes:

Everything is working now :+1:

/Lars