Closed tjridge closed 2 months ago
Please make sure the login information is correct and the DSN is correct.
Both are correct.
Seeing the same thing here. Was working flawlessly so my guess is Shark changed something backend since they just recently pushed out an app update where their maps were "redesigned".
> [8/9/2024, 5:56:21 PM] [SharkIQ] Invalid username or password.
> [8/9/2024, 5:56:21 PM] [SharkIQ] None of the DSNs provided matched the vacuum(s) on your account.
> [8/9/2024, 5:56:21 PM] [SharkIQ] If you recently updated, vacuums are obtained by the device serial number (DSN) instead of the vacuum serial number.
Environment:
Plugin Version: 1.1.2 Homebridge Version: 1.8.4 Node.js Version: 20.16.0 NPM Version: 10.8.1 Operating System: macOS Sonoma 14.5
@tjridge @mc473
Cannot reproduce. Are you on the US server or EU server?
US server.
Hi Bubba8291!
Apologies for not having helpful information ready for you - it's my first time reporting something related to Homebridge.
I'll attach my config.json with personal information redacted. At least I hope I got everything.
I am in the US. For grins last evening I did try switching to EU but that failed too.
Other things I have tried:
I cannot pinpoint the exact date this stopped working, but I would say within the last 3 to 4 days - 1 week maximum. I only happened to notice when I was updating my Ring plugin.
Hope this helps. I'm available to provide anything you need to pinpoint a cause.
Thank you, mc473
@mc473 Thank you!
I will check it in a little while. For now, can you comment your config.json again?
I removed it because the random string that is under the refresh token is sensitive. Treat those tokens like a password.
When you repost it, can you remove all the accessories in the accessories []? And for the platforms, can you remove everything except the SharKIQ platform section?
Thanks
@Bubba8291 Thank you for removing the json and educating me on the token portion.
I'm attaching the sanitized json based on your request - at least I think I did it correctly? config.json
There is no rush on my side - I can use the app to keep my floors squeaky clean for now.
Let me know if you need an actual account to test with - I'd be happy to help in any way I can.
Thank you! mc473
@mc473 thank you.
Can you edit the first part and include all of the information it asks for in the environment section?
Sure thing, @Bubba8291! I think I just updated as requested in my initial post. Let me know if this not what you meant…sometimes my comprehension is a bit off. 😂
@mc473 Thank you. I pushed a patch that gives more descriptive errors. Can you update and send the log?
@Bubba8291 Ok, updated to 1.1.3 and am including the log output below. Just to confirm, the username & password should be the same as used to log into the Shark app, correct?
[8/10/2024, 10:31:43 PM] [SharkIQ] Initializing SharkIQ platform...
[8/10/2024, 10:31:43 PM] Loading 11 accessories...
[8/10/2024, 10:31:43 PM] [SharkIQ] API Error: Unable to sign in. Status Code 401
[8/10/2024, 10:31:43 PM] [SharkIQ] Message: You have one more attempt before your account is locked.
[8/10/2024, 10:31:43 PM] [SharkIQ] Invalid username or password.
[8/10/2024, 10:31:43 PM]
NOTICE TO USERS AND PLUGIN DEVELOPERS
> Homebridge 2.0 is on the way and brings some breaking changes to existing plugins.
> Please visit the following link to learn more about the changes and how to prepare:
> https://github.com/homebridge/homebridge/wiki/Updating-To-Homebridge-v2.0
[8/10/2024, 10:31:44 PM] [SharkIQ] None of the DSNs provided matched the vacuum(s) on your account.
[8/10/2024, 10:31:44 PM] [SharkIQ] If you recently updated, vacuums are obtained by the device serial number (DSN) instead of the vacuum serial number.
@mc473 Is the username field in your config that you are using an email or an actual username you created?
I don't know if they have usernames since I've always used my email, but the direct API response without the locked message is:
Invalid email or password
When I made the plugin, I think it said username or password
, which is why the message says username
and not email. The plugin has that original message within the code if the status code is 401.
Yes, should be the same login in the Shark Clean app. Let me look into it a bit.
@Bubba8291 That makes sense. I am using my email since that’s required for setup. I see a 403 error now which is probably because the account is locked. I confirmed this by signing out of the app and trying to sign back in.
[8/10/2024, 11:09:43 PM] [SharkIQ] API Error: to sign in. Status Code 403
[8/10/2024, 11:09:43 PM] [SharkIQ] Message: You are forbidden to perform this operation
[8/10/2024, 11:09:43 PM] [SharkIQ] Invalid username or password.
@mc473 When you are able to log back in, let me know if that works and retry homebridge and see if you get any different error from the API Error Message error line.
@Bubba8291 I guess Shark is still mad at me. This is the error this morning. Let me try to create a new account and move my vacuums over. Give me a little bit to get that done. 👍
@Bubba8291 Ok, new account created and robots re-added. I am using the same credentials on the SharkIQ plugin as I am in the SharkIQ iOS app.
I do not mind sharing credentials with you privately if that helps in troubleshooting? Worst case is you just vacuum my floors repeatedly, right? 😂
[8/11/2024, 10:57:51 AM] [SharkIQ] API Error: Unable to sign in. Status Code 401
[8/11/2024, 10:57:51 AM] [SharkIQ] Message: Invalid email or password.
[8/11/2024, 10:57:51 AM] [SharkIQ] Invalid username or password.
[8/11/2024, 10:57:51 AM] [SharkIQ] None of the DSNs provided matched the vacuum(s) on your account.
[8/11/2024, 10:57:51 AM] [SharkIQ] If you recently updated, vacuums are obtained by the device serial number (DSN) instead of the vacuum serial number.
@mc473 Was able to reproduce
I created a new account for myself on the SharkClean app. Will investigate now.
I just got locked out of my main SharkClean account. I am not getting invalid login though, but You are forbidden to perform this operation
instead.
From inspecting the app HTTP requests, Shark change their login to oauth. So I got a bit of work to do.
It might take a few days for me to do it, so contributions would be helpful. :)
@Bubba8291 I'm afraid I'm no good with coding, and only know of OAUTH from dealing with Okta and SAML setups in a prior life.
Is this still correct for monetary contributions?
@mc473 Yes, it is. I appreciate the monetary contribution :)
@mc473 Can you test the rc version? Just install it with this command: npm install -g homebridge-sharkiq@v1.2.0-rc.1
After there are a few other steps for now.
cd $(npm root -g)/homebridge-sharkiq
node login.js
/authorize/resume
, open that one, and view the headerscom.sharkninja.shark
in the headerscode
in between code=
and &
. for example in com.sharkninja.shark://login.sharkninja.com/ios/com.sharkninja.shark/callback?code=abcdefghijkl&state=gibberish
, abcdefghijkl
is the code that needs to be copiedhttp://127.0.0.1:3000/oauth/callback?code=[CODE]
and replace [CODE]
with the code you just copiedsharkiq.json
file to the Homebridge storage directory (typically ~/.homebridge
) and save it as .sharkiq.json
. Typical command would be mv sharkiq.json ~/.homebridge/.sharkiq.json
This process will get tremendously better over the next few weeks, but this is just a starter for now. And doing these steps should be a one and done deal. Once you have that .sharkiq.json
file saved, the plugin should update it on its own whenever it needs a new token.
Please let me know if I need to clarify anything.
@Bubba8291 Thank you for working so quickly on this!
I got all the way to Step 11 and I'm not seeing a sharkiq.json file to move? Is this because I hadn't reconfigured the plugin before starting testing? I didn't have a user/pass or any vacuum IDs populated.
The good news is that there were no errors in Step 10. It gave me an access token, a refresh token, and an 'ok'.
OH wait...am I supposed to save that result as sharkiq.json and then move it?
@mc473 Yes, save the response as sharkiq.json
and then move it.
Step 11 doesn't work because I published the rc before I made the commit that saves it locally as well. That was my bad on saying it automatically saves locally in the steps.
There is still a lot to do, so it might not even need to be moved next time.
@Bubba8291 Great job my friend!!! It appears to have worked. 😎
I have three vacuums now.
@mc473 Glad to hear!
One more thing. Make sure the .sharkiq.json
file is owned by the user running Homebridge. If it's not, it will refresh the token without saving the JSON file.
If you need help with that, let me know.
@Bubba8291 I think I'm good there. Verified the owner on the file is me and Homebridge is running under my account - I'm the only user and the machine only runs Homebridge. If you'd like me to check further, pass along the instructions and I can verify. Again, appreciate the attention you've given to this.
Published #19
Describe The Bug:
Unable to ad devices To Reproduce:
Expected behavior:
Logs:
[08/08/2024, 00:18:151 [SharkIQ] Invalid username or password. [08/08/2024, 00:18:151 [SharkIQ] Invalid username or password. [08/08/2024, 00:18:151 [SharkIQ] None of the DSNs provided matched the vacuum(s) on you r account. [08/08/2024, 00:18:151 [SharkIQ] If you recently updated, vacuums are obtained by the d evice serial number (DSN) instead of the vacuum serial number.
Plugin Config:
Screenshots:
Environment: