My setup (forgive me if i miss things out)
pi (home assistant os) → audio out (to amplifier)
aim is to have the pi solely to play music through the amp (spotify, radio etc) and controlled from any device with access to HA dashboard (phone, tablet, computers).
I installed spotify and have been able to use the controls (select playback device) - but, only if i firstly select the device (home assistant) for example, via my computer (spotify select playback device → home assistant).
Problem is upon restarting the pi (HA) this ‘source’ is not shown and if i select play, i get a notification -
failed to call service media_player/media_play. No active playback device found.
I realise this is an old thread, but in case it helps anyone else, I think what your looking for to play Spotify through your HA device is this:
As opposed to the Spotify integration that allows your HA to be a controller (not a player).
Regarding selecting the playback device, I know you can do that in HA, via a service call, though I’ve found it to be a bit hit and miss, sometimes I have to run it two or three times for it to select the source.
Personally, I have a drop-down with all of my playback source names, and an automation that selects the playback device when the drop-down is changed.