It allows to select the output target for Spotify using the “Spotify Connect” capability. Home Assistant is fully compatible with Spotify via it’s “spotify:” media_player component. Besides of selecting the output target via the HASS UI, it also adds a volume control and provides some intent_scripts, which allow Echo/Alexa to control your Spotify (even if Spotify is not currently playing via the Echo).
I’ve uploaded all needed config files to my bitbucket repository. Please be aware, that the configuration.yaml only holds the config lines, that are required for the Spotify stuff. Anything else has been removed for ease of reading. There might also be a better way to implement this, but for me it works fine and is very comfortable (especially with Alexa)… Imagine coming home from work and while storing your bike, you say: “Alexa, ask Home Assistant to play spotify on the livingroom PC”
Looks like sensor.spotify_current_source is not configured.
And I think switching output device (media_player.select_source) with API is a premium feature (like most of the control):
Controlling the Spotify component (pause, play, next, etc) requires a Premium account. If you do not have a Premium account, the component in the frontend will not show the controls.
To play Spotify music on Alexa with voice control, here is another solution. You can download and convert Spotify to MP3 and then play converted MP3 format Spotify songs on Alexa freely.