SecKatie / ha-wyzeapi

Home Assistant Integration for Wyze devices.
740 stars 112 forks source link

[Bug] Unable To Configure Integration #619

Closed ColtonYYZ closed 3 weeks ago

ColtonYYZ commented 3 weeks ago

Describe the bug The token access expired so I tried entering in a new key ID and API key but it kept failing with the message: "Unknown error occurred"

To Reproduce Steps to reproduce the behavior:

  1. Go to Settings
  2. Click on Add Integration
  3. Search for Wyze
  4. Enter in Email, Password, Keyid and Apikey
  5. Click Submit
  6. See Error

Expected behavior Accept the details and proceed with integration

System configuration System: HA Version: WyzeApi Version:

Home Assistant Core 2024.8.2 Supervisor 2024.08.0 Operating System Frontend 20240809.0 Wyze Integration 0.1.27

home-assistant.log

  File "/config/custom_components/wyzeapi/config_flow.py", line 61, in async_step_user
    await self.client.login(
  File "/usr/local/lib/python3.12/site-packages/wyzeapy/__init__.py", line 89, in login
    await self._auth_lib.get_token_with_username_password(
  File "/usr/local/lib/python3.12/site-packages/wyzeapy/wyze_auth_lib.py", line 144, in get_token_with_username_password
    raise AccessTokenError
wyzeapy.exceptions.AccessTokenError

I also see this (I can confirm I am entering in the correct userID and password because that's how I was able to generate a new api key):

This error originated from a custom integration.

Logger: wyzeapy.wyze_auth_lib
Source: custom_components/wyzeapi/config_flow.py:61
integration: Wyze Home Assistant Integration (documentation, issues)
First occurred: 8:50:54 PM (5 occurrences)
Last logged: 9:20:47 PM

Unable to login with response from Wyze: {'description': 'Invalid User Name or Password.', 'requestId': 'b8a43fcc-5cc4-44dd-8fc8-0c46e0d13394', 'errorCode': 1000}
Unable to login with response from Wyze: {'description': 'Invalid User Name or Password.', 'requestId': 'a60321a4-a246-4128-89e9-556c77b8ace9', 'errorCode': 1000}
Unable to login with response from Wyze: {'description': 'Invalid User Name or Password.', 'requestId': '227b3b2e-f0a4-4125-bfd2-fe70fda65e60', 'errorCode': 1000}
Unable to login with response from Wyze: {'description': 'Invalid User Name or Password.', 'requestId': '81be6442-df2c-40d5-904e-6c82c023059c', 'errorCode': 1000}
Unable to login with response from Wyze: {'description': 'Invalid User Name or Password.', 'requestId': '318fd6f9-6fff-4546-87b3-519c3f98a3c0', 'errorCode': 1000}

![Screenshot 2024-08-16 205840](https://github.com/user-attachments/assets/1c67333d-9c77-47cd-8739-840165cf8296)
ColtonYYZ commented 3 weeks ago

Closing case as I am now able to configure the integration