explosivo22 / kwikset-ha

Kwikset Smart Locks integration for Home Assistant. The Kwikset App is exclusively for use with Kwikset Halo, Halo Touch, and Aura smart locks.
Apache License 2.0
34 stars 2 forks source link

Integration no longer working after 2023.5 #58

Closed cjburchell closed 1 year ago

cjburchell commented 1 year ago

I upgraded to 2023.5 of HA and I am no longer able to load the integration:

Logs: 2023-05-04 19:42:39.961 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration kwikset 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-05-04 19:42:39.962 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration kwikset 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-05-04 19:46:41.521 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home for kwikset File "/config/custom_components/kwikset-ha/__init__.py", line 53, in async_setup_entry 2023-05-04 19:46:41.525 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/diagnostics.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.diagnostics' 2023-05-04 19:46:41.526 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/recorder.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.recorder' 2023-05-04 19:46:41.527 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/media_source.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.media_source' 2023-05-04 19:46:41.528 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/group.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.group' 2023-05-04 19:46:41.529 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/logbook.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.logbook' 2023-05-04 19:46:41.529 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/system_health.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.system_health' 2023-05-04 19:46:41.530 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/significant_change.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.significant_change' 2023-05-04 20:02:59.598 ERROR (MainThread) [homeassistant.helpers.integration_platform] Unexpected error importing kwikset/hardware.py ModuleNotFoundError: No module named 'custom_components.kwikset-ha.hardware' 2023-05-05 05:53:31.062 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home for kwikset File "/config/custom_components/kwikset-ha/__init__.py", line 53, in async_setup_entry 2023-05-05 05:58:15.435 WARNING (SyncWorker_62) [homeassistant.loader] We found a custom integration kwikset 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-05-05 05:58:44.090 WARNING (SyncWorker_26) [homeassistant.loader] We found a custom integration kwikset 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-05-05 05:58:44.092 WARNING (SyncWorker_26) [homeassistant.loader] We found a custom integration kwikset 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-05-05 05:59:55.059 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Home for kwikset File "/config/custom_components/kwikset-ha/__init__.py", line 53, in async_setup_entry

bh56 commented 1 year ago

I'm using 2023.5.2 and the integration is working for me, other than the roughly weekly issue where my token/authentication goes stale and integration will stop working. I usually won't know about it until I do a manual refresh, which then throws and error. Have you tried doing a refresh?

mingaldrichgan commented 1 year ago

Same

cjburchell commented 1 year ago

Yes I have refreshed several times and also uninstalled/reinstalled the feature adding back my credentials

explosivo22 commented 1 year ago

I would almost say this is an issue with home assistant. The files being referenced from the log are not directly included with the integration except for the init.py file.

I know there are no files called significant_change or hardware or even system_health that have been coded.

Was this working before 2023.5?

drac0linux commented 1 year ago

Hello,

Once again this is broken for me, I was hoping something easy such as re-loading or reinstalling the integration would fix it. Unfortunately, not. I have tried re-authenticating, reinstalling, deleting, and reinstalling, but all have failed.

I agree with the observation that it seems related to the 2023.5 update, as this is when everything stopped working again. As before when Kwikset changed things up and things got broken, I'll be happy to provide log files or anything else you ask for. As for now, my integration with Kwikset is no longer working since I can no longer authenticate. When I try, I get a, "Unknown error occurred" error.

Short of getting rid of the Kwikset lock and finding something that works more reliably with Home Assistant, I'm not sure what else to try.

drac0linux commented 1 year ago

`This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/kwikset/config_flow.py:80 Integration: Kwikset Smart Locks (documentation) First occurred: 8:56:08 PM (2 occurrences) Last logged: 9:09:26 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/kwikset/config_flow.py", line 68, in async_step_code_type return await self.async_step_code() File "/config/custom_components/kwikset/config_flow.py", line 80, in async_step_code self.pre_auth = await self.api.authenticate(self.password, self.code_type) File "/usr/local/lib/python3.10/site-packages/aiokwikset/api.py", line 241, in authenticate pre_verification = await self.aws.authenticate_user() File "/usr/local/lib/python3.10/site-packages/aiokwikset/aws_kwikset.py", line 259, in authenticate_user if custom_challenge['ChallengeName'] == self.CUSTOM_VERIFIER_CHALLENGE: KeyError: 'ChallengeName' `

Have tried both the email and phone option to authenticate.

explosivo22 commented 1 year ago

Ok. Let me look into this more. The error would be more related to the integration with that error. I will see if I can replicate this on my end.

What is the exact version of your HA install?

Also, are you trying to set this up via the app, phone browser, or PC browser?

drac0linux commented 1 year ago

At this moment:

Home Assistant 2023.5.4 Supervisor 2023.04.1 Operating System 10.1 Frontend 20230503.3 - latest

