Spotify playlist won't play

Hi folks.

I’m new to spotify and have activated the integration but can’t get playlists to play.
Tracks seem to play ok.

I’m trying the following service call but nothing happens.
spotify service call

I see this error in my log

Failed to cast media spotify:playlist:6kVfbY7GaVxmFAfFpaQLFd. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address```

Can anyone get playlists to play?

I found this post when searching for the same error message but for casting a camera stream.
I decided to test the same thing as you (For good measure, I tried it with media_content_type as both playlist and music.), and I have the error:

2020-10-05 21:44:46 INFO (SyncWorker_29) [pychromecast.controllers] Receiver:Launching app CC1AD845 
2020-10-05 21:44:50 ERROR (Thread-8) [homeassistant.components.cast.media_player] Failed to cast media https://open.spotify.com/playlist/37i9dQZF1DWVEerxa93vDU?si=_jzr4-_GTD6BYYjiIauj8A. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address 

My configuration.yaml has internal_url as a working http://192.168.1.8:8123 address and external_url as a working (publicly accessible) duckdns address.
TTS to the same Google Home Hub works fine, as does other Spotify playing.

I’m using NGINX to reverse proxy, if that’s relevant. Are you, @OptimusGREEN?
I tried stopping NGINX, then calling the service from the local http IP site and got the same error.
The Google Home Hub makes a noise, shows something loading on the screen, but does not display either the camera stream or play the Spotify playlist.

Hopefully the fix for this also works for streaming cameras.

What kind of speaker is the media_player.dining_room_speaker?

Hi,

It’s a Google home.

Sorry, didn’t get a notification for these posts for some reason.

Yes I’m using nginx too. And nabu casa btw.

As expected. Spotify does not work like that for Google Cast devices. But there is a custom component called Spotcast doing what you want.

Thanks, I’ll check it out.

I just tried a couple of things.
Playing a playlist URL to media_player.spotify worked for me. I already had Spotify playing on a computer and this service call changed what was playing to my playlist.
I got no result (not even a log entry) when I tried to play with the entity_id of my Yamaha AVR (connected to the computer running Spotify)… not surprising that it didn’t work since the Yamaha doesn’t support Spotify directly.

So, this also works if Spotify is playing to the Google Home Hub already.
If I target media_player.spotify I can change to any playlist (via the URL).

I am able to change Spotify’s “source” (actually the destination where sound comes out) via the media_player.select_source service call - TO “htpc” (my computer) but NOT to “Living Room Display” (the name of the Google Home Hub). I can change to the Google device via the Spotify interface, but have been unsuccessful in changing to this via the HA service call.

Close…

1 Like

FWIW, I’m having this issue too.

media_player.spotify changes my Spotify app on my computer. But that’s not what I want. I want HA to start a Spotify playlist playing on my Google Nest Audio.

media_player.play_media targeting my Google Nest Audio, doesn’t work. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

If it’s relevant, both are trying to play a Spotify playlist. Tried both Spotify URI and playlist link - no joy.

Note: I’m on SSL and DuckDNS. I can successfully send TTS to that same Google Nest Audio, so discoverability is not an issue.

Context - I want to make a HA Automation that plays a Spotify playlist on sunrise.

Hope this gets fixed soon.

1 Like

I’m also facing the same problem…any news on this?

Can you ask Google Nest audio to play song on Spotify?

Yup of course. Just link your Spotify account to Google Home (the app).

Yesterday I was looking for a way to play spotify playlists on chromecast speakers and I found a solution that works for me. I added the Logitech Squeezebox integration. I already had a squeezebox server in place. On the squeezebox server I added the spotty integration to allow it to play spotify, as well as the chromecast-bridge in order to let it play to chromecast devices. Then I open a spotify playlist on the squeezebox server and save it on the squeezebox itself. Call the squeezebox.call_method service in HA and tell it to play the playlist.

I finally soldered all parts for my Tag reader and then had to discover this behavior as well.

Goal was also to play spotify playlist/albums when tag is read. Did not know this was a limitation :frowning:

Also can not install HACS currently in order to quickly check out spotcast.

Came across this topic since I was experiencing the same problem. Has anybody been able to tackle this problem?

In the meantime I did found a workaround:

  • Set up Spotify playlist in one of the 50+ presets in my Yamaha Musiccast app.
  • enter “presets:10” (e.g., for preset 10) as media_content_id
  • enter media_content_type: ‘music’

Did they remove the ability to set presets in the app? I can’t see it anywhere but the app has changed. Is there anyway to do it without the app?