Spotify for 2 user

Good evening,

I tied to configurate spotify for 2 users. 1 user work without any issue, but when i add the second the config.yaml show:
duplicated mapping key at line 34, column -106:
spotify:
^
this is because I use 2 time the same configuration:

spotify:
client_id: xxxx
client_secret: xxxx

spotify:
client_id: xxxxx
client_secret: xxxx

I saw a topic here https://community.home-assistant.io/t/support-for-multiple-spotify-accounts/16117/27 but this option with configuration with cloud dosen’t work there I get after some minutes abort.

Hope someone can help.

Did you also read the post and bother to open the links? It’s explained in the docs and judging by your post, you aren’t following it.

Using multiple Spotify accounts
This integration supports multiple Spotify accounts at once. You don’t need to create another Spotify application in the Spotify Developer Portal and no modification to the configuration.yaml file is needed. Multiple Spotify accounts can be linked to a single Spotify application. You will have to add those accounts into the Users and Access section of your application in the Spotify Developer Portal. To add an additional Spotify account to Home Assistant, go to the Spotify website and log out, then repeat only the steps in the Configuration section.

Yes but there is always the same account there I get this error.

Done!

Your account is now linked, you can close this window.

There is no window to chose the other account.

1 Like

Did you make sure you weren’t logged in the previous account on Spotify? Tried a incognito browser? It’s all straight forward and just like the docs explained it. You only need to the client_id and secret in the configuration.yaml once, all extra accounts only need the last step. So just add the integration, log in Spotify (and making sure previous account isn’t logged in) and it will add it.

If this doesn’t work either post some logs with errors or write a complete step by step what you’re doing. At your first post you showed you weren’t actually following the official docs at all (since you tried having the configuration entry twice, which is explicitly explained not to do in the docs). So in order for people to help you, you need to give out more information and follow the complete docs as it’s written.

i tried everythink with 1 and 2 configs in the .yaml.

The solution was

Is there a solution? I have the same problem.

Login with the other account solved my problem.

1 Like

In my case after having gone trough the process (stelling spotify that it’s fine to give Home Assistant access and telling home assistant to link the account, it ends with the non-descriptive picture below.
image
And the second account isn’t added…
What could be the problem?
Tried it on multiple devices.

EDIT: this solved it:

I want to listen to two different songs at the same time via Spotify. I have two Spotify accounts for this. How can I define in the script which account it should use? Currently my perfectly functioning scripts with one account look like this:

play_spotify:
  sequence:
    - service: media_player.play_media
      target:
        entity_id: "{{ sonos_entity }}"
      data:
        media_content_type: "music"
        media_content_id: "{{spotify_uri}}"

Thanks for your help

Did you ever figure this out?

no, unfortunately not. I had to put this project on hold because of that