Spotify Connect Binding

I had something similar. It looks related to the http timeout I reduced. It looks like this causes it to silently stop. I’ll look into this. In the mean time I’ve updated the binding in the market place with a new version that uses a larger timeout. This should fix the issue.

There is a volume channel on the player bridge. But I don’t think you can set the volume if no device is availble.

The channel playlists has all playlists. playlistName shows only the currently playing playlist.

Thanks for the fast reply hilbrand. I couldn’t see it in your readme file or am I blind?

For some reason, my channel for playlists is either blank, or displays only 1 string.

Search for deviceVolume

Where do you see this? For example if you use this in a sitemap it should be a Selection

Hi Hilbrand i see this in the oh2 console

I assume that is a limitation or intended functionality of the console. It only shows the selected playlist or nothing if no playlist is selected. If you query via the rest api you would get a list of playlists. That is something that a widget can use.

Fair enough! Heres hoping someone developers a lovely HabPanel widget for this. That’s been my biggest hurdle. It’s very difficult to map over to Patrick’s widget. I had a good 4hr stab at it, but I couldn’t get the widget to populate the playlist names or the devices.

Nor can I get your sitemap example to work

09:31:46.309 [WARN ] [del.core.internal.ModelRepositoryImpl] - Configuration model 'spotify.sitemap' has errors, therefore ignoring it: [4,5]: mismatched input 'Player' expecting '}'
[16,3]: missing EOF at 'Frame'

I did a check of the sitemap example. It looks like the example is not correct. It works when usingDefault instead of Player in sitemap. I’ll update the readme.

There is another widget to show playlists that should work with this binding:

1 Like

Thankyou!!

Yes, the Playlister readme is a bit lacking. It’s not clear to me what needs to go into the fields, as per my post in that thread.

I’m using his items.
After reboot the first song is fine, but when pressing “next” it is not refreshing anymore.
The log shows it, after one time next the image, … is not changing anymore.

Pressing next is still working, but it is nothing changing (expect the song)

2019-04-27 12:47:28.655 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 4:32 to 4:33
2019-04-27 12:47:28.760 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 4:33 to 4:32
2019-04-27 12:47:29.659 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 4:32 to 4:33
2019-04-27 12:47:29.813 [ome.event.ItemCommandEvent] - Item 'spotifyTrackPlayer' received command NEXT
2019-04-27 12:47:30.662 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 4:33 to 4:34
2019-04-27 12:47:31.673 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 4:34 to 4:35
2019-04-27 12:47:32.201 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 4:35 to 0:02
2019-04-27 12:47:32.206 [vent.ItemStateChangedEvent] - spotifyTrackName changed from Rosanna to The Best - Edit
2019-04-27 12:47:32.210 [vent.ItemStateChangedEvent] - spotifyAlbumName changed from Greatest Hits: 40 Trips Around The Sun to Simply The Best
2019-04-27 12:47:32.214 [vent.ItemStateChangedEvent] - spotifyArtistName changed from Toto to Tina Turner
2019-04-27 12:47:32.360 [vent.ItemStateChangedEvent] - spotifyAlbumImage changed from raw type (image/jpeg): 194056 bytes to raw type (image/jpeg): 84106 bytes
2019-04-27 12:47:32.663 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 0:02 to 0:03
2019-04-27 12:47:33.678 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 0:03 to 0:04
2019-04-27 12:47:34.679 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 0:04 to 0:05
2019-04-27 12:47:35.677 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 0:05 to 0:06
2019-04-27 12:47:36.445 [ome.event.ItemCommandEvent] - Item 'spotifyTrackPlayer' received command NEXT
2019-04-27 12:47:36.685 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 0:06 to 0:07
2019-04-27 12:47:37.690 [vent.ItemStateChangedEvent] - spotifyTrackProgress changed from 0:07 to 0:08
2019-04-27 12:47:43.245 [ome.event.ItemCommandEvent] - Item 'spotifyTrackPlayer' received command NEXT
2019-04-27 12:47:43.734 [vent.ItemStateChangedEvent] - Date changed from 2019-04-27T12:47:13.704+0200 to 2019-04-27T12:47:43.707+0200
2019-04-27 12:47:43.741 [vent.ItemStateChangedEvent] - Time changed from 2019-04-27T12:47:13.704+0200 to 2019-04-27T12:47:43.707+0200
2019-04-27 12:47:56.239 [ome.event.ItemCommandEvent] - Item 'spotifyTrackPlayer' received command NEXT

