SpotifyPlus Integration

@kentoe
no issues playing to it normally
Normally, as in …

  • playing via the Spotify Web / Mobile / Desktop player?
  • playing via SpotifyPlus?

Has it ever played via SpotifyPlus before? If so, how long ago? Spotify disabled the use of their Web Player Cookie Credentials (in late May) for use with their Spotify Web API, which has caused issues with some devices.

SpotifyPlus doesn’t seem to startup correctly on Core 2025.7.0

Logger: homeassistant.setup
Source: setup.py:278
Setup failed for custom integration ‘spotifyplus’: Requirements for spotifyplus not found: [‘spotifywebapipython>=1.0.220’, ‘urllib3>=1.21.1,<1.27’].

1 Like

And Soundtouchplus same situation :pleading_face:

1 Like

@Diegocampy @Jbautista13
A github issue is already open for this and SoundTouchPlus.

HA updated urllib3 requirements.

Will keep you posted - should be fixed by tomorrow (07/03).

1 Like

FYI - just released a new version of the SpotifyPlus integration

Be sure to check out the SpotifyPlus Card Dashboard as well.

Note - This version will only work with HA 2025.7.0 and above, since HA updated the urllib3>=2.0 requirement. It will NOT work with previous HA releases.

[ 1.0.139 ] - 2025/07/02

  • Updated underlying spotifywebapipython package requirement to version 1.0.222.
  • Updated requirements: from urllib3>=1.21.1,<1.27 to urllib3>=2.0. Due to Home Assistant Core 2025.7.0 update requirements.
2 Likes

The automation “Update SpotifyPlus Queue” (automation.update_spotifyplus_queue) has an unknown action: spotifyplus.get_player_queue_info.

This error prevents the automation from running correctly. Maybe this action is no longer available, or perhaps a typo caused it.

Nothing now shows in any SpotifyPlus enity.

Have to switch everything to spotify and it works.

Everything SpotifyPlus failed

Trying to redo:

I think you have a real issue with latest Home Assistant software upgrade.

Even deleting everything, just choosing to add SpotifyPlus integration yields 500 error, config flow could not be loaded.

So I cannot even add back.

@kbrown01
If you installed Home Assistant 2025.7.0, then you must upgrade SpotifyPlus to v1.0.139 (or later), which was just released a couple of hours ago.

SpotifyPlus v1.0.137 (which is what you have installed based on your screen captures) will not work with HA 2025.7.0. The integration fails to load due to a RequirementsNotFound: Requirements for spotifyplus not found: ['spotifywebapipython>=1.0.221'] error, as shown in the HA system log.

The HA developers updated their urllib3 requirement from urllib3>=1.21.1,<1.27 to urllib3>=2.0 in the 2025.7.0 release. The SpotifyPlus integration, as well as 3 other supporting libraries, had to be updated to support this change by HA since they had requirements of the previous urllib3 version (1.26.0 I believe).

Hope that makes sense. Just update your SpotifyPlus to v1.0.139 via HACS and you should be good.

1 Like

I can confirm 139 works as expected. Thanks!

1 Like

Does not for me. Entire system down

@kbrown01
In order to assist you, I need you to answer the following questions:

  1. What version of Home Assistant do you have installed?
  2. What version of SpotifyPlus integration do you have installed?
  3. Do you have the SoundTouchPlus integration installed?
  4. Are there any entries in the Home Assistant System Log (Settings \ System \ Log) that are related to SpotifyPlus?

Regarding your “just choosing to add SpotifyPlus integration yields 500 error, config flow could not be loaded” …
You must go into HACS and update the SpotifyPlus integration first to v1.0.139, then you can access the configuration.

Hi @thlucas,
first of all, I’m posting here because it seems to be the most active channel for support requests. If opening a bug report on GitHub is more appropriate, please let me know. Thank you!

Now to the point — this is most likely an issue on my end rather than a bug in the integration, but I’d appreciate any advice on how to handle it.

Sometimes in the evening, when I put my daughter to bed, I run a script that includes several actions using SpotifyPlus, such as:

  - alias: Transfer playback to specified device
    action: spotifyplus.player_transfer_playback
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      play: false
  - alias: Disable Shuffle Mode on the specified device
    action: spotifyplus.player_set_shuffle_mode
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      state: false
  - alias: Start the playlist on the specified device
    action: spotifyplus.player_media_play_context
    data:
      entity_id: media_player.spotifyplus_paintervale
      device_id: Camera Linda
      context_uri: >-
        https://open.spotify.com/playlist/4ufyQwaLq1MR49KvGRCNAo?si=AbYrmWorRKeW7G20B4c44A&pi=kT5FCDevRke6T
