spotcast: Timeout when waiting for status response from Spotify app
Describe the bug Spotcast fails to start playing on 2021.8.6
- Using latest version of spotcast
- I have setup the Spotify integration in Home Assistant
- I am using multiple accounts
- Using latest stable version of Home Assistant
- I have Spotify Premium
- I’m attaching relevant logs with level debug for component spotcast (see README)
- I’m using entity_id in the service call and have tried device_name but the issue remains
Describe the bug Noted since 2021.8.6, but Spotcast fails to start playing.
Environment (please complete the following information):
- HA version: [2021.8.6]
- spotcast version: [3.6.14]
Configuration
spotcast:
sp_dc: !secret spotcast_sp_dc
sp_key: !secret spotcast_sp_key
accounts:
t:
sp_dc: !secret spotcast_t_sp_dc
sp_key: !secret spotcast_t_sp_key
Additional context
Debug logs:
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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 51 (10 by maintainers)
I am also getting the same timeout issue in HA.
Setup
Tried to test around this. Findings:
So based on the above I am speculating:
I have now released 3.6.15 which includes the fix
Any chance you could give us some guidance on how you got it working at your end? That way we could get our home assistant updated and spotcast working too? I’ve noticed another issue has been raised on this so clearly people are looking for a fix.
Make sure you have a backup…
This is how I did it:
Go to the 3 files Kyle has created:
To save the files to your computer - Right click on “Raw” and choose “Save link as”
Copy those files to your “config/custom_components/spotcast” folder
Check configuration and then restart HA
Yeah. Just wait for it to get merged. Home Assistant is usually pretty quick with its releases. If you’re unsure on how to apply this fix, you probably shouldn’t apply it.
Seems that it is not a Spotcast issue: https://github.com/home-assistant-libs/pychromecast/issues/520#issuecomment-898478947
It was for me.
Also - if successful it it would be good to confirm they work at the new PR: https://github.com/fondberg/spotcast/pull/244
I’m not familiar with how hassos is packaged. I currently use a docker image and I am able to patch the file like kazigk mentioned above.
If you’re able to ssh into the box you can try replacing that file? Otherwise my guess is we would need to get this merged and the hassos folks would need to push an update.
@kazigk I pushed some changes to my branch on pychromecast.
I was able to follow the instructions here https://pypi.org/project/PyChromecast/ and get a network capture. That showed they were using a different “refreshed” token and a new command for authorizing.
Can you give that new patch a try and see if it works?
I created a pr https://github.com/home-assistant-libs/pychromecast/pull/521 that seems to fix the issue. Not totally proud of that fix though.
Overall I think something changed in the chromecast spotify protocol.
As I am feeling this isn’t a Spotcast but a pychromecast error, I’ve opened an issue there too ☝🏻