Spotify cast issue | Chromecast device

Hi all,
I need you about following issue.
I’m tring to test the integration of Spotify/Chromecast features. To do that I’ve configured these script:

test_song_gmini:
  alias: xxxx
  sequence:
    service: media_player.play_media
    target:
      entity_id: media_player.gmini
    data:
      media_content_type: music
      media_content_id: "https://open.spotify.com/track/xxxxxx"

When I run it, my google mini emits a “bip” but doesn’t play the song. Looking on Log I can see that:
2021-04-01 15:26:52 ERROR (Thread-8) [homeassistant.components.cast.media_player] Failed to cast media https://open.spotify.com/track/xxxxx. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

Any suggestion?
Thank you!

2 Likes

hey man , same problem here … found a solution?

Unfortunately Not yet :expressionless:

I found out that you can install this HACS integration:

If you leave the original spotify config and then just add the spotcast config it will work.
However I think you need the newest version of HA so please update first .

I have the same problem, but with a playlist.

Same problem here, 3 years later. The google smart speaker emits a short ‘bleep’ but nothing plays, and the log message says the URL isn’t reachable, though it works fine from my browser.

I also tried with a youtube video link:

alias: Play Spotify Playlist
sequence:
  - target:
      entity_id: media_player.red_room_speaker
    data:
      media_content_id: https://www.youtube.com/watch?v=dQw4w9WgXcQ
      media_content_type: video/mp4
    action: media_player.play_media

but again I just get a ‘bleep’, no music, and the log says:

Failed to cast media https://www.youtube.com/watch?v=dQw4w9WgXcQ. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

exact same problem here, in 2024. Has anyone found a fix?