Spotify controls in hab panel

Hi, might be posting this is the wrong area. But hopefully its ok.

I am looking to be able to add spotify controlls to my hab panel.
I would like to be able to adjust volume and all the basics.
If possible also album art to see what is currently playing.
Is there a addon for this? I couldnt find any but maybe someone can point me in the right direction. :slight_smile:

Check this out:

https://community.openhab.org/t/openhab-integration-to-spotify-web-connect-api-player/
1 Like

Tried it. Cant get it to work. Invalid client is the error.

Can you be more specific? Which step of the process are you stuck with?

Oh offcorse, im stuck at the part where i need to authenticate. “Click authenticate”. And when i do it just returns Invaliv client. And if i try to run spotify .py i get errors.

Hi, I’m new to the community and it’s been a long time coming to the part where we need to authenticate. But I will help you with some screenshots.

In the part where it says “Response Body” you should now say “NULL” (remember that you have to press where it says “TRY IT OUT”)

Does the same with the part of the secret client

If you can not, start a chat on facebook to see if I can help you more smoothly.

My name is Pablo Trivick Melendez.

Ive come this far:

Authenticate your New App for your Spotify User

Go to: http://openhabianpi.local:8080/static/spotify-auth.html
You should see a page called "Spotify Integration" with a status message "Click here to Authenticate"
Click the link and authenticate your app
When done, the page returns and displays "New Auth Code successfully saved to OpenHab!"
Check that the spotify_auth_code is set in OpenHab

Did this to save client id and secret:
curl -X PUT --header “Content-Type: text/plain” --header “Accept: application/json” -d “/[Your spotify_client_secret]” “http://openhabianpi.local:8080/rest/items/spotify_client_secret/state”

curl -X PUT --header “Content-Type: text/plain” --header “Accept: application/json” -d “/[Your spotify_client_id]” “http://openhabianpi.local:8080/rest/items/spotify_client_id/state”

But when i go to that site, it gives me this:

Client ID
/[xxxxxxxxxxxxxxxxxxxxxx] (edited this just because)
spotify_client_id

Auth Code
not yet received
spotify_auth_code

Click to authenticate.

When i click it:

It gives me this:

INVALID_CLIENT: Invalid client

omg… i worked it out… i had the brackets around the client id. wich caused issues. Thanks again guys!

But i encountered another issue. When i run spotify.py this appears:

Error getting state from OpenHab: spotify_client_id (HTTP Response 404)
Error getting state from OpenHab: spotify_client_secret (HTTP Response 404)
Error getting state from OpenHab: spotify_access_token (HTTP Response 404)
Error getting state from OpenHab: spotify_refresh_token (HTTP Response 404)
Error getting state from OpenHab: spotify_token_issued (HTTP Response 404)
Error getting state from OpenHab: spotify_token_expiry (HTTP Response 404)
Traceback (most recent call last):
File “/etc/openhab2/scripts/spotify.py”, line 384, in
main()
File “/etc/openhab2/scripts/spotify.py”, line 347, in main
c = spotify()
File “/etc/openhab2/scripts/spotify.py”, line 47, in init
if (time.time() > float(self.token_expiry)):
ValueError: could not convert string to float:

If you can, when you integrate the spotify to your HABpanel. Can you send me the Widget? please. I’m lost in this part.

Sorted theese. myopenhab.py had a reference to a wrong ip.
Now to try to add it to my panel i guess :slight_smile:

Edit;

Stuck on adding working controls to habpanel. Anyone that can chime in here?

Hey Kim! Did you succeed in implementing these? Otherwise I’d be glad to hop on :slight_smile: