CodeFoodPixels / robovac

Add a Eufy RoboVac easily to Home Assistant
Other
141 stars 31 forks source link

Error when submitting working credentials during config #2

Closed CodeFoodPixels closed 1 year ago

CodeFoodPixels commented 1 year ago

Setting this up as a counterpart to https://github.com/bmccluskey/robovac/issues/14. Progress on a fix will be tracked here.

cc @hugalafutro @cdn4lf

KyleStilkey commented 1 year ago

Just wanted to say thanks for the fork and hope we see more issues resolved.

Sadly I'm in the same boat now with this one and just wanted to add my logs to this.

Logger: custom_components.robovac.tuyalocalapi Source: custom_components/robovac/tuyalocalapi.py:740 Integration: Eufy Robovac (documentation, issues) First occurred: 6:24:52 AM (31 occurrences) Last logged: 6:33:51 AM

Connection to 68868243f4cfa255d4e2 (192.168.1.200:6668) failed: [Errno 104] Connection reset by peer

CodeFoodPixels commented 1 year ago

That seems to be a separate issue, does your robovac have the right IP assigned in the config?

cdn4lf commented 1 year ago

@CodeFoodPixels happy to supply logs/help test. Let me know what you need.

CodeFoodPixels commented 1 year ago

I'm currently putting together a little script that steps through the Auth flow so we can see what fails where, I'll post a link when it's ready

On Wed, 9 Aug 2023, 12:59 cdn4lf, @.***> wrote:

@CodeFoodPixels https://github.com/CodeFoodPixels happy to supply logs/help test. Let me know what you need.

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/robovac/issues/2#issuecomment-1671192911, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVENUN4277KTQFMZ2U3XUN3TLANCNFSM6AAAAAA3JVRYVA . You are receiving this because you were mentioned.Message ID: @.***>

CodeFoodPixels commented 1 year ago

Right, if folks could run this and copy-paste the output for me please: https://replit.com/@CodeFoodPixels/robovac-auth-test

