Closed robkjr closed 2 years ago
Guys I'm a novice, please guide me on what to do here please 🙏
-------- Original message -------- From: Pollot @.> Date: 9/3/22 23:37 (GMT+02:00) To: fondberg/spotcast @.> Cc: Regan Erasmus @.>, Comment @.> Subject: Re: [fondberg/spotcast] Spotcast stopped working. (Issue #347)
@Gramatushttps://github.com/Gramatus works like a charm! Big thanks for your work.
— Reply to this email directly, view it on GitHubhttps://github.com/fondberg/spotcast/issues/347#issuecomment-1236201971, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2UTKFY55YGVUNE5CP7D6J3V4PAKFANCNFSM6AAAAAAQAXFGJI. You are receiving this because you commented.Message ID: @.***>
Disclaimer
The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
For those of you who are not experienced with modifying files in HA yourselves, there is no need. At some point (hopefully soon) a fix will be released as a part of the oficial Spotcast, and it will then show up as an update in HACS. Until then, those who know how to fix it themselves are great testers, and also please let the maintainers of Spotcast have the time they need to review the changes and confirm everything is good to go.
For newbies who don't want to wait to play: In the branch, click Code and download the zip. I opened my HA files using samba, replaced the spotcast folder in the config/custom_components folder with the spotcast folder in the zip, then restarted HA. I didn't see any change, then I discovered in integrations that I needed to add all of my Spotify accounts through a new Spotcast integration. When you first start the integration, provide the name and IDs for your developer app, then add each account like you would with the Spotify integration (log in to new Spotify account in browser, then choose add integration, choose Spotcast, then link new account, repeat for each account)
The spotify card is working again, but I can't choose any of my Chromecast devices in the drop-down list. I'm not sure if I just need to do some more setup since I also just switched from Alexa to Google, though, or if this is an issue with Spotify now having the separate Google Cast popup.
I can't get spotcast.start to work with the Google Cast speakers unless Spotify is already actively playing on that specific speaker (must first be initiated from Spotify's interface, select Google Cast, then the device from the popup). As soon as you stop playing on a Google Cast device, the device immediately disappears from the active device list in Spotify - you have to go through the Google Cast popup again - and using spotcast.start on that speaker starts failing immediately as well. Using the Spotify device ID for the speaker doesn't work either. On the spotify-card, I can use the various play controls and change the playlist ONLY if Spotify is already playing. I can't initiate play or transfer play to a new google speaker - they all come up in the list, but choosing one does nothing.
The auth process is definitely fixed, but others reported that everything is working at it was, so am I missing something here?
Wow thank you all for the troubleshooting, I reserved some time tomorrow morning I will go over the change and work on drafting a PR to implement the changes.
The auth process is definitely fixed, but others reported that everything is working at it was, so am I missing something here?
I have two branches in my fork. One including oauth implementation (and think you must be using that) and one that just changes the user-agent string. The first doesn't actually fix the issue, the other does work at least for me and some others. The correct branch is named fix_user_agent.
This may just be a coincidence but I thought I'd post it anyway. Woke up this morning to both my Spotify accounts in the official Spotify integration marked as unavailable. I had to reload both to get them up and running again.
Thanks @Gramatus! I just used my File Editor built into HA to copy and paste over the old "spotcast_contorller.py" info with the new one you provided in the "fix_user_agent" and all is working well again. Original file had 314 lines of code, new one has 341. I can cast directly to my Google devices again without issue. THANK YOU!!
@robkjr saw that behavior un one of my reboot of the dev machine while doing regression testing for the new PR. I can confirm I only got this error one time and have restarted multiple time at that point.
Saddly, we can't really check early for the status of the official spotify integration (unless we have a better way eventually) because we tried in the past and got stuck in a race condition
@robkjr saw that behavior un one of my reboot of the dev machine while doing regression testing for the new PR. I can confirm I only got this error one time and have restarted multiple time at that point.
Saddly, we can't really check early for the status of the official spotify integration (unless we have a better way eventually) because we tried in the past and got stuck in a race condition
I just wanted to post the behavior in the record just in case it was related to the Spotcast issue.
Patiently awaiting an official update so I can get back to my whole house media work. ;-)
The auth process is definitely fixed, but others reported that everything is working at it was, so am I missing something here?
I have two branches in my fork. One including oauth implementation (and think you must be using that) and one that just changes the user-agent string. The first doesn't actually fix the issue, the other does work at least for me and some others. The correct branch is named fix_user_agent.
Confirmed that it works for me. Gramatus you rock !
Thanks for clarifying - now that I'm using the correct branch, I can start play and switch speakers without issue!
Wanting a fresh setup yesterday given the Spotify auth updates, I relinked my official Spotify integration. The main thing to look out for is that the accounts are initially disabled by default, making them "unavailable." After adding an account, you need to go into the entity > advanced > enable. I wonder if the accounts being unavailable had anything to do with that?
@foxymichelle, all I did with my Spotify accounts was click the 3 dots and choose Reload. That brought them both online.
@Gramatus My man! Thanks. Great work. Up and running again.
This all looks promising, I'm so happy. But for me who is not that technical, what exactly is the fix?
So happy to see you figured this one out so quickly? Great work! Now, ship it, before our Monday morning alarms are supposed to trigger! ⏰ 😆
Working perfectly!!! Thanks!!! Even the Spotify Playlist Sensor is working! again
Thank you @Gramatus for the PR. spotcast 3.6.30 is live with the change. The repo will be open for 48h to chek that everything works fine. Please react to this comment is all is good. If you have any problem tag me in your comment so I can look over it.
Works! Thank you so much 💜
Hi @robkjr, I've updated to v3.6.30 but spotcast doesn't want to run and I have received the error below.
"2022-09-05 13:37:06.450 ERROR (MainThread) [homeassistant.components.script.spotcasttest] SpotcastTest: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object is not subscriptable"
//---------------------------------------------------- FULL LOG
2022-09-05 13:37:06.001 INFO (MainThread) [homeassistant.components.script.spotcasttest] SpotcastTest: Running script sequence 2022-09-05 13:37:06.001 INFO (MainThread) [homeassistant.components.script.spotcasttest] SpotcastTest: Executing step call service 2022-09-05 13:37:06.450 ERROR (MainThread) [homeassistant.components.script.spotcasttest] SpotcastTest: Error executing script. Unexpected error for call_service at pos 1: 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in _execute_service await self._hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) File "/config/custom_components/spotcast/init.py", line 190, in start_casting spotify_device_id = spotcast_controller.get_spotify_device_id( File "/config/custom_components/spotcast/spotcast_controller.py", line 231, in get_spotify_device_id spotify_device_id = self._getSpotifyConnectDeviceId(client, device_name) File "/config/custom_components/spotcast/spotcast_controller.py", line 218, in _getSpotifyConnectDeviceId for device in devices_available["devices"]: TypeError: 'NoneType' object is not subscriptable 2022-09-05 13:37:06.474 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547164866784] 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 199, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1750, in _execute_service await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)( File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 290, in service_handler await script_entity.async_turn_on( File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 398, in async_turn_on await coro File "/usr/src/homeassistant/homeassistant/components/script/init.py", line 428, in _async_run return await self.script.async_run(script_vars, context) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1513, in async_run await asyncio.shield(run.async_run()) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 405, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 449, in _async_step self._handle_exception( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 472, in _handle_exception raise exception File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 447, in _async_step await getattr(self, handler)() File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 680, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1713, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in _execute_service await self._hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/config/custom_components/spotcast/init.py", line 190, in start_casting spotify_device_id = spotcast_controller.get_spotify_device_id( File "/config/custom_components/spotcast/spotcast_controller.py", line 231, in get_spotify_device_id spotify_device_id = self._getSpotifyConnectDeviceId(client, device_name) File "/config/custom_components/spotcast/spotcast_controller.py", line 218, in _getSpotifyConnectDeviceId for device in devices_available["devices"]: TypeError: 'NoneType' object is not subscriptable
This is working again, amazing well done
-------- Original message -------- From: Felix Cusson @.> Date: 9/5/22 03:05 (GMT+02:00) To: fondberg/spotcast @.> Cc: Regan Erasmus @.>, Comment @.> Subject: Re: [fondberg/spotcast] Spotcast stopped working. (Issue #347)
Thank you @Gramatushttps://github.com/Gramatus for the PR. spotcast 3.6.30 is live with the change. The repo will be open for 48h to chek that everything works fine. Please react to this comment is all is good. If you have any problem tag me in your comment so I can look over it.
— Reply to this email directly, view it on GitHubhttps://github.com/fondberg/spotcast/issues/347#issuecomment-1236456551, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2UTKF6VLH3JM5LKUIN2E2DV4VBORANCNFSM6AAAAAAQAXFGJI. You are receiving this because you commented.Message ID: @.***>
Disclaimer
The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
Not working for me either sorry. I have the same error:
2022-09-05 17:41:27.768 ERROR (MainThread) [homeassistant.core] Error executing service: <ServiceCall spotcast.start (c:<SNIPPED>): entity_id=media_player.home, uri=spotify:playlist:<SNIPPED>, offset=0, random_song=False, shuffle=False, repeat=off, force_playback=False, ignore_fully_played=False, limit=20, start_volume=101>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1731, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in _execute_service
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/spotcast/__init__.py", line 190, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/config/custom_components/spotcast/spotcast_controller.py", line 231, in get_spotify_device_id
spotify_device_id = self._getSpotifyConnectDeviceId(client, device_name)
File "/config/custom_components/spotcast/spotcast_controller.py", line 218, in _getSpotifyConnectDeviceId
for device in devices_available["devices"]:
TypeError: 'NoneType' object is not subscriptable
:-(
File "/config/custom_components/spotcast/spotcast_controller.py", line 218, in _getSpotifyConnectDeviceId for device in devices_available["devices"]: TypeError: 'NoneType' object is not subscriptable
For those getting this error, is your regular Spotify integration working? This error should not be related to what have just been fixed, as it is caused by not being able to read the device list from the regular HA Spotify integration.
Special note, which might not be applicable, if you have added the regular Spotify integration as a custom component (as I did at one point during my troubleshooting) you will (probably?) get this error.
Many thanks for the support guys, it works flawless again. No coffee, but some well deserved cold beers coming your way. :) Still one question: do we still need the sp_dc and the sp_key in the config file?
Still one question: do we still need the sp_dc and the sp_key in the config file?
Yes, no changes there.
Hi,
For those getting this error, is your regular Spotify integration working? This error should not be related to what have just been fixed, as it is caused by not being able to read the device list from the regular HA Spotify integration.
Yes - I can go to any of my Sonos or Google speakers, click media, and browse my Spotify accounts, playlists etc. But I cannot initiate playback - clicking "play" does nothing. Interestingly, and I suspect this will give you a clue, I also run the Spotify Lovelace Card and while it can 'see' the media_player entities when you edit the card configuration the "Choose Player" is empty with a message "No devices found". So something is definitely not right.....
Any tips for troubleshooting?
Thanks to everyone who helped with this fix!! I just got home from a beach trip and tested my automation, and all is good again.
@ChirpyTurnip
Any tips for troubleshooting?
This problem is related to #334, we have a fix candidate, but after doing the regression testing I found some problem in the code. Mainly, it works to correct the problem, but the modification breaks other functionnality. At the moment I am still troubleshooting.
We should have a much better grasp of the problem next weekend where I will be able to lock some time to work on the project. I really need to allocate my week time for work and family.
We should have a much better grasp of the problem next weekend where I will be able to lock some time to work on the project. I really need to allocate my week time for work and family.
@fcusson - the software is free (and good) - I'm in no rush at all so you do what you need to do! :-) The main thing for me, as with any such bug, is that it's reported so that someone somewhere will fix it at some stage. Enjoy your week and we'll see a fix at some stage no doubt!
I still have the same error even after the last update :
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1731, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in _execute_service
await self._hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/spotcast/__init__.py", line 190, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/config/custom_components/spotcast/spotcast_controller.py", line 231, in get_spotify_device_id
spotify_device_id = self._getSpotifyConnectDeviceId(client, device_name)
File "/config/custom_components/spotcast/spotcast_controller.py", line 218, in _getSpotifyConnectDeviceId
for device in devices_available["devices"]:
TypeError: 'NoneType' object is not subscriptable
I still have the same error even after the last update :
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1731, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in _execute_service await self._hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/spotcast/__init__.py", line 190, in start_casting spotify_device_id = spotcast_controller.get_spotify_device_id( File "/config/custom_components/spotcast/spotcast_controller.py", line 231, in get_spotify_device_id spotify_device_id = self._getSpotifyConnectDeviceId(client, device_name) File "/config/custom_components/spotcast/spotcast_controller.py", line 218, in _getSpotifyConnectDeviceId for device in devices_available["devices"]: TypeError: 'NoneType' object is not subscriptable
@AquZziaa
NoneType object is not subscriptable
was not part of this fix, please refer to #334 for this problem we are currently working on a fix
Since no bug in 48 hours were reported (other than the NoneType error which was existing before this one appeared.
I am closing this issue
What is this all about? I was able to cast to google speakers and groups last night, but today I get this in the logs. Any ideas? I've tried to update the DC and KEY, but that hasn't worked.
Logger: homeassistant.core Source: custom_components/spotcast/spotify_controller.py:104 Integration: Spotcast (documentation, issues) First occurred: 3:44:55 PM (1 occurrences) Last logged: 3:44:55 PM
Error executing service: <ServiceCall spotcast.start (c:01GBR4HM5R48VM4SZARPTDSMZ4): entity_id=media_player.allspeakers, uri=spotify:playlist:37i9dQZF1DWSSWiBVaJn3j, random_song=False, force_playback=False, start_volume=101, limit=20, repeat=off, ignore_fully_played=False, shuffle=False, offset=0> Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/core.py", line 1731, in catch_exceptions await coro_or_task File "/usr/src/homeassistant/homeassistant/core.py", line 1756, in _execute_service await self._hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/spotcast/init.py", line 190, in start_casting spotify_device_id = spotcast_controller.get_spotify_device_id( File "/config/custom_components/spotcast/spotcast_controller.py", line 209, in get_spotify_device_id spotify_cast_device.startSpotifyController(access_token, expires) File "/config/custom_components/spotcast/spotcast_controller.py", line 88, in startSpotifyController sp.launch_app() File "/config/custom_components/spotcast/spotify_controller.py", line 104, in launch_app raise LaunchError( pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app