Unless I’m missing something, it seems there is no way to tell Spotify integration to play on specific devices from Spotify’s own list of available devices.
This prevents us for example from building automations that put particular devices playing according to other conditions such as hour of day, occupied home rooms, sensor reading, etc.
Currently we can only tell Spotify integration to play (or pause, etc) on whatever device is currently active.
This IMHO is very very limiting.
If there is such parameter already, then please let me know where to find it, and I apoligise for opening this FR.
You should really search the forums before posting a FR. This particular topic has been post about ad nauseum. (example thread).
HA can’t see your Spotify devices until one of them is playing and even then it’s flakey. The issue is with Spotify not retaining the device list. It is not a Home Assistant issue.
There is however, a custom component that will do what you want.
@jazzyisj thank you for taking your time to answer me, albeit not in the most educated way.
You should really stop assuming what other people do or don’t, it’s not nice.
First off I have read all the [short] documentation on Spotify integration documentation, and the answer is not there.
That’s the first thing to do when we install new integrations, but I had no luck.
Secondly I have found dozens of threads here on this subject alright, but they all end up recommending the same component you did, which I personally think is not the way to go, hence my FR.
I believe we should not need 3rd party components to mask integration or core shortcomings, they only add up complexity and unneeded layers of software we actually don’t need for anything else.
Finally I was not even aware of the way media player service accepted changes to its source, I had never used it, and I just noticed it 10 minutes ago. I was going to come here and let everyone know I tried it and it worked like a charm.
The media player service solved my problem and I was a bit too preemptive coming here asking for a feature that already exists and I did not know about it.
Now this would be CASE CLOSED, but it seems not… I just received a new email notification while writing this up, letting me know of Core 2021.7.3 exposing Spotify as a service… so… new toys to play.
Anyhow my problem is solved and this FR can be ignored, we already had a way to do this in 2021.7.2 and I didn’t know.
Hi Bengan, you can call service - media_player.select_source choose spotify as the target and the source is the name of the spotify connect device. I just tried it and it seems to be working fine for my Heos speakers.
Only works if I use the name of the speaker from the GUI in spotify app (like “Living room + Kitchen” as opposed to “media_player.living_room”) and if the spotify account I would use is active on the network and was the last spotify account to use the speaker. It does not let me change to another spotify account that has not been used in the house for a couple of days or if someone else has used the speaker more recently.
Don’t mean to necro this thread, but in case anyone else was searching and ended up here like me, the problem is if you are selecting a librespot device to play on, you must configure librespot with your spotify credentials and not use discovery. Discovery uses mDNS to discover spotify (mobile?) apps on the network and will get account credentials from them.
If spotify isn’t open on the device or it isn’t on the network, librespot can’t get credentials and it won’t show up in the device list. The solution is to configure librespot with your spotify username and password instead. This solved flakiness for playback from automations on HA and the Spotify plugin for me.