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

@fondberg Great that you found a way to fix, thanks for your effort! Do you consider this a more future proof solution than the previous ways to obtain a proper token?

What am i doing wrong?

I set up the new spotcast like this


  sp_dc: !secret sp_dc
  sp_key: !secret sp_key


sp_dc: AQAacJF1--**--AcuoI-d3pVbXE0*****cawXyiEgj****QqJJ7xYiX6A****8T21MzS22-ivVquTRCAQIOSsA
sp_key: 85***6e-6d***-4**a-87**-fb15*******

But the validation gives me this error:
Invalid config for [spotcast]: [sp_dc] is an invalid option for [spotcast]. Check: spotcast->spotcast->sp_dc. (See /config/configuration.yaml, line 50).

I have updated to the latest version of the spotcast card from Hacs, running Home assistant 109.6

Any ideas?

Is there also a possibility to only show certain chromecast devices from the sensor? Like a filter or something?

Restart HA?

yeah Several times, even the Rpi3

Oh my end when I add spotcast to the configuration yaml I get the following error:

Configuration invalid
Component error: spotcast - Requirements for spotcast not found: [‘spotify_token==1.0.0’].

Only god and Spotify knows I’m afraid…

Pretty sure you have the wrong version of spotcast installed

V3.0.0 according to hacs

I would uninstall it and restart. Then install it and restart.

@fondberg I hope you can help me out/answer here. I’d love to select only several devices instead of the big scrollist im having now when using your spotify card.

Odly enough, that helped! Thanks!

This is the wrong forum…

Having this error today.
Failed to call service spotcast/start. get_spotify_token() got an unexpected keyword argument ‘sp_dc’

I did recheck my sp_dc and sp_key.
restarted HA.
Uninstalled spotcast. restarted HA. and reinstalled. No luck

I have the same problem

Maybe the cookies that generated the keys have been invalidated / expired? My spotcast component continues to work fine. Try regenerating new keys in incognito and update config.

No, this has to do with the 3.2.0 update. You most likely are still running the older version which does work properly.

Should be fixed soon, but in the meantime I downgraded back.

Problem solved with update 3.2.1


I’m still having my other problem.

Whenever I choose a speaker to play it on, it always plays my first playlist and I can’t seem to be able to change playlist… It always plays the first playlist and I can’t change it.

I’m I missing something somewhere?

Thanks in advance!

That seems like a spotify card problem. Ask the q over there so ppl there can help

Hi @fondberg - first of all let me say - awesome work man !!!

I have an issue which I cannot understand (it may be a minor slip) - after installing from HACS the spotcast, configuring it with the cookies, from Service - Call Service with the below code it works without an issue - the music starts immediately.
code 1 which works:

Service Data (YAML, optional):
device_name: Office speaker 
entity_id: media_player.office_speaker 
uri: 'spotify:playlist:37i9dQZF1DX7cZxYLqLUJl' 
random_song: true 
shuffle: true

If I put the same as above in a script - Morning Alarm - it does not work anymore and throws the error in the subject
code 2 which does not work:

  alias: Morning Alarm
  - data:
      entity_id: media_player.office_speaker
      random_song: true
      shuffle: true
      uri: spotify:playlist:37i9dQZF1DX7cZxYLqLUJl
    entity_id: media_player.office_speaker
    service: spotcast.start

The error code is:

2020-06-26 11:31:06 INFO (MainThread) [homeassistant.components.script] Morning Alarm: Running script 2020-06-26 11:31:06 INFO (MainThread) [homeassistant.components.script] Morning Alarm: Executing step call service 2020-06-26 11:31:06 ERROR (MainThread) [homeassistant.components.script] Morning Alarm: Error executing script. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['entity_id'] 2020-06-26 11:31:06 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140331804021776] value should be a string for dictionary value @ data['entity_id'] Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/", line 130, in handle_call_service connection.context(msg), File "/usr/src/homeassistant/homeassistant/", line 1260, in async_call task.result() File "/usr/src/homeassistant/homeassistant/", line 1295, in _execute_service await handler.func(service_call) File "/usr/src/homeassistant/homeassistant/components/script/", line 207, in service_handler await script.async_turn_on(, context=service.context) File "/usr/src/homeassistant/homeassistant/components/script/", line 284, in async_turn_on await self.script.async_run(kwargs.get(ATTR_VARIABLES), context) File "/usr/src/homeassistant/homeassistant/helpers/", line 831, in async_run await run.async_run() File "/usr/src/homeassistant/homeassistant/helpers/", line 555, in async_run await self._async_run() File "/usr/src/homeassistant/homeassistant/helpers/", line 572, in _async_run await self._async_step(log_exceptions=not propagate_exceptions) File "/usr/src/homeassistant/homeassistant/helpers/", line 153, in _async_step self, f"_async_{cv.determine_script_action(self._action)}_step" File "/usr/src/homeassistant/homeassistant/helpers/", line 656, in _async_call_service_step *self._prep_call_service_step(), blocking=True, context=self._context File "/usr/src/homeassistant/homeassistant/", line 1222, in async_call processed_data = handler.schema(service_data) File "/usr/local/lib/python3.7/site-packages/voluptuous/", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.7/site-packages/voluptuous/", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.7/site-packages/voluptuous/", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: value should be a string for dictionary value @ data['entity_id']

Any ideas on what I am missing? Thank you very much.