mode: single
icon: mdi:bed

Occasionally, something goes wrong and it doesn’t work. I’ve noticed that sometimes a Home Assistant restart solves the issue. Yesterday I found the following error in the logs, and I thought it might be related — is that the case?

Is there something I could automate or handle differently to prevent this?
It’s a bit frustrating because it’s often my wife who triggers the script, and I’d rather not give her more reasons to say “this home automation causes more trouble than it solves.” You know what I mean, right? :sweat_smile:

Thanks in advance!

This error originated from a custom integration.

Logger: custom_components.spotifyplus
Source: custom_components/spotifyplus/media_player.py:1246
integration: SpotifyPlus (documentation, issues)
First occurred: 08:29:28 (1 occurrence)
Last logged: 08:29:28

SpotifyApiError: Spotify Connect Directory Task - Could not retrieve dynamic device list: SAM1001E - Spotify Web API returned an error status while processing the "GetPlayerDevices" method. Status: 401 - Unauthorized Message: "The access token expired"
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py", line 1246, in RefreshDynamicDevices
    self.UpdatePlayerDevices()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py", line 1395, in UpdatePlayerDevices
    playerDevices:list[Device] = self._SpotifyClientInstance.GetPlayerDevices(refresh=True)
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 7703, in GetPlayerDevices
    self.MakeRequest('GET', msg)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 1393, in MakeRequest
    msg.ResponseData = self._CheckResponseForErrors(msg, response)
                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 796, in _CheckResponseForErrors
    raise SpotifyWebApiError(errCode, errMessage, msg.MethodName, response.reason, _logsi)
spotifywebapipython.spotifywebapierror.SpotifyWebApiError: SAM1001E - Spotify Web API returned an error status while processing the "GetPlayerDevices" method.
Status: 401 - Unauthorized
Message: "The access token expired"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/spotifyplus/media_player.py", line 1246, in update
    self._playerState = self.data.spotifyClient.GetDevicePlaybackState(deviceId=self._attr_source)
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 6483, in GetDevicePlaybackState
    scDevice:SpotifyConnectDevice = self._ResolveDeviceObject(deviceId, activateDevice=False)
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 940, in _ResolveDeviceObject
    scDevice = self.GetSpotifyConnectDevice(
        device,
        refreshDeviceList=True,
        activateDevice=activateDevice)
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyclient.py", line 10118, in GetSpotifyConnectDevice
    scDevice = self._SpotifyConnectDirectory.GetDevice(deviceValue, refreshDynamicDevices=True, raiseExceptionIfNotFound=False)
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py", line 913, in GetDevice
    scActiveDevice = self.RefreshDynamicDevices()
  File "/usr/local/lib/python3.13/site-packages/spotifywebapipython/spotifyconnect/spotifyconnectdirectorytask.py", line 1266, in RefreshDynamicDevices
    raise SpotifyApiError("%s - Could not retrieve dynamic device list: %s" % (self.name, str(ex)), ex, logsi=_logsi)
spotifywebapipython.spotifyapierror.SpotifyApiError: SpotifyApiError: Spotify Connect Directory Task - Could not retrieve dynamic device list: SAM1001E - Spotify Web API returned an error status while processing the "GetPlayerDevices" method.
Status: 401 - Unauthorized
Message: "The access token expired"
1 Like

@Diegocampy
That looks like an issue with re-authorizing the access token after it expires. The Spotify access token expires approximately every 60 minutes, at which time it is automatically refreshed on the next call to the Spotify Web Services API.

My guess would be that there was more than 1 call being made to the Spotify Web Services API simultaneously, and that one of them was able to refresh the token while the other(s) did not. The call that WAS able to refresh the token could have taken longer than expected due to response times from the Spotify Web API itself. If there is a delay or problem with the Spotify Servers then it will take longer to refresh the token, which could delay other requests which will fail with the access token expired error.

Unfortunately, I don’t think that this can be corrected due to the nature of how HA works (multi-threaded / things happening simultaneously) and the reliability of Spotify Web Servers (e.g. slow responses, downtime, etc).

1 Like

Thanks for this. Looks like it’s nearly the cure to a stupid problem caused by Spotify. I had it working yesterday, which took ages because I don’t know anything about python etc… Hurray!

But today it’s not working … Boooo.

