I have five Spotify accounts, all worked fine to integrate at the same time in the old integration.
After upgrading to 105.2, I changed the config and the Spotify Apps to the new syntax, and it works fine - but only for one account at a time.
The config won't allow several accounts specified at the same time. Or, I am doing it wrong and then I'd like to suggest an update of the documentation to make it easier to follow for multiple account config.
configuration.yaml
Old config that worked fine:
- platform: spotify
name: account_1
client_id: !secret spotify_client_id_account_1
client_secret: !secret spotify_client_secret_account_1
cache_path: .spotify-token-cache-account_1
- platform: spotify
name: account_2
client_id: !secret spotify_client_id_account_2
client_secret: !secret spotify_client_secret_account_2
cache_path: .spotify-token-cache-account_2
- platform: spotify
name: account_3
client_id: !secret spotify_client_id_account_3
client_secret: !secret spotify_client_secret_account_3
cache_path: .spotify-token-cache-account_3
- platform: spotify
name: account_4
client_id: !secret spotify_client_id_account_4
client_secret: !secret spotify_client_secret_account_4
cache_path: .spotify-token-cache-account_4
- platform: spotify
name: account_5
client_id: !secret spotify_client_id_account_5
client_secret: !secret spotify_client_secret_account_5
cache_path: .spotify-token-cache-account_5
New config that works (only one account):
spotify:
client_id: !secret spotify_client_id_account_1
client_secret: !secret spotify_client_secret_account_1
But it won't accept more accounts.
Expected config would be something like this:
spotify:
- client_id: !secret spotify_client_id_account_1
client_secret: !secret spotify_client_secret_account_1
- client_id: !secret spotify_client_id_account_2
client_secret: !secret spotify_client_secret_account_2
...
Use the integration screen instead of yaml it should work by just creating new entries there.
Well, yes. But only for the "active" account, specified in configuration.yaml. I don't get any option to input next account's credentials or to choose which account to activate the integration for.
If I "edit client & client_secret to ..account_1" in configuration.yaml + restart + add the integration it works fine.
Then I can "edit client & client_secret to ..account_2" in configuration.yaml + restart + add the integration, then I get the second account's integration. And so on. But in a few minutes, the accounts not specified in the loaded configuration.yaml will time out and leave behind dead integrations.
Probably I'm just doing it wrong:
Can you show an example of a configuration.yaml that supports several Spotify accounts to be integrated?
You just create another integration, remove the yaml completely and keep adding new ones from configuration > integration. One for each account.
Hey there @frenck, mind taking a look at this issue as its been labeled with a integration (spotify) you are listed as a codeowner for? Thanks!
Ok, that sounds fine, but it doesn't work for me. The integration just add the already existing integration again. And if I press + again, It'll try to add the same account again.
When I had one integration active and working, I removed the yaml, restarted and tried to add a new integration - and then it says:

I'll remove the one that works and start over completely.
New try, new server, no success:
Clean install, hass.io on Pi 3+
1. Following the documentation:
o create the required Spotify application:
• Login to Spotify Developer.
• Visit the My Applications page.
• Select Create An App. Enter any name and description.
• Once your application is created, view it and copy your Client ID and Client Secret, which are used in the Home Assistant configuration file.
• Add a Redirect URI in one of the following forms:
o If you are not using SSL: http://
• Click Save after adding the URI.
2. Add config
To add Spotify to your installation, add the following to your configuration.yaml file:
spotify:
client_id: YOUR_CLIENT_ID
client_secret: YOUR_CLIENT_SECRET
3. Restart HA
4. Got a new integration discovered after restart

5. Choose configure.


6. Back to HA

7. Add next account



8. Integration added - for the same account as above. No possibility to choose another account.

(User name blanked out).
I am still sure I do something wrong, but please describe where I do wrong so I can update the documentation.
Found out why - something with the information being cached.
If I do this - it works.
@BoneheadFraggle Sorry to post this again after it has been closed.
I have managed to get 3 accounts to be available for integration following your instructions above.
However, after sometime, the first two accounts will present themselves as "unavailable" after some time. Only the last account whose client id that remains on configuration.yaml will remain available.
Have you come across the same problem or have found a resolution to the above problem?
However, after sometime, the first two accounts will present themselves as "unavailable" after some time. Only the last account whose client id that remains on configuration.yaml will remain available.
You should not add multiple entries to your configuration.yaml file. Only 1 entry (Spotify Application) goes into your configuration.yaml. You only need 1 application, which can be used for adding multiple accounts / instances via the Home Assistant frontend.
Adding in multiple to your configuration.yaml, will cause your accounts to expire.
Just follow my steps and it should work.
Thanks @BoneheadFraggle and @frenck.
As you both pointed out, the correct way is to only add one client id and client secret once, and there no need to amend the configuration.yaml any more.
Instead of using incognito mode, I went to https://accounts.spotify.com and logged out after adding each intergration.