jfarmer08 / homebridge-wyze-smart-home

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

Request Failed: {"url":"api/user/login","status":400,"data":{"description":"Invalid User Name or Password." #241

Closed therzog92 closed 3 months ago

therzog92 commented 3 months ago

Describe Your Problem: I cannot seem to get past the login step. I'm using Homebridge on Synology. I keep receiving invalid user name or password results.

I used curl to see if it was actually an issue with my user/password and it looks like it's not. I was able to use Postman with this call successfully. When I use the curl command in Homebridge terminal I get the Invalid Username or Password. Downloaded hoobs on a raspberry pi and got the same issue with this plugin on there, however the curl command when ssh'd into hoobs worked.

curl --location 'https://auth-prod.api.wyze.com/api/user/login' \ --header 'Content-Type: application/json' \ --header 'apikey: myapikey' \ --header 'keyid: mykeyid' \ --data-raw '{"email":"myemail@myemail.com","password":"mypassword md5'd x3"}'

Logs:

[3/30/2024, 12:30:48 AM] [Wyze] Performing request: {"method":"POST","url":"api/user/login","data":{"email":"myemail@myemail.com","password":"mypassword"},"baseURL":"https://auth-prod.api.wyze.com","headers":{"x-api-key":"WMXHYf79Nr5gIlt3r0r7p9Tcw5bvs6BB4U8O8nGJ","apikey":"my api key","keyid":"my key id","User-Agent":"unofficial-wyze-api/1.1.7"}}

[3/30/2024, 12:30:49 AM] [Wyze] Request Failed: {"url":"api/user/login","status":400,"data":{"description":"Invalid User Name or Password.","requestId":"dbb7061f-2adc-484a-ae71-9c31f65eb57c","errorCode":1000},"headers":{"content-type":"application/json","transfer-encoding":"chunked","connection":"keep-alive","date":"Sat, 30 Mar 2024 05:30:49 GMT","x-ratelimit-remaining":"18","x-ratelimit-reset-by":"Sat Mar 30 05:38:48 GMT 2024","x-cache":"Error from cloudfront","via":"1.1 c68b898f33c21dc320564e472e8aaad2.cloudfront.net (CloudFront)","x-amz-cf-pop":"MCI50-P2","x-amz-cf-id":"SOJ28SexOlF0OLvnU4j1xaWKBzP4NdyHj6wFCVLe6NTb2Jl0SP0xyw=="}}

[3/30/2024, 12:30:49 AM] [Wyze] Error getting devices: AxiosError: Request failed with status code 400

Plugin Config:

{ "name": "Wyze", "username": "myemail@myemail.com", "password": "mypassword", "keyId": "my key id", "apiKey": "my api key", "refreshInterval": 60000, "hms": false, "showAdvancedOptions": false, "apiLogEnabled": true, "pluginLoggingEnabled": true, "lowBatteryPercentage": 30, "excludeMacAddress": false, "excludedeviceType": false, "platform": "WyzeSmartHome" }

Screenshots:

Environment:

github-actions[bot] commented 3 months ago

Message that will be displayed on users' first issue

jfarmer08 commented 3 months ago

Does your apikey or keyID have any special characters? There has been issues with this.

Thanks Allen :)

On Sat, Mar 30, 2024 at 1:07 AM github-actions[bot] < @.***> wrote:

Message that will be displayed on users' first issue

— Reply to this email directly, view it on GitHub https://github.com/jfarmer08/homebridge-wyze-smart-home/issues/241#issuecomment-2027934966, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKHFBYZOGA5UWXPJIWM35DY2ZJCZAVCNFSM6AAAAABFPJQXTCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXHEZTIOJWGY . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

therzog92 commented 3 months ago

Does your apikey or keyID have any special characters? There has been issues with this. Thanks Allen :)

Just the standard dashes in the Key ID. I've regenerated the key a few times and tries those as well but result in the same error.

When running the API call on my NAS I get the same error. When running on Hoobs (have two instances, running on Pi and Mac Mini) terminal it works. But for the plugin I get an error saying missing API Key and KeyID, they aren't options in the config. When I add them manually to the JSON config I get an error saying that the json file doesn't exist in the persist library.

ERRORError getting devices: Error: ENOENT: no such file or directory, open '/var/lib/hoobs/tommy/persist/wyze-2e9e1fb2-f815-56ec-8f8a-18ee3195b468.json'

therzog92 commented 3 months ago

Installed homebridge on Pi and was able to get it to work. Must be an issue with hoobs or the homebridge install on NAS.