Help Compiling Spotify binding from Git

Can anyone help me with compiling a .jar file of the following git source:

Would be truly appreciated :slight_smile:

1 Like

Check in progress.

Edit! Check Done

Did you install maven? (Do you use Windows or Linux?)

git clone GitHub - astenlund74/openhab2-addons: Add-ons for openHAB 2.x

cd addons/binding/org.openhab.binding.spotify

mvn package

After maven finished go into

cd target
ls

 MANIFEST.MF  classes  local-artifacts.properties  maven-archiver  org.openhab.binding.spotify-2.1.0-SNAPSHOT.jar  p2artifacts.xml  p2content.xml

You can download my .jar if you want to

edit! Link changed from puush to google drive

https://drive.google.com/file/d/0B2fC98SZJv6qMWxZOUNnOElLQzA/view?usp=drive_web

the links goes to a .zip file not .the jar

can u fix this please

LoL ?
If I press my URL I download the .jar

Try this one https://drive.google.com/open?id=0B2fC98SZJv6qMWxZOUNnOElLQzA

1 Like

this works fine! thx

@ChrisA Could you report if the jar is working?

i managed the connection with the spotifyservice and discovered a little bug: in the authentication page the binding considers only a http connection, not https. now the binding crashes with this log:

21:49:13.240 [INFO ] [smarthome.event.ThingUpdatedEvent ] - Thing ‘spotify:player:0fb2bb1c’ has been updated.
21:49:13.314 [INFO ] [marthome.event.ConfigStatusInfoEvent] - ConfigStatusInfo [configStatusMessages=[]]
21:49:14.130 [INFO ] [marthome.event.ConfigStatusInfoEvent] - ConfigStatusInfo [configStatusMessages=[]]
21:49:15.086 [INFO ] [marthome.event.ItemStateChangedEvent] - spotify_player_user1_trackRepeat changed from NULL to off
21:49:15.088 [INFO ] [marthome.event.ItemStateChangedEvent] - spotify_player_user1_trackProgress changed from NULL to 5:10
21:49:15.095 [INFO ] [marthome.event.ItemStateChangedEvent] - spotify_player_user1_trackDuration changed from NULL to 5:17
21:49:15.099 [INFO ] [marthome.event.ItemStateChangedEvent] - spotify_player_user1_trackName changed from NULL to The Girl From Ipanema
21:49:15.104 [INFO ] [marthome.event.ItemStateChangedEvent] - spotify_player_user1_albumName changed from NULL to Stan Getz: The Bossa Nova Albums
21:49:15.103 [ERROR] [nding.spotify.handler.SpotifyHandler] - Exception caught in anonymous scheduled runnable task. This task will now stop.
java.lang.IllegalArgumentException: Channel with ID ‘deviceActive’ does not exists.
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.isLinked(BaseThingHandler.java:573)[105:org.eclipse.smarthome.core.thing:0.9.0.b5]
at org.openhab.binding.spotify.handler.SpotifyHandler.setChannelValue(SpotifyHandler.java:423)[224:org.openhab.binding.spotify:2.1.0.201709070932]
at org.openhab.binding.spotify.handler.SpotifyHandler.updatePlayerInfo(SpotifyHandler.java:410)[224:org.openhab.binding.spotify:2.1.0.201709070932]
at org.openhab.binding.spotify.handler.SpotifyHandler.lambda$0(SpotifyHandler.java:272)[224:org.openhab.binding.spotify:2.1.0.201709070932]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_121]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_121]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
21:49:15.118 [INFO ] [marthome.event.ItemStateChangedEvent] - spotify_player_user1_artistName changed from NULL to Stan Getz

heue u find the fixed version:

https://github.com/astenlund74/org.openhab.binding.spotify-binary/blob/master/org.openhab.binding.spotify-2.2.0-SNAPSHOT_20170910.jar

Thanks for the help guys! :slight_smile: Got the latest spotify binding running now :smiley:

Thanks so much for this binding, noobs question, I like to remove the logging from the binding e.g.:

2017-10-05 21:31:08.669 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 0:43 to 0:48
2017-10-05 21:31:13.897 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 0:48 to 0:54
2017-10-05 21:31:19.116 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 0:54 to 0:59
2017-10-05 21:31:24.419 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 0:59 to 1:04
2017-10-05 21:31:29.790 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:04 to 1:09
2017-10-05 21:31:34.976 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:09 to 1:15
2017-10-05 21:31:40.229 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:15 to 1:20
2017-10-05 21:31:45.413 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:20 to 1:25
2017-10-05 21:31:50.732 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:25 to 1:30
2017-10-05 21:31:56.222 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:30 to 1:36
2017-10-05 21:32:01.529 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:36 to 1:41
2017-10-05 21:32:06.848 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:41 to 1:47
2017-10-05 21:32:12.067 [ItemStateChangedEvent     ] - spotify_player_633029c1_trackProgress changed from 1:47 to 1:52

I’ve added this to my:

/var/lib/openhab2/etc/org.ops4j.pax.logging.cfg

log4j.logger.org.openhab.binding.spotify = ERROR, out, osgi:*

But im still getting the log from the binding.