Spotify Config

Maybe no url is the secret! :slight_smile:

mmm i got evryting set, but dont get the Authoriezes sigen up, and dont get any error:S any ide?

any one have any ides?

i have now trying this:
http://192.168.1.66:8123/lovelace/0
http://hassio.local:8123/lovelace/0
http://XXX.duckdns.org:8123
http://192.168.1.66:8123/api/spotify
https://myduck.duckdns.org:8123/api/spotify

what can i try more?

Look in the URL of the error page. The address to add should be in the query string.

mmm i do not understand:( can u expina some other way?

Hi, this card doesn’t want to work for me too :frowning: I was trying all the url’s.

Not working here either.

still not working for me
Home Assistant v0.100.1
python3.6 virtual environment installation

base_url: http://MYDOMAIN.ddns.net:8123
redirect URI: http://MYDOMAIN.ddns.net:8123/api/spotify

Does this integration currently work ?

Followed the exact steps 1 by 1 and after adding the media player with spotify developer credentials the spotify component always fails to run .

Visiting the api url returns a 404 error .

2 Likes

Fix it, for me works :

  1. Try to enter external uri from world after config https and dns https://myurl:8123 (I blocked external traffic just white list on my fw)
  2. Add uri on Spotify developer my app the following uri
    https://myurl:8123/api/spotify

Did you ever figure this out? Tried a bunch of combos with the Spotify developers page and the http: section and can’t get it to go

Also using duckdns, I solved adding the port at the end of the domain on Spotify Developer.
So https://myname.duckdns.org:443/…

There are several threads about this same issue that all end in the same way.
Some people just didn’t follow the instructions in the first play and problem was solved by adding the redirect uris, and for some people it works to temporarily set base_url to local ip and revert back to duck DNS url after spotify setup, then for some people like me, neither works.

Tried all the combos: widn duckdns url, with local ip, with different base_urls, with or without port number in redirect uri, with or without last slash in redirect uri. No go. It just doesn’t work.

EDIT (few times):
Actually only now noticed whole base_url is deprecated (HA didn’t give any notification about having it there tho?). Then first added the external url but that didn’t help as the spotify component wants to use the internal url. Messed up with that first by leaving it to http://ip:port instead of https://ip:port and thought that I had to give duckdns url to internal url too (which worked fine but was not “right”), but then tried again with the https://local.ip:port in internal url setting and the same url in spotify dev settings and it finally worked too.

Also had to remove the last slash from the redirect uri in spotify dev settings, which is opposite to what the instructions on that dev page say (I tested and it didn’t work if I had the last slash there).

Well, to add on to one of those that can’t get this thing running.

Ending up with 500 server error when switching over to the integration and been trying with a couple of different HA versions and currently on 0.114.3. 500 server error occurs when trying to authenticate spotify and getting an access_token. Running duckdns ssl and redirect uri seems correct since I get the code to send back to authorize and get tokens.

Have been using the old spotify component without issues, but seems to be problems with refreshing the token with the integration. Tested to add entry manually in core.config.entries by following the .py code and captured the access_token and refresh_token with curl. When this is manually done, the integration fires up and I can control the component without issues, but as soon as the token expires after an hour it can’t get a refreshed token and I get 400 server error in the log. Again, if I curl and get a new access_token manually and put in the core.config.entries it runs for another hour.

Is this a spotify issue or an oauth2 issue??

Hello,

So I had this working, but then I had to reset my router because I screwed something else up and had to got back to an old snapshot before I had spotify working.

My IP address on homeassistant changed from xxx.xx.xxx.x1x to xxx.xx.xxx.x2x.

I went through the same steps, deleting the old spotify app and making a new one with my new IP address, but I get the “INVALID_CLIENT: Invalid redirect URI” page, and the address bar has my old IP address in it.

I’ve tried clearing my cache and cookies, but no joy.

Can anyone help with this?

@peterspencer10 you can try
https://developer.spotify.com - Dashboard - Your App - Edit Settings - Add a second Redirect URIs with your new local IP
http://xxx.xx.xxx.x2x:8123/auth/external/callback

I tried that. It still seems to want to got to the old one. Thanks for getting back to me though.

It turns out my HA just needed a good nights sleep. It’s working today using your suggestion @hekm77 . Thanks again.