Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playing on chromecast devices doesn't work #245

Closed
2 tasks
daften opened this issue Aug 22, 2021 · 6 comments
Closed
2 tasks

Playing on chromecast devices doesn't work #245

daften opened this issue Aug 22, 2021 · 6 comments

Comments

@daften
Copy link

daften commented Aug 22, 2021

Describe the bug

I couldn't play to chromecast devices. I set everything up according to the README: spotify integration, spotcast, lovelace-spotify-card. So I checked issues #182 and #174 and followed the steps in there. I re-started the setup then and only used one account.

Reporting this here since it seems to be a spotcast issue, not of the spotify-lovelace-card.

I see this in the logs:

Error executing service: <ServiceCall spotcast.start (c:8780b51c4b820d07593395d2c811c809): uri=spotify:playlist:37i9dQZF1DWUJiNTfqDwyS, force_playback=False, random_song=True, account=daften, device_name=Office speaker, start_volume=101, repeat=off, shuffle=False, ignore_fully_played=False, 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

I also see this right after a restart of hass and me probably reloading the dashboard too early:

2021-08-23 01:32:33 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547426358368] Received invalid command: spotcast/devices
  • [ X ] Using latest version of spotcast
  • [ X ] I have setup the Spotify integration in Home Assistant
  • I am using multiple accounts
  • [ X ] Using latest stable version of Home Assistant
  • [ X ] I have Spotify Premium
  • [ X ] 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

Environment (please complete the following information):

  • HA version: [ 2021.8.8 ]
  • spotcast version: [ 3.6.14 ]

Configuration

# Spotify
spotify:
  client_id: !secret spotify.client_id
  client_secret: !secret spotify.client_secret
# Spotcast
spotcast:
  sp_dc: ''
  sp_key: ''
  accounts:
    daften:
      sp_dc: !secret spotcast.daften_sp_dc
      sp_key: !secret spotcast.daften_sp_key

Additional context

spotcast_debug.txt

@daften
Copy link
Author

daften commented Aug 22, 2021

Some more info I just noticed. It seems spotify does try to connect to the chromecast device, but it just never starts playing. I can see this because the card for the cast player I have next to this, shows spotify connected to it at the time I tried to play a playlist.

@skipishere
Copy link

Possibly a duplicate of #241

@MetanoKid
Copy link

Had this issue, tried #244 and it's working now 👍

@daften
Copy link
Author

daften commented Aug 23, 2021

It is a duplicate, I'll close this and test #244. Sorry I missed that and thanks for the quick replies :)

@n00bcodr
Copy link

Can confirm fix mentioned in #244 works. Thanks!

@daften
Copy link
Author

daften commented Aug 23, 2021

#244 works for me too, closing this :)

@daften daften closed this as completed Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants