fondberg / spotcast

Home assistant custom component to start Spotify playback on an idle chromecast device as well as control spotify connect devices
Apache License 2.0
640 stars 94 forks source link

Starting Spotify playlist on Google home hub 'hangs' hub with spotify logo #411

Closed ghost closed 9 months ago

ghost commented 9 months ago

When starting a playlist on a Google Home hub, the spotify logo shows, but nothing starts to play, the whole system was running fine a few weeks ago

Checking the logs of home assistant shows the following error:

[Kamer luc(Local IP):8009] Exception caught while sending message to controller SpotifyController: Message urn:x-cast:com.spotify.chromecast.secure.v1 from 5f119208-0d97-47b5-8704-6db4ad2a267e to sender-0: {'type': 'getInfoResponse', 'payload': {'version': '2.9.0', 'publicKey': 'empty', 'remoteName': 'Spotify on Cast', 'deviceType': 'cast_video', 'brandDisplayName': 'google', 'modelDisplayName': 'Chromecast_Assistant_Touch', 'libraryVersion': '5.30.8', 'resolverVersion': '1', 'groupStatus': 'NONE', 'deviceAPI_isGroup': False, 'tokenType': 'accesstoken', 'clientID': 'd7df0887fb71494ea994202cb473eae7', 'productID': 0, 'scope': 'streaming', 'availability': '', 'spotifyError': 0, 'status': 101, 'statusString': 'OK'}}

X Using latest version of spotcast X Using latest stable version of Home Assistant X I have setup the Spotify integration in Home Assistant X I have renewed my sp_dc and sp_key values and restarted Home Assistant (see [README] -> checked hasn't changed TRUE (optional) I have Spotify Premium -> Yes TRUE [ ] (optional) I am using multiple accounts

Environment

Configuration

spotcast:
  sp_dc: !secret primary_sp_dc
  sp_key: !secret primary_sp_key
  country: NL #optional, added in 3.6.24
  accounts:
    luc:
      sp_dc: !secret luc_sp_dc
      sp_key: !secret luc_sp_key

Service Call

If relevant, provide a yaml of the service call or explain the action taken to replicate the issue.

service: spotcast.start
data:
  limit: 20
  force_playback: true
  shuffle: false
  offset: 0
  ignore_fully_played: false
  uri: spotify:album:45arPy65yO5Br2lZ7A4ZBs
  country: NL
  start_volume: 10
  device_name: Kamer luc
  account: luc

Logs

`This error originated from a custom integration.

Logger: pychromecast.socket_client
Source: custom_components/spotcast/spotify_controller.py:47
Integration: Spotcast (documentation, issues)
First occurred: 14:28:12 (1 occurrences)
Last logged: 14:28:12

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pychromecast/socket_client.py", line 719, in _route_message
    handled = handler.receive_message(message, data)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/spotcast/spotify_controller.py", line 47, in receive_message
    self.device = data["payload"]["deviceID"]
                  ~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'deviceID'`

Full debug log: https://hastebin.com/share/ceciquqoci.python

ghost commented 9 months ago

Issue closed, thought i was having the latest version because the 3.7.1 still has a manifest.json of v3.6.30