The Spotify media player integration allows you to control Spotify playback from Home Assistant.
- Spotify account
- Spotify application configured for Home Assistant (see below)
- Login to Spotify Developer via Dashboard.
- 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 below.
- Enter the Edit Settings dialog of your newly-created application and add a Redirect URI:
- If you are not using SSL:
- If you are using SSL:
- Note Spotify does a case-sensitive match of the fields above, as such ensure the Redirect URI is all lower case.
- If you are not using SSL:
- Click Save after adding the URI.
Add the following to your
# Example configuration.yaml entry spotify: client_id: YOUR_CLIENT_ID client_secret: YOUR_CLIENT_SECRET
Restart your Home Assistant instance before continuing with the next step.
Adding Spotify to your Home Assistant instance can be done via the user interface, by taking the following steps:
- Browse to your Home Assistant instance.
- In the sidebar click on Configuration.
- From the configuration menu select: Integrations.
Spotify can be auto-discovered by Home Assistant. If an instance was found, it will be shown in the top of the list of integrations as “Discovered”. If that is the case click on the Configure button to start setting up the discovered instance.
If there wasn’t any discovered automatically, don’t worry! You can set up a manual integration entry:
- In the bottom right, click on the Add Integration button.
- From the list, search and select “Spotify”.
- Follow the instruction on screen to complete the set up.
After completing, the Spotify integration will be immediately available for use.
If you receive an
INVALID_CLIENT: Invalid redirect URI error while trying to
authenticate with your Spotify account, check the Redirect URI in
the address bar after adding the new integration. Compare this value with the
Redirect URI defined in the Spotify Developer Portal.
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.
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.
You can send playlists to Spotify using the
"media_content_type": "playlist", which is part of the
media_player.play_media service, for example:
# Example script to play playlist script: play_jazz_guitar: sequence: - service: media_player.play_media target: entity_id: media_player.spotify data: media_content_id: "https://open.spotify.com/playlist/5xddIVAtLrZKtt4YGLM1SQ?si=YcvRqaKNTxOi043Qn4LYkg" media_content_type: playlist
media_content_id value can be obtained from the Spotify desktop app by clicking on the more options (”…”) next to the album art picture, selecting “Share” and then “Copy Spotify URI” or “Copy Playlist Link” (also available in the Spotify phone and web app).
- Sonos: Although Sonos is a Spotify Connect device, it is not supported by the official Spotify API.
Suggest an edit to this page, or provide/view feedback for this page.