romedtino / simple-wyze-vac

Home Assistant Custom Component for Wyze Vacuum
48 stars 8 forks source link

Can't log in, appears to be due to the new API requirements #66

Closed kennethpangky closed 1 year ago

kennethpangky commented 1 year ago

Hi, just observed can't log in today. From reading wyze-sdk it appears to be due to the new api.

https://github.com/shauntarves/wyze-sdk/pull/140

Just a post here for people who encounter the same issue. Looking forward to see it resolved/merged in due time thanks!

romedtino commented 1 year ago

Yeah, I'm watching the PR, just waiting for shaun to incorporate or see if he changes the approach. If it sits there for awhile, I'll probably just go ahead and pull on my fork. It seems the API will be the only way to really login now so I'll have to prompt for it at configuration setup regardless. Might as well bite the bullet now

Mr-HaleYa commented 1 year ago

Since you say you'll prompt on config, does that mean we all have to remove the integration and re-set it up to get that initial config popup or will it be in the same config menu as the polling settings?

Have you seen the Docker Wyze Bridge and how it has multiple different ways to auth? image

romedtino commented 1 year ago

Yes, most likely going to have to remove integration and re-add due to this change since the login is really just the top level config flow and not the options flow.

Docker Wyze Bridge looks like it uses its own authentication handler while I'm just piggy backing off of wyze-sdk. So I only have auth methods that wyze-sdk has

romedtino commented 1 year ago

Beta can be had here and auth seems to work with the upcoming PR of wyze-sdk - If you'd like to try it yourself: https://github.com/romedtino/simple-wyze-vac/releases/tag/1.8.6

Don't forget:

kennethpangky commented 1 year ago

Tested, works great. Thanks!

PyroghostX commented 1 year ago

Worked! Thanks for the quick fix

PyroghostX commented 1 year ago

only small thing is there is no headers for the key_id and api_key on the login popup, might confuse someone :P

romedtino commented 1 year ago

Awesome thanks! The last version should have those descriptions now and a blurb in the README mentioning it's a requirement to have the API key to use this integration. Thanks for trying it out!

dinki commented 1 year ago

@romedtino Thanks for providing this. Try as I might, I cannot authenticate. I updated HACS tried removing integration but I could not get it to work without restarting. Restarted and removed. Restarted again and then tried adding integration but it is failing.

I've generated the keys and the totp code from the setup auth page but it continues to tell me wrong username/password. I know that I am using correct username and password as it is saved in vaultwarden. Any ideas on what I might need to do?

romedtino commented 1 year ago

Before the mandatory KEY ID/ API KEY, were you able to login on simple wyze vac before using your username/password/totp?

dinki commented 1 year ago

Before the mandatory KEY ID/ API KEY, were you able to login on simple wyze vac before using your username/password/totp?

Yes. I have been using this integration for a very long time prior to needing the update.

Can I just remove again, delete integration from disk (or make sure it's not there), restart, and reinstall and try again? I'd prefer not to have to set up the device/zones/etc if possible.

romedtino commented 1 year ago

Before the mandatory KEY ID/ API KEY, were you able to login on simple wyze vac before using your username/password/totp?

Yes. I have been using this integration for a very long time prior to needing the update.

Can I just remove again, delete integration from disk (or make sure it's not there), restart, and reinstall and try again? I'd prefer not to have to set up the device/zones/etc if possible.

I think that should be fine. You shouldn't lose anything especially if the entity IDs just match the same ones once you add the integration back. If you can share the logs too if it has any errors related to the integration, that would be great.

dinki commented 1 year ago
2023-07-26 07:09:29.707 WARNING (SyncWorker_5) [homeassistant.loader] We found a custom integration simple_wyze_vac which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-26 07:09:29.732 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Post installation steps completed
2023-07-26 07:09:48.568 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Running pre installation steps
2023-07-26 07:09:48.568 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Pre installation steps completed
2023-07-26 07:09:48.568 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Running installation steps
2023-07-26 07:09:49.705 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of __init__.py completed
2023-07-26 07:09:49.707 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of config_flow.py completed
2023-07-26 07:09:49.707 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of const.py completed
2023-07-26 07:09:49.710 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of strings.json completed
2023-07-26 07:09:49.710 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of switch.py completed
2023-07-26 07:09:49.711 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of services.yaml completed
2023-07-26 07:09:49.712 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of en.json completed
2023-07-26 07:09:49.717 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of manifest.json completed
2023-07-26 07:09:49.717 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of vacuum.py completed
2023-07-26 07:09:49.718 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Download of camera.py completed
2023-07-26 07:09:50.719 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Installation steps completed
2023-07-26 07:09:50.719 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Running post installation steps
2023-07-26 07:09:50.723 INFO (SyncWorker_6) [homeassistant.loader] Loaded simple_wyze_vac from custom_components.simple_wyze_vac
2023-07-26 07:09:50.723 WARNING (SyncWorker_6) [homeassistant.loader] We found a custom integration simple_wyze_vac which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-07-26 07:09:50.729 INFO (MainThread) [custom_components.hacs] <Integration romedtino/simple-wyze-vac> Post installation steps completed
2023-07-26 07:10:06.550 INFO (SyncWorker_1) [homeassistant.util.package] Attempting install of https://github.com/romedtino/wyze-sdk/archive/refs/tags/10.4.1.zip#wyze-sdk==10.4.1
2023-07-26 07:13:50.827 INFO (SyncWorker_12) [wyze_sdk.service.base] requesting POST to https://auth-prod.api.wyze.com/api/user/login
2023-07-26 07:13:53.580 ERROR (MainThread) [custom_components.simple_wyze_vac.config_flow] Failed to login Wyze servers.

@romedtino I removed integration from disk, restarted HASS, redownloaded in HASS and attempted setting up as integration. Still seeing login error. I'd like to confirm that I am entering things correctly:

Username : my Wyze account email Password: my Wyze account password Wyze API Key ID: Key Id Wyze API Auth Key: Api Key Base32 Key: The value copied from set up 2FA. This value is entered into auth app so it can add account for 2FA six digit code

Is that right? I did remove and regenerate API key today to ensure that wasn't a problem. I know my username/password/api creds and copied the base32 key but still can't get in. Sorry for the troubles.

dinki commented 1 year ago

Before the mandatory KEY ID/ API KEY, were you able to login on simple wyze vac before using your username/password/totp?

Yes. I have been using this integration for a very long time prior to needing the update. Can I just remove again, delete integration from disk (or make sure it's not there), restart, and reinstall and try again? I'd prefer not to have to set up the device/zones/etc if possible.

I think that should be fine. You shouldn't lose anything especially if the entity IDs just match the same ones once you add the integration back. If you can share the logs too if it has any errors related to the integration, that would be great.

Apologies for all of this. I got it working. Despite being able to log in without issue I decided to change my password. I noticed that the minimum length of password is longer than the one I had been using. I entered a new password and everything works now. Ermmmff.. Working now so moving on. Great work on getting this vac integrated.

romedtino commented 1 year ago

Closed as this is now fixed