I get the following message when i try and start an automation:

Error running action

Spotify Cast Application could not be activated on Chromecast device “86c817d1(other numbers and letters)fa94f6f43”: Spotify Desktop Player authorization token was not found in the token cache file.

Any ideas? This has been such a pain in the a

@ajtringhouse
The Spotify Desktop Player authorization token was not found in the token cache file message indicates the integration did not find your Spotify Desktop Player authorization token, which should be located in your Home Assistant configuration config\.storage\spotifyplus_tokens.json location.

If it was working yesterday, then it could have been due to the device already being in the Spotify Web API active device list. The token is only used to activate devices that are not already in the active device list.

This could be caused by any of the following:

  1. the spotifyplus_tokens.json file generated by the AuthTokenGenerator.py python script was not copied to the Home Assistant configuration \config\.storage\spotifyplus_tokens.json location. In this case, have a look at the Token Creation Instructions wiki docs to find the HA folder location.

  2. the wrong user was authorized in the AuthTokenGenerator.py python script, and does not match the Spotify user id that was authorized for the SpotifyPlus Application Credentials. This can happen if you have more than 1 Spotify user account that you are using. If so, then you must create separate SpotifyPlus integration services for each account used and they should also have their own Spotify Developer Application assigned (e.g. unique client id and secret).

Note that your spotifyplus_tokens.json file will look something like this:

{
    "SpotifyWebApiAuthCodePkce/65b708073fc0480ea92a077233ca87bd/31l77y2xxx": {
        "access_token": "BQA5EStQWjo ...",
        "expires_at": 1750357767.6614442,
        "expires_in": 3600,
        "refresh_token": "AQAv8cat7LA ...",
        "scope": [
            "streaming"
        ],
        "token_type": "Bearer"
    }
}

The 31l77y2xxx value must match the Spotify user id that was authorized for the SpotifyPlus integration. This value can be found by logging into the Spotify Developer web-site, and using the Get Current Users Profile page to retrieve the id value via the “Try It” functionality. This value is also the ending portion of your Spotify User URI (e.g. spotify:user:xxx , where xxx is the id value).

Thanks for the response. Will have a look at both of those.
Very odd because the .json file is in the correct place and I only have one Spotify account.

I am trying to cast to Google speakers, but like i said it was all working the day before yesterday.

Thanks for your help. I’ll try it all again.

Just incredibly frustrating. I’ve spent 3 days trying to get this to work, and its totally inconsistent.
Latest development is I can’t use SpotifyPlus because “This service is disabled by Config entry”… WHAT CONFIG ENTRY?!

This is probably fairly easy for someone who knows coding/python etc, but for general use its just a series of blockages. All Spotify/Google need to do is stop breaking their connections and then we wouldnt have to attempt these alternative options.

Ugh.

@ajtringhouse
The HA error This service is disabled by Config entry indicates the integration was disabled by HA for some reason. Go to Settings \ System \ Logs to see the exact reason the integration was disabled; look for errors related to the SpotifyPlus integration.

You could also setup a SmartInspect trace, which will give me more information about your environment and where the error is occurring in the cast activation process. Check out the Tracing HA Integration Components wiki doc for how to set that up.

@ajtringhouse
I have opened github issue 135 for this problem. Please reply to the github issue going forward.

I also got the error:
No application_credentials platform for spotifyplus

What vis_9 Giacomo suggested also worked for me after a lot of attempts and trails!
Version HA core is 2025.7.1 and SpotifyPlus is V1.0.140.
Notice that I was perfectly able to add the spotify cliend ID and secret when i selected the Spotify integration. But when selecting SpotifyPlus integration I got the error mentioned above.
Hope this helps. Maybe worthwhile comparing the OAuth approach between Spotify and SpotifyPlus helps.

1 Like

Hi. First, thanks for this integration. I’ve been working most of today on getting it set up, and I am finally able to (through your Dashboard Card) select my Chromecast device or device group, connect to it, and play Spotify media through HA.

However, I’m now lost again. I figured out how to use automations to play a specific playlist - but I can’t figure out how to indicate in that automation which speaker(s) or speaker group to play that media on. It just seems to play it on whatever I’ve last selected in the UI.

I know I’m missing something, but the documentation is overwhelming and I can’t seem to find any examples of how to do this correctly.

Basically what I want to do is play a certain playlist every morning at a designated time on all of my “Downstairs Speakers” (which is a Google Cast group).

Can you please point me in the right direction? Thanks in advance.