I've tried all three, mobile app, mobile Chrome, and chrome on PC. Have not yet tried other browsers yet.

explosivo22 commented 1 year ago

Are you getting this error while setting the integration back up or is it happening setup?

From the log, I am guessing during setup, but I want to replicate this exactly.

drac0linux commented 1 year ago

I had unistalled because last time I had to do the same, so the errors are happening at setup.

explosivo22 commented 1 year ago

Thanks. I will remove the integration from my test environment and make sure I match and give it a go on adding it back.

explosivo22 commented 1 year ago

I have completely removed the integration and made sure I was running everything on the same version before I attempted a reinstall. I was unable to replicate the issue on my end and got my verification code and logged right in.

Just to investigate a little further, under your account settings your phone number is populated, I am assuming yes since you tried to the sms verification. The 2-Step Verification toggle is also turned on correct?

drac0linux commented 1 year ago

I just tried with both 2 step verification on and off. Screenshot_20230524_232601_Kwikset

This is with 2SV on, tried both email and phone options. This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/kwikset/config_flow.py:80 Integration: Kwikset Smart Locks (documentation) First occurred: 11:23:24 PM (3 occurrences) Last logged: 11:30:08 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/kwikset/config_flow.py", line 68, in async_step_code_type return await self.async_step_code() File "/config/custom_components/kwikset/config_flow.py", line 80, in async_step_code self.pre_auth = await self.api.authenticate(self.password, self.code_type) File "/usr/local/lib/python3.10/site-packages/aiokwikset/api.py", line 241, in authenticate pre_verification = await self.aws.authenticate_user() File "/usr/local/lib/python3.10/site-packages/aiokwikset/aws_kwikset.py", line 244, in authenticate_user response = await client.initiate_auth( File "/usr/local/lib/python3.10/site-packages/aiobotocore/client.py", line 225, in _make_api_call raise error_class(parsed_response, operation_name) botocore.errorfactory.UserNotFoundException: An error occurred (UserNotFoundException) when calling the InitiateAuth operation: User does not exist.

It is interesting that it says user does not exist, as I'm very much logged in and using the Kwikset app.

This is with 2SV off:

This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/kwikset/config_flow.py:80 Integration: Kwikset Smart Locks (documentation) First occurred: 11:35:09 PM (1 occurrences) Last logged: 11:35:09 PM

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 94, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/kwikset/config_flow.py", line 68, in async_step_code_type return await self.async_step_code() File "/config/custom_components/kwikset/config_flow.py", line 80, in async_step_code self.pre_auth = await self.api.authenticate(self.password, self.code_type) File "/usr/local/lib/python3.10/site-packages/aiokwikset/api.py", line 241, in authenticate pre_verification = await self.aws.authenticate_user() File "/usr/local/lib/python3.10/site-packages/aiokwikset/aws_kwikset.py", line 259, in authenticate_user if custom_challenge['ChallengeName'] == self.CUSTOM_VERIFIER_CHALLENGE: KeyError: 'ChallengeName'

explosivo22 commented 1 year ago

This has definitely peaked my interest as to what is going on. Turning off 2-step verification is new so I am working through steps to solve that issue, but I am curious as to why it won't let you in.

I would like to investigate into your account more. If you would like to connect on discord, Explosivo22#6721, or on email, Explosivo22@protonmail.com, maybe we could dig into what is going on exactly.

drac0linux commented 1 year ago

I'll see what I can do, I work until 5 pm pst.

On Thu, May 25, 2023, 5:42 AM explosivo22 @.***> wrote:

This has definitely peaked my interest as to what is going on. Turning off 2-step verification is new so I am working through steps to solve that issue, but I am curious as to why it won't let you in.

I would like to investigate into your account more. If you would like to connect on discord, Explosivo22#6721, or on email, @.***, maybe we could dig into what is going on exactly.

— Reply to this email directly, view it on GitHub https://github.com/explosivo22/kwikset-ha/issues/58#issuecomment-1562839826, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4LXF4IQRMKP3DNUROEUHTXH5HS5ANCNFSM6AAAAAAXXGVHWE . You are receiving this because you commented.Message ID: @.***>

explosivo22 commented 1 year ago

No worries. We can sync up sometime. I'm CST so I'm 2 hours ahead.

drac0linux commented 1 year ago

I'm unsure what changed! I had an update for Node-Red which required a reboot. After rebooting again, I tried configuring Kwikset and it worked for me. I've rebooted several times while trying to make this work, so I don't think that was the only problem. Whatever it was, it finally communicated with the Kwikset server, I got my verification code and it's working now.

Still perplexed, but happy to have it working. I appreciate your dedication to this!

explosivo22 commented 1 year ago

I'm glad to hear it is working now. I'm going to work through the 2-step verification changes they made and hopefully figure out why some tokens are expiring.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.