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.
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.
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.
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.
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.