Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected error when sumitting working credentials #14

Open
inijman opened this issue Jan 8, 2023 · 2 comments
Open

unexpected error when sumitting working credentials #14

inijman opened this issue Jan 8, 2023 · 2 comments

Comments

@inijman
Copy link

inijman commented Jan 8, 2023

I'm getting an unexpected error when I try to add this integration at the step of supplying the credentials. These definitely are correct: I can login to the web/app, and even running the curl statement gets me a response with a token.

It seems to break in the tuyawebapi session request where I get an 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'} returned.

Any suggestions why the first script does accept the password, but the second does not?

edit: went through the sniffing process with bluestacks and was able to get to the localkey etc. I've been able to use a basic integration and it works.

However, how to install this repo as working integration bypassing the 'auto configuring' tuya to get the most out f my G30?

@mattinx
Copy link

mattinx commented Mar 17, 2023

I'm getting the same issue (unexpected error after supplying valid credentials).

I did some more poking at the code it's able to login to the Eufy API server and fetch a list of devices, but fails when attempting to login to Tuya's API to get a list of homes (to fetch the local access tokens). It's able to call TuyaAPISession.determine_password(), and TuyaAPISession.request_token(), and both of which return content. However, the request itself returns:
{'t': 1678997709669, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}

I'm wondering if possibly if it's possibly hitting the wrong Tuya endpoint, or possibly something's changed with the credentials being sent to Tuya.

I do have the local key for my devices - I jumped through the process with the old version of the app last year, so being able to scan the devices from the API, then provide the local key manually would be a work-around

I did a quick hack to config_flow.py to remove the Tuya localkey lookup, and added CONF_ACCESS_TOKEN to the config dialog when you set up a vacuum - and that seems to have worked. If I get some free time to hack on things a bit, I'll look into updating the config flow so it fetches the keys from Tuya if it can, and lets you add them at device setup time if it can't. That requires learning how to write Data Entry Flows first, so if someone else wants to do that - don't wait for me :)

@hugalafutro
Copy link

I did a quick hack to config_flow.py to remove the Tuya localkey lookup, and added CONF_ACCESS_TOKEN to the config dialog when you set up a vacuum - and that seems to have worked.

@mattinx could you elaborate a bit on this? I have the token, id, key and ip of the vacuum, could you outline more in detail how you used them to bypass the login? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants