-
Notifications
You must be signed in to change notification settings - Fork 4
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
No longer able to activate any of my Spotify Connect devices #38
Comments
@milnivlek What do you see when you issue the following ZeroConf mDNS query from a DOS prompt / terminal window? Should look something like this (me environment example), listing all of your Spotify Connect devices that are known to Zeroconf:
Also, do you have the Spotify LoginId value set (as well as userid and password) in your SpotifyPlus configuration options? |
Thanks thlucas1 for your quick follow-up. Here's what I see when I ran the command you gave:
And yes, I do have all these fields set: canonical loginid, username, password. Hope this helps! |
I just realized from this discussion thread that you are utilizing SnapCast to control your devices. I believe there are still ongoing With that said ... Questions:
Should look something like this (note these results are for one of my Bose SoundTouch devices):
|
Oops, I realized I made a typo in that other discussion thread. I use Snapcast, not Spotcast. In short, my Spotify Connect devices are Snapcast services that represent various groupings of my actual physical speakers. It's like Sonos groups, basically. But I do my playback via buttons on the Home Assistant UI using your SpotifyPlus integration. Or via the Spotify app (which has always worked fine with my Snapcast devices). Sorry for the confusion. I just corrected my typo in the other thread. As for your other question: here's the output of
|
The Are you seeing any of the following messages in your HA System Log? or in a There is also this issue on the SnapCast issues page that talks about At this point you probably need to reach out to either the Wish I could help more, but I don't use / know |
I really appreciate you trying your best to help, thlucas1. Thanks for all your hard work in supporting me and others. One thing to clarify though: Snapcast/librespot provides two login mechanisms:
I can still use the Spotify app to switch between different accounts on my Snapcast device. So the device itself is able to login with the credentials provided by the Spotify app. This gives me hope that this can be fixed solely on the client side. While I'm obviously not an expert (unlike you), I suspect the key issue here is that your Spotify API client library is constructing the Just out of curiosity, are you still able to login on your own Spotify Connect device? That is, if you switch your device to another user (e.g. via the Spotify app), is SpotifyPlus able to switch it back to the original user? Thank you once again! |
Actually - I just realized that you recently implemented sending the OAuth token in EDIT: Just to test it out, I made a local change to disable the condition on this line. I went through your instructions for generating the token file, and copied it to
even though I supposedly do have a valid token:
Not sure what I did wrong here. I can't use Smart Inspect since I don't have a Windows machine (only Mac and Linux). Oh well. Unfortunately I'll be out of town starting tomorrow, so I won't be able to try anything else for a bit. Hopefully you can reproduce the problem too on your end. |
Do you have the latest v1.0.52 version installed? I had to move the token cache file to the My Bose SoundTouch devices still function fine using the user-id and password credentials, but I believe that is because the Bose cloud is doing something to convert them into Zeroconf credentials. No problems yet with those devices. My Sonos Symfonisk is working fine with the SpotifyPlus OAuth2 token logic. The Spotify Web and Mobile players of course work fine - I believe they are using the same OAuth2 process to login to the devices with. In fact, the AuthTokenGenerator.py script that you ran to create the token simply specifies the Spotify Desktop application client id and prompts you to authorize that client id for your Spotify user-id. If you have Sonos devices, then you should be able to control them directly from SpotifyPlus without the need for SnapCast. I am not sure how that works though in your case, as I did not see any
This is what I see in my
I wonder if SnapCast (or librespot) is doing something to unregister the Anyhow, you should be able to query the Sonos device directly using the
Receiving output like this (abbreviated and redacted):
Note the The brand value differs from your SnapCast Hope that makes sense. |
Hi @thlucas1 -- Just wanted to close the loop and let you know that your new Not sure if you had my case in mind when you made this change. But regardless -- thank you so much for your dedication to building this HA integration. SpotifyPlus is amazing. I use it every day to automatically start music in the background, for my whole family's enjoyment. Thanks for making a small yet very real and tangible difference in the world! :) |
@milnivlek My apologies, but I totally forgot about your SnapCast issue. If memory serves, I think I was waiting for you to respond after you returned from being out of town. No worries though, as the librespot fix sounds like it took care of the problem. The v1.0.59 release seems to have fixed quite a few issues with products that utilize librespot: spotifyd, Spotify Connect AddOn, etc. Per your comment, it seems SnapCast falls into this category too since it utilizes librespot under the covers. Just curious as to how you configured the SnapCast portion of your setup with SpotifyPlus. I would like to add a SnapCast Configuration section to my existing librespot Device Support documentation, if you don't mind sharing how you set it up. Did you just create a |
Hey, that's the best kind of bugfix -- when you fix the deep root cause that's behind a whole bunch of other bugs, including some that you haven't even debugged fully yet! Happy to help you with the instructions for Snapcast, though there's not much to say honestly. Basically, Snapcast exposes a "cache" configuration parameter for setting librespot's cache directory. So I just set this parameter, connected from the Spotify app, and grabbed the To be more precise, here's what I did:
And nope I don't have to specify my Spotify username and password anywhere else, since I'm using ZeroConf. Snapcast does provide its own mechanism to pass hardcoded credentials to librespot, but that's not relevant to the use case where we need SpotifyPlus to do ZeroConf device activation. Hope this is sufficient to get you going with your documentation. Thanks again @thlucas1! |
Perfect - that’s exactly what I needed. I will get the docs updated with that today. Thank you for taking the time to do that, as I don’t have SnapCast installed. Appreciate it. |
@milnivlek Thanks - Todd |
System Health details
System Information
Home Assistant Community Store
AccuWeather
Home Assistant Cloud
Dashboards
Recorder
SpotifyPlus
Checklist
Describe the issue
Since a few days ago, all my scripts stopped being able to activate my Spotify Connect devices.
Specifically, when I call this:
I get the expected response with a device ID, e.g.
However, this device ID doesn't actually work. When I attempt to start a playback with this device ID, it doesn't recognize the device ID. Instead, I get this error:
Moreover, when I go to https://developer.spotify.com/documentation/web-api/reference/get-a-users-available-devices and run the Get Available Devices API request, I don't see my device in the returned list. It looks like
player_resolve_device_id
didn't login my account on the device at all.I also tried calling
spotifyplus.get_spotify_connect_device
instead (with verify_user_context: true), but the outcome was the same. I even tried callingspotifyplus.zeroconf_device_connect
directly with all the discovered device details. Still no luck.I checked my Spotify Connect username and password in the SpotifyPlus integration options, and they are still correct. I confirmed that I can still log in via the Spotify desktop web UI with those same credentials. It's just not working through SpotifyPlus.
Not sure if this is relevant, but I did some web searches and noticed this thread on the
librespot
project which indicated that Spotify just stopped supporting username/password based authentication for ZeroConf: librespot-org/librespot#1308 (comment). Could SpotifyPlus be affected by the same issue?Reproduction steps
See above write-up for steps.
Debug logs
Diagnostics dump
No response
The text was updated successfully, but these errors were encountered: