-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Spotify connect devices not found with multiple accounts #358
Comments
I have exactly the same issue. We have three Musiccast device in the kids and parents bedrooms. I have an alarm script that starts a Spotify playlist from the corresponding account. However, when my wife or I use our phone to turn on some music before, the script doesn't work anymore using the kids accounts. I was thinking of using an additional media player to free the device from the old account which isn't a pretty solution either. Switching from the spotify_device_id to device_name doesn't help. |
@tikeyknax the first problem you had should normally be resolved with v3.7.0. Can you confirm if it works now. |
@DennisWilken can you provide a debug log, I want to check if you have the same problem or a different error call |
@fcusson sure! I just update to version 3.7. Home assistant is on version 2023.2.4. I ran the script:
and after that the script testspotifyviola with the account "viola". This the log that I got on debug level.
Is there more information that you need? P.S. Is there an easy way to export the log filtered by component? In the UI I don't see the debug output. In the full log that I downloaded, I had to manually pick the relevant pieces. |
You can simply input a search in the log page, it filter your full log to only the lines with your search terms. So if I understand correctly, the problem onyl seems to happen when the player is already in use by another account? Can you confirm I understand or clarify? I want to make sure I check for the right thing. Also I just got my partner to update her sp_dc and sp_key so I can finally restart doing multi account test. I should be able to debug the problem now. |
That's right. The device can be turned off for a while. I can also change the source to something else on the media player, e.g. radio. As long as the last spotify account playing something on the device doesn't match the one used by spotcast, I run into the issue. I also tested a JBL speaker that is regconised as a Google Cast device with the same issue. I am curious to see if you can reproduce the problem. Thanks for the support! |
@fcusson Thanks for taking a look into the issue. It took me a while to update. By now, @DennisWilken has already provide the answers. I can confirm that the issue still exists independent of whether I use the device name or the device id. |
I too have the same problem... I have a HEOS speaker that is usually controlled from HA with a spotify account I made specifically for HA, and it works really well... but occasionally someone in the house uses their spotify phone app to directly cast to that speaker from their phone and their spotify account. From what I can tell, the Spotify API will stop returning the device when called from the HA account, when a different account was the last to access/use it. I'm assuming that is what causes the 'device not found' errors with SpotCast. It seems that the official Spotify apps, on phones, or even the Windows app, will detect speakers on the local network (not just from the API) and reassign/add them back to the active account... It seems SpotCast doesn't have this power (yet?). My only solution thus far, is when this problem is discovered/reported, I log into the HA spotify account on my windows app and start a song to that speaker, that re-associates it to the HA account and then all my automatons work fine again. (until somebody else uses the speaker again, fortunately for me, this is rare) |
Indeed it looks like the Spotify API does not return the spotify connect device anymore when another user is already connected to that device. The only way to make it show up in the API is by joining a group session or by taking over the device in another (desktop/mobile) client. Seems the spotify web client also uses the same API as it has the same problem. |
This renders the spotify integration and spotcast pretty useless for multi-user use... |
Has anyone found a fix for this yet? |
The problem is with the spotify Api. Devices already in use by another account will not show up as available until they are no longer in use. At the moment, the best solution is to stop the media playing from the other account and then making the service call to spotcast. |
Has anyone had a look if the problem has been discussed in the Spotify Developer Community ? I will have a look, as soon as I find the time. I have the problem that my wife often turns on some music on my kid's speaker with her phone. In this case, when the morning alarm routine starts, Spotcast can't use my kid's account to start playing on their speakers. If I understand correctly, would it be sufficient if I connected my wife's account to a different speaker before I run the alarm? Is it possible to somehow, as a workaround, set up virtual dummy speakers for that purpose? |
This issue is also occurring with my HEOS device, so I don’t think it is Alexa only. Are there any reliable and automated ways to solve this? I’d be OK with making a “Switch” button that triggers Spotify to stop playing, then triggers any stream through the other account. |
working on it for v4. Its going to be part of the standard workflow. But I will need help from developpers with Alexa devices that will be able to work on deregistering an application to be able to register on a second account after. |
I'm using spotcast with multiple spotify accounts and on different spotify connect devices. It works nicely if the spotify account I'm using in spotcast is the last one that played anything on the spotify connect device that I'm using. However, if the other spotify account was recently using that device, it fails with a "Device not found" or "Could not find device" error, see log below.
I'm not sure but this might be a restriction of spotify itself, so maybe it cannot be fixed in spotcast. If not, maybe a workaround to use the account that last played on the device could be used. I'm currently using such a workaround in my script:
Log with spotify_device_id:
Log with friendly name:
sp_dc
andsp_key
values and restarted Home Assistant (see README)Environment
The text was updated successfully, but these errors were encountered: