PaulAnnekov / tuyaha

Implements the special Tuya Home Assistant API.
Other
141 stars 106 forks source link

[SMART LIFE] + [HomeBridge] - Authentication error: Get accesstoken failed #50

Closed redtripleAAA closed 3 years ago

redtripleAAA commented 3 years ago

Issue: Authentication error: Get accesstoken failed

Specs:

I even tried to reset my password and added extra space in the country code as I live in Canada " 1"

Same issue

[11/3/2020, 10:33:09 AM] Homebridge v1.2.3 is running on port 51892. 2020-11-03T15:33:09.931Z alexaLocal connect command/ansred/# [11/3/2020, 10:33:10 AM] [TuyaWebPlatform] Authentication error: Get accesstoken failed. Username or password error! 2020-11-03T15:33:10.790Z hapNodeJSClient HAP Device discovered Homebridge 5FB5 EC7F 2020-11-03T15:33:10.791Z hapNodeJSClient HAP Device address Homebridge 5FB5 EC7F -> { host: '127.0.0.1', port: 51892, url: 'http://127.0.0.1:51892', deviceID: '0E:C9:C4:EB:5F:B5', txt: { 'c#': '3', ff: '0', id: '0E:C9:C4:EB:5F:B5', md: 'homebridge', pv: '1.1', 's#': '1', sf: '0', ci: '2', sh: 'fdtTZQ==' } }

Any advise?

Thanks

redtripleAAA commented 3 years ago

Found the issue

The bug that the API doesn't like the dots in the email in username

I also have an account on gmail. Usually when I use it it contains dots before @ i.e. xxx.yyy.zzz@gmail.com. You can create an account like that in the Tuya/Smart Life app but in the Home Assistant integration login with such email fails.

As gmail will deliver e-mails with or without dots to the same account I've created new account on Tuya app without dots like xxxyyyzzz@gmail.com. And I was able to successfully authenticate in Home Assistant Tuya integration.

Thanks! The issue is correctly with "dots" in email. Removing it works fine.