Spotcast - custom component to start playback on an idle chromecast device

I have now relaesed versikn 3.5.2 which fixes all the issues caused by spotify and core.

I urge EVERYONE using patches to upgrade as soon as possible to official 3.5.2 because the fixes out there all included another discovery of cast devices which will lead to issues in HA core cast. I have gotten the maintainer 8f pychromecast and HA core cast support to clear my fix.

8 Likes

thank you! Is working!

Good evening, to me now it seems to work partially, I can’t find the device

Choose player
no devices found

1 Like

Hi thx for new version.
What do you mean with use patches to upgrade? and … cast support to clear my fix?

I dont understand sorry.
Should we or should e not upgrade to your version or you mean theres another new version coming?

1 Like

Just upgrade.

I did , i just dont understand what hes talking about

You’ll be fine.

1 Like

do upgrade

2 Likes

Ive updated the install but still not able to cast to my devices…

Sent u a PM with my codes

Really hope that u can help…

2 Likes

Thank you so much for fixing the Spotcast integration. It is one of my most used.

For those who are looking for a code sample on how to use, I posted one a while back here: Media browser, Spotify, select output device? - #4 by jtnn60

ive tried, update but it still dont works :frowning:

Anyone that can look on my code and tell me what im doing wrong :(. ?

As I wrote in the DM, you should start with verifying that a simple service start call works, if not then you need to check the logs for that error you get and post that here as a pastebin link

im getting this error:
Failed to cast media spotify:playlist:37i9dQZF1DX9Bom9R0tCgx. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

im simply trying with your guide first…

Running simple scrip like this:

  alias: Start summar rewind in office
  sequence:
    - service: spotcast.start
      data:
        spotify_device_id: "7195af83e3044e449c2adf786ed72d92"
        uri : "spotify:playlist:37i9dQZF1CAiFMqgF92dBd"
        random_song: true```

Start summar rewind in office: Error executing script. Error for call_service at pos 1: Could not get spotify token
#Pastebin log here
https://pastebin.com/uF6sLMPE

Choose player
no devices found

same problem…

how did you solve?

@fondberg help please :frowning:

Hiu Red Bull

1 - You must get client_id and client_secret on https://developer.spotify.com/
2 -Config Yaml
spotify:
client_id: !secret spotify_client_id
client_secret: !secret spotify_client_secret
3 - Instal Spotify in Integration
4 - Install Spotcast in HACS (V 3.5.2)
5 - Config Yaml
spotcast:
sp_dc: !secret sp_dc
sp_key: !secret sp_key
accounts:
dan:
sp_dc: !secret dan_sp_dc
sp_key: !secret dan_sp_key
eythan:
sp_dc: !secret eythan_sp_dc
sp_key: !secret eythan_sp_key

Hi.

i did all that: but im getting: Failed to cast media spotify:playlist:7FvCHKzqYNtNCNdZ83bFYm. Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

yes… my config is this

media_player:
###########################################################

Media Player Spotify

###########################################################

  • platform: spotify
    client_id: !secret spotify_CLIENT_ID
    client_secret: !secret spotify_CLIENT_SECRET
    aliases:
    abc123def456: ‘Living Room’
    9183abas000: ‘Bed Room’

spotcast:
sp_dc: !secret sp_dc
sp_key: !secret sp_key

I solved it by going:

Enter the Edit Settings dialog of your newly-created application and add a Redirect URI:

https://<your_home_assistant_url_or_local_ip>:<port>/auth/external/callback

instead of
https://<your_home_assistant_url_or_local_ip>:<port>//api/spotify`

Thanks

I’ve just created an issue as 3.5.4 is throwing me errors “Failed to get device id from Spotify” when trying to use a 2nd account - using the primary account everything works fine.

If anyone else sees this error, you can track it here.