Update to the latest version ( .13 , not any lower as the issue exists in .11 and .12 too)
solved in the latest release
help, i cant get account freja and frede to work, - but the default (mine) is working fine
what am i doing wrong? when im using the default it shows me my chromecast devices
OK thank you anyway for looking into it.
Hey all. Got this component in and loading, i love it. But im stuck on how to make its output devices let me do playback on one (or more) of my Sonos at the same time. I dont see any of them showing up in the playback device list
Read the README. Tldr; sonos os not supported
i am getting these errors now, what does it mean? mine spotify it still working
2021-07-26 08:57:23 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/spotcast/spotcast_controller.py", line 142, in get_spotify_token
self._access_token, self._token_expires = st.start_session(
File "/usr/local/lib/python3.9/site-packages/spotify_token.py", line 18, in start_session
response = session.get("https://open.spotify.com/get_access_token?reason=transport&productType=web_player",
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 555, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 677, in send
history = [resp for resp in gen]
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 677, in <listcomp>
history = [resp for resp in gen]
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 166, in resolve_redirects
raise TooManyRedirects('Exceeded {} redirects.'.format(self.max_redirects), response=resp)
requests.exceptions.TooManyRedirects: Exceeded 30 redirects.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/spotcast/helpers.py", line 60, in run
return await loop.run_in_executor(executor, pfunc)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/spotcast/__init__.py", line 78, in get_devices
client = spotcast_controller.get_spotify_client(account)
File "/config/custom_components/spotcast/spotcast_controller.py", line 176, in get_spotify_client
return spotipy.Spotify(auth=self.get_token_instance(account).access_token)
File "/config/custom_components/spotcast/spotcast_controller.py", line 136, in access_token
self.ensure_token_valid()
File "/config/custom_components/spotcast/spotcast_controller.py", line 132, in ensure_token_valid
self.get_spotify_token()
File "/config/custom_components/spotcast/spotcast_controller.py", line 148, in get_spotify_token
raise HomeAssistantError("Could not get spotify token")
homeassistant.exceptions.HomeAssistantError: Could not get spotify token
i think your sp_key and sp_dc are old
indeed, renewed and fixed
Seems I’m having issues since updating to HA 2021.8.6 (container)
I checked the sp_dc & sp_key - both match from config to browser settings. Tried re-installing the integration - no luck. Any other suggestions?
Error executing service: <ServiceCall spotcast.start ( *redacted - can include if necessary* ): uri=https://open.spotify.com/playlist/37i9dQZF1DX2Nc3B70tvx0?si=5d235b17288e4dab, random_song=True, shuffle=True, entity_id=media_player.google_home, ignore_fully_played=False, repeat=off, force_playback=False, start_volume=101, offset=0>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1507, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
await self._hass.async_add_executor_job(handler.job.target, service_call)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/spotcast/__init__.py", line 143, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/config/custom_components/spotcast/spotcast_controller.py", line 202, in get_spotify_device_id
spotify_cast_device.startSpotifyController(access_token, expires)
File "/config/custom_components/spotcast/spotcast_controller.py", line 84, in startSpotifyController
sp.launch_app()
File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/spotify.py", line 87, in launch_app
raise LaunchError(
pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app
After update Home Assistant - same here. Turning on/off players, reinstal addon, restart HA. This same problem
Suddenly seeing the same issue here:
2021-08-12 16:45:46 DEBUG (SyncWorker_6) [custom_components.spotcast.spotcast_controller] setting up with account t
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.spotcast_controller] expires: 1628782846 time: 1628779547.0107527
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.spotcast_controller] setting up with account t
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_spotify_devices: media_player.spotify_t: Spotify T: []
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_spotify_devices: {'devices': []}
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.woonkamer: Woonkamer cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='google-nest-hub-4660f5b8aabe10031a93ebd362367256-1._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.16', 8009))}, uuid='4660f5b8-aabe-1003-1a93-ebd362367256', _manufacturer='Google Inc.', model_name='Google Nest Hub', friendly_name='Woonkamer', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.soundbar: Soundbar cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='.xx.5-81704a75fd037a7c38090eb3c5dffea5._googlecast._tcp.local.')}, uuid='81704a75-fd03-7a7c-3809-0eb3c5dffea5', _manufacturer=None, model_name='.xx.5', friendly_name='Soundbar', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.slaapkamer: Slaapkamer cast info: ChromecastInfo(services={ServiceInfo(type='host', data=('192.168.xx.13', 8009)), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11-1._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11-2._googlecast._tcp.local.')}, uuid='0256c1dd-13b4-4c80-849b-281970d02d11', _manufacturer='Google Inc.', model_name='Google Home Mini', friendly_name='Slaapkamer', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.studeerkamer: Studeerkamer cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Home-d4063db0253e246c9d66d8f7fda77a6a-2._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.12', 8009)), ServiceInfo(type='mdns', data='Google-Home-d4063db0253e246c9d66d8f7fda77a6a._googlecast._tcp.local.')}, uuid='d4063db0-253e-246c-9d66-d8f7fda77a6a', _manufacturer='Google Inc.', model_name='Google Home', friendly_name='Studeerkamer', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.hele_huis: Hele huis cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Cast-Group-eec4b1d472ec428fad8f291a69a2d97d-1._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.12', 32059)), ServiceInfo(type='mdns', data='Google-Cast-Group-eec4b1d472ec428fad8f291a69a2d97d._googlecast._tcp.local.')}, uuid='eec4b1d4-72ec-428f-ad8f-291a69a2d97d', _manufacturer=None, model_name='Google Cast Group', friendly_name='Hele huis', is_audio_group=True, is_dynamic_group=False)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.boven: Boven cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Cast-Group-e18cddf284be43da9917ddb7d4ceb42c-1._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Cast-Group-e18cddf284be43da9917ddb7d4ceb42c._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.12', 32213))}, uuid='e18cddf2-84be-43da-9917-ddb7d4ceb42c', _manufacturer=None, model_name='Google Cast Group', friendly_name='Boven', is_audio_group=True, is_dynamic_group=False)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.zolder: Zolder cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Home-Mini-71d8c580bbd0166b72f10071a427b6cb-1._googlecast._tcp.local.'), ServiceInfo(type='host', data=('[::ffff:c0a8:5811]', 8009)), ServiceInfo(type='mdns', data='Google-Home-Mini-71d8c580bbd0166b72f10071a427b6cb._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.17', 8009)), ServiceInfo(type='mdns', data='Google-Home-Mini-71d8c580bbd0166b72f10071a427b6cb-2._googlecast._tcp.local.')}, uuid='71d8c580-bbd0-166b-72f1-0071a427b6cb', _manufacturer='Google Inc.', model_name='Google Home Mini', friendly_name='Zolder', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.tv_beneden: TV Beneden cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='TPM191E-bec0597.xx.b9a0a6966437ba87df4fe._googlecast._tcp.local.')}, uuid='bec05970.xx.b-9a0a-6966-437ba87df4fe', _manufacturer=None, model_name='TPM191E', friendly_name='TV Beneden', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.helpers] get_cast_devices: media_player.tv_slaapkamer: TV Slaapkamer cast info: ChromecastInfo(services={ServiceInfo(type='mdns', data='Chromecast-32e39183bc97abac51d77fce98a766a4._googlecast._tcp.local.')}, uuid='32e39183-bc97-abac-51d7-7fce98a766a4', _manufacturer=None, model_name='Chromecast', friendly_name='TV Slaapkamer', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.spotcast_controller] Chromecast devices: [ChromecastInfo(services={ServiceInfo(type='mdns', data='google-nest-hub-4660f5b8aabe10031a93ebd362367256-1._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.16', 8009))}, uuid='4660f5b8-aabe-1003-1a93-ebd362367256', _manufacturer='Google Inc.', model_name='Google Nest Hub', friendly_name='Woonkamer', is_audio_group=False, is_dynamic_group=None), ChromecastInfo(services={ServiceInfo(type='mdns', data='.xx.5-81704a75fd037a7c38090eb3c5dffea5._googlecast._tcp.local.')}, uuid='81704a75-fd03-7a7c-3809-0eb3c5dffea5', _manufacturer=None, model_name='.xx.5', friendly_name='Soundbar', is_audio_group=False, is_dynamic_group=None), ChromecastInfo(services={ServiceInfo(type='host', data=('192.168.xx.13', 8009)), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11-1._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11-2._googlecast._tcp.local.')}, uuid='0256c1dd-13b4-4c80-849b-281970d02d11', _manufacturer='Google Inc.', model_name='Google Home Mini', friendly_name='Slaapkamer', is_audio_group=False, is_dynamic_group=None), ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Home-d4063db0253e246c9d66d8f7fda77a6a-2._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.12', 8009)), ServiceInfo(type='mdns', data='Google-Home-d4063db0253e246c9d66d8f7fda77a6a._googlecast._tcp.local.')}, uuid='d4063db0-253e-246c-9d66-d8f7fda77a6a', _manufacturer='Google Inc.', model_name='Google Home', friendly_name='Studeerkamer', is_audio_group=False, is_dynamic_group=None), ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Cast-Group-eec4b1d472ec428fad8f291a69a2d97d-1._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.12', 32059)), ServiceInfo(type='mdns', data='Google-Cast-Group-eec4b1d472ec428fad8f291a69a2d97d._googlecast._tcp.local.')}, uuid='eec4b1d4-72ec-428f-ad8f-291a69a2d97d', _manufacturer=None, model_name='Google Cast Group', friendly_name='Hele huis', is_audio_group=True, is_dynamic_group=False), ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Cast-Group-e18cddf284be43da9917ddb7d4ceb42c-1._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Cast-Group-e18cddf284be43da9917ddb7d4ceb42c._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.12', 32213))}, uuid='e18cddf2-84be-43da-9917-ddb7d4ceb42c', _manufacturer=None, model_name='Google Cast Group', friendly_name='Boven', is_audio_group=True, is_dynamic_group=False), ChromecastInfo(services={ServiceInfo(type='mdns', data='Google-Home-Mini-71d8c580bbd0166b72f10071a427b6cb-1._googlecast._tcp.local.'), ServiceInfo(type='host', data=('[::ffff:c0a8:5811]', 8009)), ServiceInfo(type='mdns', data='Google-Home-Mini-71d8c580bbd0166b72f10071a427b6cb._googlecast._tcp.local.'), ServiceInfo(type='host', data=('192.168.xx.17', 8009)), ServiceInfo(type='mdns', data='Google-Home-Mini-71d8c580bbd0166b72f10071a427b6cb-2._googlecast._tcp.local.')}, uuid='71d8c580-bbd0-166b-72f1-0071a427b6cb', _manufacturer='Google Inc.', model_name='Google Home Mini', friendly_name='Zolder', is_audio_group=False, is_dynamic_group=None), ChromecastInfo(services={ServiceInfo(type='mdns', data='TPM191E-bec0597.xx.b9a0a6966437ba87df4fe._googlecast._tcp.local.')}, uuid='bec05970.xx.b-9a0a-6966-437ba87df4fe', _manufacturer=None, model_name='TPM191E', friendly_name='TV Beneden', is_audio_group=False, is_dynamic_group=None), ChromecastInfo(services={ServiceInfo(type='mdns', data='Chromecast-32e39183bc97abac51d77fce98a766a4._googlecast._tcp.local.')}, uuid='32e39183-bc97-abac-51d7-7fce98a766a4', _manufacturer=None, model_name='Chromecast', friendly_name='TV Slaapkamer', is_audio_group=False, is_dynamic_group=None)]
2021-08-12 16:45:47 DEBUG (SyncWorker_6) [custom_components.spotcast.spotcast_controller] cast info: ChromecastInfo(services={ServiceInfo(type='host', data=('192.168.xx.13', 8009)), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11-1._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11._googlecast._tcp.local.'), ServiceInfo(type='mdns', data='Google-Home-Mini-0256c1dd13b44c80849b281970d02d11-2._googlecast._tcp.local.')}, uuid='0256c1dd-13b4-4c80-849b-281970d02d11', _manufacturer='Google Inc.', model_name='Google Home Mini', friendly_name='Slaapkamer', is_audio_group=False, is_dynamic_group=None)
2021-08-12 16:45:50 DEBUG (SyncWorker_6) [custom_components.spotcast.spotcast_controller] Found cast device: Chromecast(None, port=8009, device=DeviceStatus(friendly_name='Slaapkamer', model_name='Google Home Mini', manufacturer='Google Inc.', uuid='0256c1dd-13b4-4c80-849b-281970d02d11', cast_type='audio'))
2021-08-12 16:46:04 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall spotcast.start (c:999e546c4febe44ced7365721538eaee): account=t, entity_id=media_player.slaapkamer, uri=spotify:track:5OoSxUZSbP1p7kb1d0SozG, offset=0, shuffle=False, start_volume=101, ignore_fully_played=False, repeat=off, random_song=False, force_playback=False>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1507, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
await self._hass.async_add_executor_job(handler.job.target, service_call)
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/spotcast/__init__.py", line 143, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/config/custom_components/spotcast/spotcast_controller.py", line 202, in get_spotify_device_id
spotify_cast_device.startSpotifyController(access_token, expires)
File "/config/custom_components/spotcast/spotcast_controller.py", line 84, in startSpotifyController
sp.launch_app()
File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/spotify.py", line 87, in launch_app
raise LaunchError(
pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app
Created a Github issue for it:
Issue seems to be in the underlying package pychromecast
or something server-side, but it is definitely not only happening with Spotcast:
hope some developper would fix it…
Hello everyone,
I’ve created a PR which should fix the timeout issue.
TLDR; Spotify changed the auth mechanism used in the casting process and that library which spotcast uses needed to be updated to match it accordingly.
@kylepotts thanks a lot! wait for it because user of HassOs, cant modify anything…and thanks for your reply on Github.
@fondberg “They complicate things a couple of times per year” …lol…so true…why make things simple when you can make them complicated…lovely world where we live…
wait for the fix!
Spotcast is the most used in my HA config…
After holidays I wanted to reactivate my wake up spotcast script, but it doesn’t work anymore, no music (I hear the google home mini activation dong, but no music).
Error in the log:
Logger: homeassistant.core
Source: custom_components/spotcast/spotcast_controller.py:84
Integration: Spotcast ([documentation](https://github.com/fondberg/spotcast), [issues](https://github.com/fondberg/spotcast/issues))
First occurred: 18:15:32 (1 occurrences)
Last logged: 18:15:32
Error executing service: <ServiceCall spotcast.start (c:2f09aae5ccc5ede6a11bd77856644d02): random_song=True, shuffle=True, start_volume=15, entity_id=media_player.paire_cuisine, uri=spotify:playlist:37i9dQZF1E35HX5cTimjMT, ignore_fully_played=False, force_playback=False, offset=0, repeat=off>
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1507, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service await self._hass.async_add_executor_job(handler.job.target, service_call) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/spotcast/__init__.py", line 143, in start_casting spotify_device_id = spotcast_controller.get_spotify_device_id( File "/config/custom_components/spotcast/spotcast_controller.py", line 202, in get_spotify_device_id spotify_cast_device.startSpotifyController(access_token, expires) File "/config/custom_components/spotcast/spotcast_controller.py", line 84, in startSpotifyController sp.launch_app() File "/usr/local/lib/python3.9/site-packages/pychromecast/controllers/spotify.py", line 87, in launch_app raise LaunchError( pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app
I tried updating sp_key & sp_dc (which were still valid for a few months), tried other uri’s, but nothing helps.
Same bug? Or can someone help (before school is back :-D)?
HI all
Does anyone know how long it usually takes for a PR to be adopted into HA OS?
I have 6 RFID readers around the house for choosing playlists which are all now all sitting idle as they don’t work until this is implemented is OS.
Seriously considering whether I now have to change to either supervised or docker so that I am able to implement the change myself.
Obviously I would prefer to save myself all that work if I can.
Thanks
I never been able to get spotcast to work. i’m not sure what I am doing, I am using spotify lovelace card. I hear my google home beep when i select it, but the music does not play and continues to play on my computer. this error log i am getting.
2021-08-21 10:05:37 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall spotcast.start (c:2d1e09ef6b9890ff71bab5baa600451f): device_name=Bedroom speaker, force_playback=True, account=default, shuffle=False, random_song=False, ignore_fully_played=False, repeat=off, start_volume=101, offset=0>
Traceback (most recent call last):
File "/snap/home-assistant-snap/334/lib/python3.8/site-packages/homeassistant/core.py", line 1507, in catch_exceptions
await coro_or_task
File "/snap/home-assistant-snap/334/lib/python3.8/site-packages/homeassistant/core.py", line 1530, in _execute_service
await self._hass.async_add_executor_job(handler.job.target, service_call)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/var/snap/home-assistant-snap/334/custom_components/spotcast/__init__.py", line 143, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/var/snap/home-assistant-snap/334/custom_components/spotcast/spotcast_controller.py", line 202, in get_spotify_device_id
spotify_cast_device.startSpotifyController(access_token, expires)
File "/var/snap/home-assistant-snap/334/custom_components/spotcast/spotcast_controller.py", line 84, in startSpotifyController
sp.launch_app()
File "/snap/home-assistant-snap/334/lib/python3.8/site-packages/pychromecast/controllers/spotify.py", line 87, in launch_app
raise LaunchError(
pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app