jfarmer08 / homebridge-wyze-smart-home

Wyze Smart Home plugin for Homebridge.
MIT License
93 stars 14 forks source link

Axios and name and password #173

Closed kmg091 closed 8 months ago

kmg091 commented 9 months ago

Describe The Bug:

To Reproduce:

Expected behavior:

Logs: [10/6/2023, 7:30:46 AM] [Wyze] Request failed: AxiosError: Request failed with status code 400 [10/6/2023, 7:30:46 AM] [Wyze] Response PerformRequest (Bad Request): {"description":"Invalid User Name or Password.","requestId":"25578ad2-b10f-43d8-b75b-759be0729cec","errorCode":1000} [10/6/2023, 7:30:46 AM] [Wyze] Error getting devices: AxiosError: Request failed with status code 400

Show the Homebridge logs here, remove any sensitive information.

Plugin Config:

{
    "platform": "WyzeSmartHome",
    "name": "Wyze",
    "username": "#####@protonmail.com",
    "password": "#######",
    "keyId": "f#################-da36e4498bc0",
    "apiKey": "#######################SUQ055QyKrXXTu",
    "mfaCode": "801098",
    "filterDeviceTypeList": [
        "OutdoorPlug",
        "Plug"
    ],
    "filterByMacAddressList": [
        "MAC_ADDRESS_1",
        "MAC_ADDRESS_2"
    ]
}

Screenshots:

Environment:

github-actions[bot] commented 9 months ago

Message that will be displayed on users' first issue

kmg091 commented 9 months ago

I turned debug log on and the password its showing in the log is no where near what my password is?

Refreshing devices... [10/6/2023, 8:40:08 AM] [Wyze] Performing request: api/user/login [10/6/2023, 8:40:08 AM] [Wyze] Request config: {"method":"POST","url":"api/user/login","data":{"email":"redact@protonmail.com","password":"6bf4c181a508325c0d51c1ca077b9c0c"},"baseURL":"https://auth-prod.api.wyze.com","headers":{"apikey":"REDACTED","keyid":"REDACTED","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1 Safari/605.1.15"}}

kmg091 commented 9 months ago

SORRY DIDNT UNDERSTAND THE OPEN CLOSE BUTTON I WAS CLICKING

jfarmer08 commented 9 months ago

The password in the log is encoded from your password. Remove MFA from your config and restart.

kmg091 commented 9 months ago

I've tried both ways. After removing the 2fa I get the following error:

[10/6/2023, 8:47:08 PM] Homebridge v1.6.1 (HAP v0.11.1) (Homebridge 82C5) is running on port 51858. [10/6/2023, 8:47:09 PM] [Wyze] Request failed: AxiosError: Request failed with status code 400 [10/6/2023, 8:47:09 PM] [Wyze] Response PerformRequest (Bad Request): {"description":"Invalid User Name or Password.","requestId":"fffcc1bd-9f83-496e-90dd-208369e5bdb8","errorCode":1000} [10/6/2023, 8:47:09 PM] [Wyze] Error getting devices: AxiosError: Request failed with status code 400 [10/6/2023, 8:47:39 PM] [Wyze] Refreshing devices...

The password and username have been quadruple checked for accuracy. I directly copy and pasted each from my password manger to ensure as well ass the api key and key ID. Im not sure what might be happening.

is there a chance when 2fa was no longer used that due to the repeat login attempts wyze blocked me for too many "wrong password" attempts?

this is my current config file:

{ "name": "Wyze", "username": "REDACTED@protonmail.com", "password": "REDACTED", "keyId": "REDACTED----9728-932c6899a0e0", "apiKey": "REDACTED----MM8tLCz9i9X50PTDiaYbEGdN3W", "refreshInterval": 30000, "hms": false, "showAdvancedOptions": true, "apiLogEnabled": false, "logLevel": "debug", "excludeMacAddress": false, "excludedeviceType": true, "filterDeviceTypeList": [ "ContactSensor", "MotionSensor", "Lock", "LeakSensor", "Camera", "Common", "S1Gateway" ], "platform": "WyzeSmartHome" }

The password in the log is encoded from your password. Remove MFA from your config and restart.

jfarmer08 commented 9 months ago

Make sure the api_key that was generated does not contain characters that are 'special' to the Linux shell command - ex: '*', '|' (vertical bar/pipe symbol), or ';'.

kmg091 commented 9 months ago

I double checked this and removed any "-" that was in the red ID, for the API it was only letters and numbers in upper and lower case. It still thinks my user name and password is not correct, still not entirely sure. I figured id let it sit for 24hrs and make sure Im not getting blocked for some kind of DDos or security protection for number of incorrect attempts.

jfarmer08 commented 9 months ago

If you have any of the characters you need to regenerate your API keys.

kmg091 commented 9 months ago

So neither the API key or the Key ID can have any special characters, correct? Ill give that a try

Zfuzz commented 9 months ago

If you have any of the characters you need to regenerate your API keys.

I made about 10 Key IDs trying to get one that doesnt have a "-" symbol but ever key generated has this symbol

This is wha that key looks like: " c806ed1a-2615-4336-84bd-0c3a8760dc36" (this is an old key for example)

jfarmer08 commented 9 months ago

'-' is not part of it I don't think. ex: '*', '|' (vertical bar/pipe symbol), or ';'.

jfarmer08 commented 8 months ago

Any luck?