Add documentation of selecting source for Spotify (#23206)

This commit is contained in:
kcd83 2022-06-30 12:30:35 +12:00 committed by GitHub
parent 69d33bfa12
commit 6db8d6235b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,7 @@ The Spotify media player integration allows you to control [Spotify](https://www
- Spotify account
- (Optional) Spotify developer application configured for Home Assistant (see [below](#create-a-spotify-application))
- Spotify compatible playback [source](#selecting-output-source) device
<div class='note'>
Spotify integrated media controls (pause, play, next, etc.) require a Premium account.
@ -80,6 +81,20 @@ accounts can be linked to a _single_ Spotify application. You will have to add t
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](#configuration) section.
## Selecting output source
To play media Spotify first needs a device selected for audio output known as the `source`.
```yaml
# Example code to select an AV receiver as the output device
service: media_player.select_source
entity_id: media_player.spotify
data:
source: "Denon AVR-X2000"
```
The Spotify API cannot initiate playback to a device not already known to the Spotify API. The source list of available devices can be found in the Details section of the Spotify Media Player Control and the `source_list` attribute in the {% my developer_states title="Developer Tools States" %}.
## Playing Spotify playlists
You can send playlists to Spotify using the `"media_content_type": "playlist"`, which is part of the
@ -98,7 +113,7 @@ script:
media_content_type: playlist
```
The `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).
The `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). Alternatively a Spotify URI string (e.g. `spotify:playlist:5xddIVAtLrZKtt4YGLM1SQ`) can be supplied for the `media_content_id`.
## Unsupported Devices