joshjcarrier / homeassistant-litter-robot

The litter-robot component offers integration with the Litter-Robot WiFi enabled devices to Home Assistant.
81 stars 15 forks source link

API key no longer works #9

Closed thayneq closed 4 years ago

thayneq commented 5 years ago

Just noticed this morning that hass.io is reporting the API key is no longer working.

The logs are attached:

2019-08-25 09:23:52 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for litter_robot which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant. 2019-08-25 09:23:53 INFO (MainThread) [homeassistant.setup] Setting up litter_robot 2019-08-25 09:23:54 INFO (SyncWorker_7) [custom_components.litter_robot] Trying to connect to Litter-Robot API 2019-08-25 09:24:03 WARNING (MainThread) [homeassistant.setup] Setup of litter_robot is taking over 10 seconds. 2019-08-25 09:24:23 ERROR (SyncWorker_7) [custom_components.litter_robot] Unable to connect to Litter-Robot API 2019-08-25 09:24:23 INFO (SyncWorker_7) [custom_components.litter_robot] Failed to login to Litter-Robot API 2019-08-25 09:24:23 INFO (MainThread) [homeassistant.setup] Setup of domain litter_robot took 30.0 seconds. 2019-08-25 09:24:23 ERROR (MainThread) [homeassistant.setup] Setup failed for litter_robot: Integration failed to initialize.

thayneq commented 5 years ago

I wonder if this has something to do with them supporting IFTTT?

joshjcarrier commented 5 years ago

I’m still seeing updates on my robot. Did this happen after you connected to IFTTT? Or did you happen to reset your Litter Robot password? I think the same API key ships with their mobile app so I would be surprised if it suddenly changed.

thayneq commented 5 years ago

It seems to be partially working. I can make service calls, and the robot responds, but the status is not updated accordingly.

seanharsh commented 4 years ago

Brand new setup, API key is being rejected.

joshjcarrier commented 4 years ago

Looks like the latest Litter Robot app update uses some new APIs. Investigating

joshjcarrier commented 4 years ago

Check out the latest version -- make sure you clear out your api_key configuration, won't be needing that anymore.

Also not sure if related to their app update but my robot hadn't been uploading stats for the last two weeks and wasn't responding to commands -- unplugging and plugging it back it fixed that.

seanharsh commented 4 years ago

No dice. Fresh install of Hassio to rule out junk errors. I noticed that you hard-coded the api key. Could they have switched this to a different key per user? Still complains about the API for me.

joshjcarrier commented 4 years ago

Good point. Do you know how to set up something like Charles Proxy to inspect your app traffic?

seanharsh commented 4 years ago

I am working on that right now.

seanharsh commented 4 years ago

OK, here is something interesting; found the API key matched what you coded as I passed the connection through Charles. Got me thinking. Signed out of the ios app and back in, still same API. Reset the password on the account, used new password in HA, and voila!

joshjcarrier commented 4 years ago

Cool! Do you think the issue was how the password was set in HA or should we document this as a potential litter robot api issue?

seanharsh commented 4 years ago

It is hard to tell now that it is working. I wondered if there was a token for my login that was expired. I didn't see a token in your code, so I can only assume that it may have been a fluke. Possibly could also have been an account lockout of sorts since I was trying to login using an old/bad api key. Something to keep in mine as a TS step if others still report issues.

joshjcarrier commented 4 years ago

Thanks, I've updated the readme with a troubleshooting section for your case. Enjoy the component!