What is my fault?
I added 1 screenshot.!

1 Like

When I’m not using the next button in habpanel everything is working fine (when Spotify is changing the songs itself).

What can cause this problem?

HI. I run 2.5 snapshot and I have the following outcome after some time:

2019-04-29 11:43:13.543 [hingStatusInfoChangedEvent] - 'spotify:player:thelexus' changed from ONLINE to OFFLINE
2019-04-29 11:43:18.766 [hingStatusInfoChangedEvent] - 'spotify:player:thelexus' changed from OFFLINE to ONLINE
==> /var/log/openhab2/openhab.log <==
2019-04-29 11:43:18.768 [INFO ] [nternal.handler.SpotifyBridgeHandler] - Unexpected error during polling status, please report if this keeps ocurring: 
java.lang.NullPointerException: null
at org.openhab.binding.spotify.internal.handler.SpotifyDeviceHandler.updateDeviceStatus(SpotifyDeviceHandler.java:104) ~[?:?]
at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.lambda$7(SpotifyBridgeHandler.java:382) ~[?:?]
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359) ~[?:?]
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) ~[?:?]
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230) ~[?:?]
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449) ~[?:?]
at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.lambda$6(SpotifyBridgeHandler.java:382) ~[?:?]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174) ~[?:?]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:?]
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:?]
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:?]
at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.updateDevicesStatus(SpotifyBridgeHandler.java:383) ~[?:?]
at org.openhab.binding.spotify.internal.handler.SpotifyBridgeHandler.pollStatus(SpotifyBridgeHandler.java:335) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]

I cannot solve it by a oh restart (it comes up again). But if I comment out all things and add them again the problem seems to be solved. I thing the problem wasn’t there on 2.4 (but im not exactly sure).

Do you have any hints what todo? Would it be good to cover that null pointer and print out an message that leads to the right direction, of course only if it hasn’t todo with an internal 2.5 problem.

Here are my thing definition:

Bridge spotify:player:thelexus "TheLexus" [clientId="foo", clientSecret="bar"] 
{
Things:
  device Schlafzimmer "Echo Schlafzimmer" [devicename="Vio"]
  device Wohnzimmer "Denon X3500 Wohnzimmer" [devicename="Wohnzimmer"]
  device Kueche "Echo Küche" [devicename="Küche"]
  device Wohnung "Wohnung" [devicename="Wohnung"]
}

Thanks
Bye

I tried to reproduce your problem. But I can’t get it to fail. You could set the log level to trace in the karaf console (log:set TRACE org.openhab.binding.spotify, and back when done: log:set DEFAULT org.openhab.binding.spotify). Maybe it gives more information.

Is it temporary solved when you do this or did that fix the problem?

(Also deviceName should be with uppercase N. I don’t know if it matters, but that is what the code uses)

So I have the log, but because of ids, … I can not share it here.

I’ll send you a PM.

This might be related to the timing issue I’ve seen before on a change I made recently. In your logs it doesn’t show status anymore on the command. I’ve already updated the binding in the market place. Can you update the remove the binding and re-install it from the market place.

Ok I’ve done some research. It looks like it’s caused by a good old deadlock. Yey synchronization… So I’ve changed the code and it should now not happen anymore. Please update the binding from the marketplace and you probably need to restart openHAB to get rid of the deadlocked processes.

The binding in paperui add-ons is still showing the same reference than a couple of weeks ago: Spotify Binding (Beta) market:binding-4326451 - 1.0 is that normal?

1 Like

That’s normal. It shows the eclipse market place Id.

Great but I do I know I am using the latest version?