Spotify Config

Thank you to @happyleavesaoc for this.

Configured as it says in the Spotify components web page and when this pops up.

I select the link and it gives back on a web browser.

INVALID_CLIENT: Invalid redirect URI

I have filled in the URL redirect with https://my_ip_address/api/spotify

(and i did save it after)

my_ip_address is the one i use to link to HA.

Looked at the URL of the INVALID_CLIENT: Invalid redirect URI
and it gives my local ip address


When i type into a new browser i get NOT SECURE.


Im having the same issues

Add your local IP in the Spotify Redirect URI:

Worked fine for me.


1 Like

Nope still gives the INVALID_CLIENT:


Dont no why its got https:// in the feedback because i put in the redirect URL

I am using a secure connection to my HA letsencrypt.

I just had same error but on checking the spotify app page I can see when I copy pasted my local address it did a double http://http://xxx and after fixing it worked - remember to save.

For me it worked with Chrome, but not with Safari.

It seems that all of you do not have a secure connection to your HA. ie: > you use http://192.168.x.x:8123/api/spotify

I have and i have tried

And I did save after everyone.

1 Like

In my case i forgot the port.
I used which did not work.
After adding the port such as it works perfect, also with Safari.

I have a secure connection and the following worked for me:


I use https://mydomain:8123/api/spotify and it works.

Mydomain maps to the local ip when inside the lan, and I also have a valid letsencrypt certificate for that address when inside (and outside).

I can get to the Spotify login page, but when I click Login I get “500 internal error”

So close!

Any error in your log?

Does this help?

BTW, I’m running HA through Docker is that matters.

17-04-22 10:38:06 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.5/site-packages/aiohttp/”, line 417, in start
resp = yield from self._request_handler(request)
File “/usr/local/lib/python3.5/site-packages/aiohttp/”, line 289, in _handle
resp = yield from handler(request)
File “/usr/local/lib/python3.5/asyncio/”, line 213, in coro
res = yield from res
File “/usr/local/lib/python3.5/asyncio/”, line 213, in coro
res = yield from res
File “/usr/src/app/homeassistant/components/http/”, line 58, in ban_middleware_handler
return (yield from handler(request))
File “/usr/src/app/homeassistant/components/http/”, line 422, in handle
result = handler(request, **request.match_info)
File “/usr/src/app/homeassistant/components/media_player/”, line 115, in get
File “/usr/local/lib/python3.5/site-packages/spotipy/”, line 218, in get_access_token
raise SpotifyOauthError(response.reason)
spotipy.oauth2.SpotifyOauthError: Bad Request

1 Like

I have the exact same issue, but I run a “normal” install

Well managed to get it working.Its a bit extreme.

Deleted the folders. \deps\spotipy and \deps\spotipy-2.4.4-py3.4.egg-info.

Then reinstalled the last HA sudo pip3 install homeassistant==0.42.4
pip3 install --upgrade homeassistant

Selected the Spotify config and it went to a web page downloaded a file
but the file had nothing in it.

Went back to Chrome Downloads and looked at the file download and selected the https:// part and it worked.

I used

I am aswell just getting an empty file called “spotify” to download from the spotify API page…

I don’t get this part of your solution

“Went back to Chrome Downloads and looked at the file download and selected the https:// part and it worked.”

Could you explain what you did in detail?

Thanks in advance


Select Chrome Download in the Chrome App

Click on the https:

I am getting the same error, i don’t have my homeassistant open to the internet and only use it from a local ip, are you the same? have you found a solution for this error?

I’m using Let’s Encrypt to access my HA install over the internet with .IO domain.

Still no luck.

I changed my base_url under http: to get it to work, otherwise it would just use my IP which spotify didn’t like.