cdn4lf commented 1 year ago

 python3 main.py ** Robovac Auth Tester ** Anker/Eufy Username: MYLOGIN@gmail.com Password: Logging in to Eufy Success Getting Eufy device info Success Getting TUYA session Requesting token TUYA username: REDACTEDUSERNAMECODE TUYA country code: Success Traceback (most recent call last): File "/home/runner/HLfFomWTgeR/main.py", line 83, in get_eufy_vacuums({"username": username, "password": password}) File "/home/runner/HLfFomWTgeR/main.py", line 71, in get_eufy_vacuums for home in tuya_client.list_homes(): File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 227, in list_homes return self._request(action="tuya.m.location.list", version="2.1") File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 144, in _request self.acquire_session() File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 221, in acquire_session session_response = self.request_session( File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 213, in request_session session_response = self._request( File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 171, in _request raise Exception( Exception: No 'result' key in the response - the entire response is {'t': 1691594560155, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}. exit status 1  ^C 

hugalafutro commented 1 year ago

At work atm, but

Exception: No 'result' key in the response - the entire response is {'t': SOMENUMBER, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}.

is exactly the error message I was getting too when trying to log in with the original integration.

CodeFoodPixels commented 1 year ago

I've just found this question/answer on the Tuya docs which suggests that the password for some users might not be MD5 hashed. I've removed the MD5 hashing from the link above, could you try again?

cdn4lf commented 1 year ago

Traceback (most recent call last): File "/home/runner/HLfFomWTgeR/main.py", line 83, in get_eufy_vacuums({"username": username, "password": password}) File "/home/runner/HLfFomWTgeR/main.py", line 71, in get_eufy_vacuums for home in tuya_client.list_homes(): File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 225, in list_homes return self._request(action="tuya.m.location.list", version="2.1") File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 139, in _request self.acquire_session() File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 218, in acquire_session session_response = self.request_session(self.username, self.country_code) File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 199, in request_session plaintext=password.encode("utf-8"), AttributeError: 'bytes' object has no attribute 'encode'. Did you mean: 'decode'? exit status 1 

CodeFoodPixels commented 1 year ago

Sorry, that's a bug. Could you try again?

cdn4lf commented 1 year ago

Logging in to Eufy t9147_sdk_flag: 0 Success Getting Eufy device info Success Getting TUYA session Requesting token TUYA username: RedactedUserName TUYA country code: EU Success Traceback (most recent call last): File "/home/runner/HLfFomWTgeR/main.py", line 84, in get_eufy_vacuums({"username": username, "password": password}) File "/home/runner/HLfFomWTgeR/main.py", line 72, in get_eufy_vacuums for home in tuya_client.list_homes(): File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 225, in list_homes return self._request(action="tuya.m.location.list", version="2.1") File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 139, in _request self.acquire_session() File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 218, in acquire_session session_response = self.request_session(self.username, self.country_code) File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 210, in request_session session_response = self._request( File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 166, in _request raise Exception( Exception: No 'result' key in the response - the entire response is {'t': 1691603720815, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}. exit status 1 

KyleStilkey commented 1 year ago

Logging in to Eufy

Traceback (most recent call last): File "/home/runner/oNln28qlz5X/main.py", li

ne 84, in get_eufy_vacuums ({"username": username,

password": password}) File "/home/runner/oNln28qlz5X/main.py", li ne 38, in get_eufy_vacuums

raise InvalidAuth _main__.InvalidAuth

exit status 1

This is what I get from your test page.

hugalafutro commented 1 year ago

Just came home from work, the output of the replit page after I try to log in:

Logging in to Eufy
    t9147_sdk_flag: 0
    Success
Getting Eufy device info
    Success
Getting TUYA session
    Requesting token
        TUYA country code: 44
        Success
Traceback (most recent call last):
  File "/home/runner/5r5zbSF_CpZ/main.py", line 84, in <module>
    get_eufy_vacuums({"username": username, "password": password})
  File "/home/runner/5r5zbSF_CpZ/main.py", line 72, in get_eufy_vacuums
    for home in tuya_client.list_homes():
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 224, in list_homes
    return self._request(action="tuya.m.location.list", version="2.1")
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 139, in _request
    self.acquire_session()
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 217, in acquire_session
    session_response = self.request_session(self.username, self.country_code)
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 209, in request_session
    session_response = self._request(
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 166, in _request
    raise Exception(
Exception: No 'result' key in the response - the entire response is {'t': 1691617086475, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}.

the credentials are 100% correct as I used copy+paste and they're the same ones I use to log in to the eufy home app on phone

CodeFoodPixels commented 1 year ago

Logging in to Eufy

Traceback (most recent call last): File "/home/runner/oNln28qlz5X/main.py", li

ne 84, in get_eufy_vacuums ({"username": username,

password": password}) File "/home/runner/oNln28qlz5X/main.py", li ne 38, in get_eufy_vacuums

raise InvalidAuth _main__.InvalidAuth

exit status 1

This is what I get from your test page.

This looks like your Eufy credentials were wrong

KyleStilkey commented 1 year ago

Logging in to Eufy Traceback (most recent call last): File "/home/runner/oNln28qlz5X/main.py", li ne 84, in get_eufy_vacuums ({"username": username, password": password}) File "/home/runner/oNln28qlz5X/main.py", li ne 38, in get_eufy_vacuums raise InvalidAuth _main__.InvalidAuth exit status 1 This is what I get from your test page.

This looks like your Eufy credentials were wrong

They are not, they are 100% correct and I verified 5 times to make sure, but I tested today again, 0 issues with your test, it all comes back fine for me and a complete success.

I've not touched the integration since yesterday where it wasn't working and setting the IP for the device was just sitting at as an error still. I just stopped to wait to figure it out here to just now I'm looking at my Custom Vacuum card I had set up sitting at Docked. I went and checked and sure enough it's now working and I can control it once again. So I am very confused why now it's working, possibly is it because I bumped it off the dock this morning and the status changed and so it saw this change, is it possible that since I updated my routers firmwares and reset the network that it's now working? I'm not sure, but it's at least for now is working.

I also have the vacuum set as a static IP so the device will always be said IP. Again I am not sure what changed but wanted to list what has happened.

hugalafutro commented 1 year ago

still not working here, but getting additional output from the replit page: after the TUYA country code: 44 line:

{'exponent': '3', 'pbKey': 'long ass string', 'publicKey': 'another long ass string', 'token': 'slightly shorter ass string'}
        Success

and then there is the same error, but in the error I noticed it says:

Traceback (most recent call last):
  File "/home/runner/rgxwiJFsB8p/main.py", line 84, in <module>
    get_eufy_vacuums({"username": username, "password": password})

which to me looks like it tries to login with literal credentials username / password Then again I know nothing about how any of this works.

I was thinking, couldn't you just bin the whole logging into tuya doohickey and just change the config flow so it asks for ip token and id instead of trying to use some external script to pull it off tuya api? I'd wager most of the folks with this issue have the id/token of the vacuum anyway.

There's a guy in the original issue who said:

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.

but I have no idea what any of that means

CodeFoodPixels commented 1 year ago

Could you give the replit another try please? I've done some updates

which to me looks like it tries to login with literal credentials username / password Then again I know nothing about how any of this works.

Nah, that's an object that passes on the username and password that you put in

I was thinking, couldn't you just bin the whole logging into tuya doohickey and just change the config flow so it asks for ip token and id instead of trying to use some external script to pull it off tuya api? I'd wager most of the folks with this issue have the id/token of the vacuum anyway.

I'm reluctant to bin it off because that adds friction for people trying to install it. I didn't have the ID/token and probably wouldn't have bothered setting it up on HA if I had to go through all those steps. I'll have a look at adding the option to manually add it though.

hugalafutro commented 1 year ago
Logging in to Eufy
Traceback (most recent call last):
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 536, in _make_request
    response = conn.getresponse()
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/connection.py", line 461, in getresponse
    httplib_response = super().getresponse()
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/http/client.py", line 1374, in getresponse
    response.begin()
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/http/client.py", line 318, in begin
    version, status, reason = self._read_status()
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/http/client.py", line 279, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/socket.py", line 705, in readinto
    return self._sock.recv_into(b)
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/ssl.py", line 1274, in recv_into
    return self.read(nbytes, buffer)
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/ssl.py", line 1130, in read
    return self._sslobj.read(len, buffer)
TimeoutError: The read operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 844, in urlopen
    retries = retries.increment(
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 470, in increment
    raise reraise(type(error), error, _stacktrace)
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/util/util.py", line 39, in reraise
    raise value
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 790, in urlopen
    response = self._make_request(
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 538, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 370, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='home-api.eufylife.com', port=443): Read timed out. (read timeout=1.5)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/5r5zbSF_CpZ/main.py", line 94, in <module>
    get_eufy_vacuums({"username": username, "password": password})
  File "/home/runner/5r5zbSF_CpZ/main.py", line 33, in get_eufy_vacuums
    response = eufy_session.get_user_info()
  File "/home/runner/5r5zbSF_CpZ/eufywebapi.py", line 33, in get_user_info
    return requests.post(
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/home/runner/5r5zbSF_CpZ/venv/lib/python3.10/site-packages/requests/adapters.py", line 532, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='home-api.eufylife.com', port=443): Read timed out. (read timeout=1.5)
exit status 1

I'll have a look at adding the option to manually add it though.

That would be awesome, thanks for considering. I agree removing the online login would make it harder for new folks should have phrased it better.

CodeFoodPixels commented 1 year ago

Can you give it another try? It seems to have fallen over trying to reach the Eufy API, maybe they had a blip or something.

hugalafutro commented 1 year ago

@CodeFoodPixels still the same output, I tried accessing https://home-api.eufylife.com from my computer and that loads with Method Not Allowed error message so I assume the page is working.

CodeFoodPixels commented 1 year ago

Are you able to run python scripts locally? If so, could you clone this repo: https://github.com/CodeFoodPixels/robovac-auth-test/

Needs python 3 to run.

To install dependencies: pip install -r requirements.txt

Then to run: python main.py

hugalafutro commented 1 year ago

@CodeFoodPixels

Logging in to Eufy
    Success
Getting Eufy device info
    Success
Starting Tuya calls
    Base URL: https://a1.tuyaeu.com
    Timezone: Europe/London
    Country code: 44
    Region code: EU
Getting TUYA session
    Requesting token
        Success
Traceback (most recent call last):
  File "/home/pi/robovac-auth-test/main.py", line 94, in <module>
    get_eufy_vacuums({"username": username, "password": password})
  File "/home/pi/robovac-auth-test/main.py", line 82, in get_eufy_vacuums
    for home in tuya_client.list_homes():
  File "/home/pi/robovac-auth-test/tuyawebapi.py", line 230, in list_homes
    return self._request(action="tuya.m.location.list", version="2.1")
  File "/home/pi/robovac-auth-test/tuyawebapi.py", line 149, in _request
    self.acquire_session()
  File "/home/pi/robovac-auth-test/tuyawebapi.py", line 224, in acquire_session
    session_response = self.request_session(self.username, self.country_code)
  File "/home/pi/robovac-auth-test/tuyawebapi.py", line 216, in request_session
    session_response = self._request(
  File "/home/pi/robovac-auth-test/tuyawebapi.py", line 176, in _request
    raise Exception(
Exception: No 'result' key in the response - the entire response is {'t': 1691750053372, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}.
CodeFoodPixels commented 1 year ago

I've pushed up a change to the auth-test repo that dumps out some redacted API responses, could you pull those changes down, run it and post the output here please?

hugalafutro commented 1 year ago

@CodeFoodPixels either their servers are dying or rate limiting these requests, but now I'm getting the timeout even from my home network:

requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='home-api.eufylife.com', port=443): Read timed out. (read timeout=1.5)

pi@pi-docker:~/robovac-auth-test $ ping home-api.eufylife.com
PING eufy-1025049978.us-west-2.elb.amazonaws.com (35.160.202.129) 56(84) bytes of data.
^C
--- eufy-1025049978.us-west-2.elb.amazonaws.com ping statistics ---
64 packets transmitted, 0 received, 100% packet loss, time 64499ms
CodeFoodPixels commented 1 year ago

Do you still get the error on the replit?

hugalafutro commented 1 year ago

@CodeFoodPixels works on replit now, more output too:

Logging in to Eufy
    Success
Getting Eufy device info
    Success
user response
{
    "id": "REDACTED",
    "nick_name": "REDACTED",
    "email": "REDACTED",
    "mobile": "REDACTED",
    "phone_code": "44",
    "country": "UK",
    "timezone": "Europe/London",
    "avatar": "",
    "unit_height": "",
    "registered_region": "US",
    "request_host": "https://api.eufylife.com",
    "t9147_sdk_flag": 0,
    "language": "en"
}
settings response
{
    "user_id": "REDACTED",
    "habit": {
        "temperature_unit": "\u00b0F",
        "distance_unit": "miles",
        "weight_unit": "lbs",
        "height_unit": "ft",
        "blood_pressure_unit": "mmHg",
        "allow_report_at": 0,
        "calorie_setting": {
            "calorie_unit": "",
            "liquid_unit": "",
            "weight_unit": ""
        },
        "body_model_setting": {
            "height_unit": ""
        },
        "push_message_setting": null,
        "appliance": 0
    },
    "home_setting": {
        "electric_price": {
            "currency": "",
            "currency_symbol": "",
            "price": 0
        },
        "tuya_home": {
            "tuya_home_id": "REDACTED",
            "tuya_region_code": "EU",
            "region_code": "",
            "tuya_uid": ""
        }
    },
    "locale": {
        "timezone": "Europe/London",
        "language": "en"
    },
    "un_subscribe_flag": false
}
Starting Tuya calls
    Base URL: https://a1.tuyaeu.com
    Timezone: Europe/London
    Country code: 44
    Region code: EU
Getting TUYA session
    Requesting token
        Success
Traceback (most recent call last):
  File "/home/runner/5r5zbSF_CpZ/main.py", line 111, in <module>
    get_eufy_vacuums({"username": username, "password": password})
  File "/home/runner/5r5zbSF_CpZ/main.py", line 99, in get_eufy_vacuums
    for home in tuya_client.list_homes():
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 230, in list_homes
    return self._request(action="tuya.m.location.list", version="2.1")
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 149, in _request
    self.acquire_session()
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 224, in acquire_session
    session_response = self.request_session(self.username, self.country_code)
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 216, in request_session
    session_response = self._request(
  File "/home/runner/5r5zbSF_CpZ/tuyawebapi.py", line 176, in _request
    raise Exception(
Exception: No 'result' key in the response - the entire response is {'t': 1691753318099, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}.
exit status 1
cdn4lf commented 1 year ago

Logging in to Eufy Success Getting Eufy device info Success user response { "id": "REDACTED", "nick_name": "REDACTED", "email": "REDACTED", "mobile": "REDACTED", "phone_code": "", "country": "CA", "timezone": "America/Toronto", "avatar": "0", "unit_height": "ft", "registered_region": "US", "request_host": "https://api.eufylife.com", "t9147_sdk_flag": 0, "language": "en" } settings response { "user_id": "REDACTED", "habit": { "temperature_unit": "\u00b0F", "distance_unit": "miles", "weight_unit": "lbs", "height_unit": "ft", "blood_pressure_unit": "mmHg", "allow_report_at": 1689287935, "calorie_setting": { "calorie_unit": "", "liquid_unit": "", "weight_unit": "" }, "body_model_setting": { "height_unit": "" }, "push_message_setting": { "topic": false, "activity": false }, "appliance": 0 }, "home_setting": { "electric_price": { "currency": "", "currency_symbol": "$", "price": 0 }, "tuya_home": { "tuya_home_id": "REDACTED", "tuya_region_code": "AZ", "region_code": "", "tuya_uid": "" } }, "locale": { "timezone": "America/Toronto", "language": "en" }, "un_subscribe_flag": false } Starting Tuya calls Base URL: https://a1.tuyaus.com Timezone: America/Toronto Country code: 1 Region code: AZ Getting TUYA session Requesting token Success Traceback (most recent call last): File "/home/runner/HLfFomWTgeR/main.py", line 111, in get_eufy_vacuums({"username": username, "password": password}) File "/home/runner/HLfFomWTgeR/main.py", line 99, in get_eufy_vacuums for home in tuya_client.list_homes(): File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 230, in list_homes return self._request(action="tuya.m.location.list", version="2.1") File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 149, in _request self.acquire_session() File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 224, in acquire_session session_response = self.request_session(self.username, self.country_code) File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 216, in request_session session_response = self._request( File "/home/runner/HLfFomWTgeR/tuyawebapi.py", line 176, in _request raise Exception( Exception: No 'result' key in the response - the entire response is {'t': 1691754280966, 'success': False, 'errorCode': 'USER_PASSWD_WRONG', 'status': 'error', 'errorMsg': 'Incorrect account ID or password'}. exit status 1 

CodeFoodPixels commented 1 year ago

@hugalafutro @cdn4lf Are you both able to log in using the 2.3.2 version of the app to get your local key? I'm not able to, so I wonder if that's a difference

cdn4lf commented 1 year ago

@CodeFoodPixels, I've already got my local key. I assume that's from using the older version of the app.

hugalafutro commented 1 year ago

I got the key for it already as well, got it from an "hacked" EufyHome_2.4.0_vevs.apk (link on my nextcloud) which writes logs to storage where you can find the token. Afterwards updated the app and currently it is 2.24.1

I have previously also used i_forogt_the_name_vevs.apk to obtain encryption keys for some xiaomi ble thermometers etc.. which is why was comfortable using it.

CodeFoodPixels commented 1 year ago

So having a look at the decompiled code of the 2.3.2 version of the app, it has a fallback password if it fails to encrypt what should be your actual password, I've put this into the replit if folks could try it please?

hugalafutro commented 1 year ago

Looks like progress to me!

Logging in to Eufy
    Success
Getting Eufy device info
    Success
Starting Tuya calls
    Base URL: https://a1.tuyaeu.com
    Timezone: Europe/London
    Country code: 44
    Region code: EU
Getting TUYA session
    Requesting token
        Success
    Requesting token
        Success
Traceback (most recent call last):
  File "/home/runner/UVg9Jci0b82/main.py", line 96, in <module>
    get_eufy_vacuums({"username": username, "password": password})
  File "/home/runner/UVg9Jci0b82/main.py", line 83, in get_eufy_vacuums
    for home in tuya_client.list_homes():
  File "/home/runner/UVg9Jci0b82/tuyawebapi.py", line 248, in list_homes
    return self._request(action="tuya.m.location.list", version="2.1")
  File "/home/runner/UVg9Jci0b82/tuyawebapi.py", line 149, in _request
    self.acquire_session()
  File "/home/runner/UVg9Jci0b82/tuyawebapi.py", line 239, in acquire_session
    self.session_id = self.default_query_params["sid"] = session_response["sid"]
TypeError: 'NoneType' object is not subscriptable
CodeFoodPixels commented 1 year ago

Ooh, so that's successfully logged you in to Tuya!

I just need to investigate that new error

CodeFoodPixels commented 1 year ago

The error was caused by me not returning the session that uses the fallback password 🤦‍♂️

Replit should be updated

hugalafutro commented 1 year ago
Logging in to Eufy
    Success
Getting Eufy device info
    Success
Starting Tuya calls
    Base URL: https://a1.tuyaeu.com
    Timezone: Europe/London
    Country code: 44
    Region code: EU
Getting TUYA session
    Requesting token
        Success
    Requesting token
        Success
    Base URL: https://a1.tuyaeu.com
    Country code: 44
    Success
Test script ran successfully
cdn4lf commented 1 year ago

confirmed :P

Logging in to Eufy
    Success
Getting Eufy device info
    Success
Starting Tuya calls
    Base URL: https://a1.tuyaus.com
    Timezone: America/Toronto
    Country code: 1
    Region code: AZ
Getting TUYA session
    Requesting token
        Success
    Requesting token
        Success
    Base URL: https://a1.tuyaus.com
    Country code: 1
    Success
Test script ran successfully
 
CodeFoodPixels commented 1 year ago

This fix has now been pushed up to the home assistant plugin

cdn4lf commented 1 year ago

@CodeFoodPixels I just hit redownload in HACS and I'm still not able to log in. Any ideas?

CodeFoodPixels commented 1 year ago

It's not in a release yet, so make sure you've downloaded main, not 1.0.0

On Mon, 14 Aug 2023, 18:30 cdn4lf, @.***> wrote:

@CodeFoodPixels https://github.com/CodeFoodPixels I just hit redownload in HACS and I'm still not able to log in. Any ideas?

— Reply to this email directly, view it on GitHub https://github.com/CodeFoodPixels/robovac/issues/2#issuecomment-1677771924, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEPFVHBFM5YDXXG2GXPHQDXVJOBPANCNFSM6AAAAAA3JVRYVA . You are receiving this because you were mentioned.Message ID: @.***>

cdn4lf commented 1 year ago

@CodeFoodPixels whoops. Pulled main, everything works. Thank you!

KyleStilkey commented 1 year ago

Running your test code works fine but this is an issue I am now getting after pulling down the latest changes made, wondering if it's related to this or if something else is getting this caught up.

Update for vacuum.robovac_15c_max fails Traceback (most recent call last): File "/config/custom_components/robovac/tuyalocalapi.py", line 679, in async_connect sock.connect((self.host, self.port)) TimeoutError: timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 699, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 938, in async_device_update await self.async_update() File "/config/custom_components/robovac/vacuum.py", line 267, in async_update await self.vacuum.async_get() File "/config/custom_components/robovac/tuyalocalapi.py", line 699, in async_get return await message.async_send(self, callback) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/robovac/tuyalocalapi.py", line 529, in async_send await device._async_send(self) File "/config/custom_components/robovac/tuyalocalapi.py", line 762, in _async_send await self.async_connect() File "/config/custom_components/robovac/tuyalocalapi.py", line 681, in async_connect raise ConnectionTimeoutException("Connection timed out") from e custom_components.robovac.tuyalocalapi.ConnectionTimeoutException: Connection timed out

I'm going to guess just from trying to read this it might be timing out and failing to connect to the device?

Just posting this here in case something is messed up, but I will try resetting the device tonight as well see if anything changes but networks has already been reset and confirmed the IP is correctly set for the vacuum.

UPDATE: Got my wife to reset the Vaccum and it showed up fine in Home Assistant. Seems OK now but I'll keep tracking it but as of now it looks good.

CodeFoodPixels commented 1 year ago

Closing this as it's now available in main

CodeFoodPixels commented 1 year ago

Reopening this because it's not in a main release yet.

It's in a beta release now though: https://github.com/CodeFoodPixels/robovac/releases/tag/v1.1.0.beta.1

KyleStilkey commented 1 year ago

Reopening this because it's not in a main release yet.

It's in a beta release now though: https://github.com/CodeFoodPixels/robovac/releases/tag/v1.1.0.beta.1

I have updated to this version and so far it's working fine for me, auto discovery worked as well. Appreciate the hard work.

CodeFoodPixels commented 1 year ago

This is now in v1.1.0!