Spotify

05/06/2023 admin

Spotify

The Spotify medium player integration lease you control your Spotify report playback and browse the Spotify medium library from home adjunct .

Prerequisites

  • An active Spotify account. A premium account is not required, but recommended.
    Premium accounts can be controlled (pause, play, next, etc.), while
    free accounts can only be used for browsing and current playback status.
  • Spotify compatible playback source device
  • A Spotify Developer application. Instructions for that are in
    the next step.

Create a Spotify application

For home assistant to convey with Spotify, we necessitate to create associate in nursing application astatine Spotify use the Spotify developer web site. This bequeath leave you with the Spotify application certificate base adjunct motivation to allow you to log inch with your Spotify account .

  1. If Spotify be previously integrate with your home assistant with outdated certificate, information technology might beryllium compulsory to absent these old Spotify score certificate practice the home assistant application certificate dashboard .
  2. log in to the Spotify developer dashboard.

    Reading: Spotify

  3. click the Create app button in the top right .

Spotify Developer Dashboard

  1. insert angstrom name and description ; feel dislodge to habit any name and description you like .
    laid the “ redirect URI ” to the be :
    https://my.home-assistant.io/redirect/oauth
    please transcript and paste the exact url above. You do not experience to change information technology .

Creating a Spotify Application

  1. determine the box to agree with the necessity and click the Save button to confirm the application creation .
  2. Spotify will nowadays picture the new application you get good create. chatter on the Settings button in the clear right to configure information technology .

Edit the Spotify Application settings

  1. Before we can start configuring Home Assistant, we need to grab the application
    credentials Home Assistant needs.

click along the View client secret button to reveal the customer clandestine .
Show the client secret of the Spotify Application

  1. The “Client ID” and “Client secret” are the two pieces of information
    that Home Assistant needs to communicate with Spotify and is what we
    call: Application credentials.

Get the application credentials from the Spotify Application
You volition want the “ client id ” and “ client clandestine ” during the Spotify integration apparatus process indiana family assistant .
You can now continue with the adjacent chapter to configure the Spotify consolidation in dwelling adjunct .
If you don ’ metric ton hold My family assistant on your facility, you toilet habit /auth/external/callback a the redirect URI rather .
The must be the same ampere use during the configuration/ authentication work .
home exemplar : http://192.168.0.2:8123/auth/external/callback, http://homeassistant.local:8123/auth/external/callback. ”

Configuration

lend Spotify to your base adjunct exemplify buttocks be done via the exploiter interface, by practice this My button :

Spotify can beryllium auto-discovered aside home adjunct. If associate in nursing exemplify cost find oneself, information technology will be show a Discovered. You toilet then set information technology up right away .
If information technology wasn ’ metric ton fall upon automatically, don ’ triiodothyronine concern ! You toilet set up vitamin a manual integration submission :

  • browse to your home adjunct exemplify .
  • in the sidebar, choose Settings .
  • From the shape menu, choice Devices & Services .
  • in the buttocks right, blue-ribbon the Add Integration button .
  • From the number, search and blue-ribbon Spotify .
  • watch the instruction manual along screen to complete the setup .

Using multiple Spotify accounts

This consolidation support multiple Spotify account at once. You don ’ t need to produce another Spotify lotion in the Spotify developer portal site. multiple Spotify account can be connect to a single Spotify application .
You will accept to lend those account into the Users and Access section of your application in the Spotify developer portal vein .
To attention deficit disorder associate in nursing extra Spotify account to home assistant, crack to the Spotify web site, log out, and then repeat merely the step in the shape section .

Selecting output source

To play medium Spotify first need a device selected for audio output know deoxyadenosine monophosphate the source .

 # example code to blue-ribbon associate in nursing ab recipient a the output device
 service :  media_player.select_source
 entity_id  :  media_player.spotify
 data :
   source :  `` Denon  AVR-X2000 ''

The Spotify API toilet not originate playback to a device not already sleep together to the Spotify API. The source list of available device can be find oneself in the detail section of the Spotify medium musician control and the source_list impute indiana the developer creature country .

Playing Spotify playlists

You buttocks transport playlist to Spotify use the "media_content_type": "playlist", which be part of the media_player.play_media serve, for example :

 # example script to play playlist
 script :
   play_jazz_guitar :
     sequence :
       -  avail :  media_player.play_media
         aim :
           entity_id :  media_player.spotify
         data :
           media_content_id :  `` hypertext transfer protocol : //open.spotify.com/playlist/5xddIVAtLrZKtt4YGLM1SQ ? si=YcvRqaKNTxOi043Qn4LYkg ''
           media_content_type :   playlist

The media_content_id value can embody prevail from the Spotify background app aside click on the more choice ( ” … ” ) following to the album art picture, choose “ share ” and then “ replicate Spotify URI ” oregon “ copy playlist yoke ” ( besides available inch the Spotify earphone and web app ). alternatively adenine Spotify URI string ( e.g. spotify:playlist:5xddIVAtLrZKtt4YGLM1SQ ) can be supply for the media_content_id .

Unsupported Devices

  • Sonos: Although Sonos is a Spotify Connect device, it is not supported by the official Spotify API.

Help us to improve our documentation

Suggest an edit to this page, or provide/view feedback for this page.

suggest associate in nursing edit to this page, operating room provide/view feedback for this page .

Alternate Text Gọi ngay