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

Configuration.yaml:

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

secrets.yaml

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. https://github.com/fondberg/spotcast/issues/104

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

Problem solved with update 3.2.1

Thanks!
@fondberg

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: 
spotcast.start 
Entity: 
media_player.office_speaker 
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:
Script:

'1593159898420':
  alias: Morning Alarm
  sequence:
  - 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/commands.py", line 130, in handle_call_service connection.context(msg), File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1295, in _execute_service await handler.func(service_call) File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 207, in service_handler await script.async_turn_on(variables=service.data, context=service.context) File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 284, in async_turn_on await self.script.async_run(kwargs.get(ATTR_VARIABLES), context) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 831, in async_run await run.async_run() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 555, in async_run await self._async_run() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 572, in _async_run await self._async_step(log_exceptions=not propagate_exceptions) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 153, in _async_step self, f"_async_{cv.determine_script_action(self._action)}_step" File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 656, in _async_call_service_step *self._prep_call_service_step(), blocking=True, context=self._context File "/usr/src/homeassistant/homeassistant/core.py", line 1222, in async_call processed_data = handler.schema(service_data) File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.7/site-packages/voluptuous/schema_builder.py", 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.