MTrab / landroid_cloud

Landroid Cloud component for Home Assistant
GNU General Public License v3.0
266 stars 33 forks source link

Unable to load my landroid #282

Closed thennart closed 1 year ago

thennart commented 1 year ago

Once I add my credentials, integration switch to ERROR.

This is the log message :

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 226, in _call
    req.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.worxlandroid.com/api/v2/users/certificate

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/landroid_cloud/__init__.py", line 64, in async_setup_entry
    result = await _async_setup(hass, entry)
  File "/config/custom_components/landroid_cloud/__init__.py", line 208, in _async_setup
    await hass.async_add_executor_job(cloud.connect, False, False)
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/__init__.py", line 269, in connect
    with self._get_cert() as cert:
  File "/usr/local/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/__init__.py", line 324, in _get_cert
    certresp = self._api.get_cert()
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 135, in get_cert
    calldata = self._call("/users/certificate")
  File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 236, in _call
    raise NotFoundError()
MTrab commented 1 year ago

Please supply ALL information from the issue template!

HA version, HAOS version, integration version and so on.

thennart commented 1 year ago

Hello,

All up to date

Home Assistant 2022.10.5 Supervisor 2022.10.0 Operating System 9.3 landroid_cloud 2.3.4

Landroid M700 Plus v3.28

MTrab commented 1 year ago

Hmm - API endpoint is still good and I cannot reproduce this error. Sure you have provided correct credentials? Does your password contain some of the problematic chars like *, $ or the like?

thennart commented 1 year ago

Yes, I have a @ in my password

thennart commented 1 year ago

I just tried to update my password without any special character but I have the same issue

MTrab commented 1 year ago

That's strange. Will do some testing on HAOS later today (was testing in my dev environment which is the only thing I have access to from my current location)

snookerap commented 1 year ago

Hello, i have the same problem and i use the same version of HA. I have a simple password.

My Landroid is:

Landroid M500 Plus v3.28

`Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 226, in _call req.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.worxlandroid.com/api/v2/users/certificate

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/landroid_cloud/init.py", line 64, in async_setup_entry result = await _async_setup(hass, entry) File "/config/custom_components/landroid_cloud/init.py", line 208, in _async_setup await hass.async_add_executor_job(cloud.connect, False, False) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 269, in connect with self._get_cert() as cert: File "/usr/local/lib/python3.10/contextlib.py", line 135, in enter return next(self.gen) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 324, in _get_cert certresp = self._api.get_cert() File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 135, in get_cert calldata = self._call("/users/certificate") File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 236, in _call raise NotFoundError() pyworxcloud.exceptions.NotFoundError`

thennart commented 1 year ago

If you have the exact url + method + payload + http headers I can try with curl command with my credentials

MTrab commented 1 year ago

I think it's an error with the Plus model. It might use another implementation. Perhaps this will be solved during winter when I do a complete rewrite of landroid_cloud (again) for comply with the API specifications from Positec.

Without credentials for a Plus model I can't make any workaround for now.

snookerap commented 1 year ago

Hello, I would like to make my account available to you. which email address should I send it to?

MTrab commented 1 year ago

Please send username and password to github_2022(at)trab.dk

thennart commented 1 year ago

Hello

Is there any news about this issue ?

Thank you !

MTrab commented 1 year ago

No - nothing at all

MTrab commented 1 year ago

Further investigation reveals that my suspicion is true. This module is, for now NOT compliant with Plus models. This will require the complere rewrite I have planned, to be fully in line with the Positech API and not the "hacky" way we have done it so far. There is NO ETA on this fix - this is a fairly large task to rewrite the module.

MTrab commented 1 year ago

Seems like this issue will be fixed in the upcoming version 3 - NO ETA yet thou.

FrancoisDF commented 1 year ago

Hi, I have the same error but I own a M500 (WR141E). Is it possible the issue in not only on the Plus series?

requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.worxlandroid.com/api/v2/users/certificate

Home Assistant 2023.1.7 Supervisor 2023.01.1 Operating System 9.5 landroid_cloud 2.3.4

Landroid M500 v3.28

MTrab commented 1 year ago

V3 is still in development - haven't had much sparetime lately and have used ALOT of time in boosting functionality in one of my other integrations. Hope to make progress on this on very soon thou.

Salrok commented 1 year ago

Good Day Everyone, today i encountered the same error with my M500, which worked for over an year now. No changes where made except, i updated the HACS integration of Oilfox today, after the reboot of HA, i saw the error:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant.config_entries Source: custom_components/landroid_cloud/init.py:208 Integration: Landroid Cloud (documentation, issues) First occurred: 09:02:56 (1 occurrences) Last logged: 09:02:56

Error setting up entry Worx - xyx@yxy.cc for landroid_cloud Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 226, in _call req.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions. HTTPError: 404 Client Error: Not Found for url: https://api.worxlandroid.com/api/v2/users/certificate

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/landroid_cloud/init.py", line 64, in async_setup_entry result = await _async_setup(hass, entry) File "/config/custom_components/landroid_cloud/init.py", line 208, in _async_setup await hass.async_add_executor_job(cloud.connect, False, False) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 269, in connect with self._get_cert() as cert: File "/usr/local/lib/python3.10/contextlib.py", line 135, in enter return next(self.gen) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 324, in _get_cert certresp = self._api.get_cert() File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 135, in get_cert calldata = self._call("/users/certificate") File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 236, in _call raise NotFoundError() pyworxcloud.exceptions.NotFoundError

Thanks for your work on this integration MTrab!

greetings Salrok

gluca commented 1 year ago

Good Day Everyone, today i encountered the same error with my M500, which worked for over an year now. No changes where made except, i updated the HACS integration of Oilfox today, after the reboot of HA, i saw the error:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht Logger: homeassistant.config_entries Source: custom_components/landroid_cloud/init.py:208 Integration: Landroid Cloud (documentation, issues) First occurred: 09:02:56 (1 occurrences) Last logged: 09:02:56 Error setting up entry Worx - xyx@yxy.cc for landroid_cloud Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 226, in _call req.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions. HTTPError: 404 Client Error: Not Found for url: https://api.worxlandroid.com/api/v2/users/certificate During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/landroid_cloud/init.py", line 64, in async_setup_entry result = await _async_setup(hass, entry) File "/config/custom_components/landroid_cloud/init.py", line 208, in _async_setup await hass.async_add_executor_job(cloud.connect, False, False) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, self.kwargs) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 269, in connect with self._get_cert() as cert: File "/usr/local/lib/python3.10/contextlib.py", line 135, in enter return next(self.gen) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init**.py", line 324, in _get_cert certresp = self._api.get_cert() File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 135, in get_cert calldata = self._call("/users/certificate") File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 236, in _call raise NotFoundError() pyworxcloud.exceptions.NotFoundError

Thanks for your work on this integration MTrab!

greetings Salrok

Same per me. i've upgraded to HA 2023.2.5

MTrab commented 1 year ago

As mentioned earlier - this has nothing with the HA version to do. All users are hit by this error

copadewe commented 1 year ago

As mentioned earlier - this has nothing with the HA version to do. All users are hit by this error

Have the same problem, so the addon is currently "offline". ok. Oliver

MTrab commented 1 year ago

As mentioned on the frontpage of this repo, the integration is currently broken. I have simply not had the time to look into this much, due to job and a major overhaul of one of my other integrations. I hope (nothing promised) to find time to do work on this during the current or next week. But again, no promises.

copadewe commented 1 year ago

As mentioned on the frontpage of this repo, the integration is currently broken. I have simply not had the time to look into this much, due to job and a major overhaul of one of my other integrations. I hope (nothing promised) to find time to do work on this during the current or next week. But again, no promises.

Thank you MTrab! for this addon and for your support. I did not read it because was linked direct to the issues. My fault. viele Grüße Oliver

brainupstudio commented 1 year ago

Hi, is there any news about updating this integration? Thanks and good job

roofburner commented 1 year ago

Started using my mower yesterday, combined with the Landroid app... Seems like Worx changed the way they update information. When the mower is home for charging, battery status doesn't get updated until full. I.e. charge level goes from 9% -> 100%, without any intermediate value. I think I saw the same behaviour at the end of last year in my Landroid Home Assistant integration.

MTrab commented 1 year ago

A loose guess on the progress - about 90% release ready. Had alot of bumps to smooth, but the latest few days I have made huge progress.

I'll not give an ETA thou, as I have a pretty busy life going on right now, so development is only a few hours a week.

shawwellpete commented 1 year ago

A loose guess on the progress - about 90% release ready.

Had alot of bumps to smooth, but the latest few days I have made huge progress.

I'll not give an ETA thou, as I have a pretty busy life going on right now, so development is only a few hours a week.

Thank you for letting us know and for working on this!

Cosmicbase commented 1 year ago

Here my data Home Assistant 2023.3.5 Supervisor 2023.03.1 OS 9.5 Front end 20230309.1 - latest

Worx Landroid WR141 V3.29

I also tried to update my password without any special character but I have the same issue.

MTrab commented 1 year ago

As mentioned a few times in this thread - EVERYONE has this error

PeteRepeat77 commented 1 year ago

This is great to hear that you've had some good progress in this. Appreciate your efforts and look forward to the integration working again... Whenever that may be.

angr72 commented 1 year ago

A loose guess on the progress - about 90% release ready. Had alot of bumps to smooth, but the latest few days I have made huge progress.

I'll not give an ETA thou, as I have a pretty busy life going on right now, so development is only a few hours a week.

Thanks for the effort!

MTrab commented 1 year ago

Small update - would estimate a release is 99% done. Please be aware that when the release is coming not everything may work as expected, as I do not use all functions myself.

ljmerza commented 1 year ago

Is there any way after this you can help give some steps to be able to debug the apk for people to help out? I unpacked the apk and changed some of the ssl settings from some instructions I've found online but I couldn't get it working so I can sniff ssl packets to debug the app and help out.

MTrab commented 1 year ago

Thanks, but not necessary, as I have gained full access to the API documentation from Positec

roofburner commented 1 year ago

Thanks again MTrab for your effort! Could it be useful to share the API docs anywhere? Or did you have you sign a disclosure 😉?

MTrab commented 1 year ago

Yes, I'm not allowed to share the docs

michal197609 commented 1 year ago

I have same problem: Logger: homeassistant.config_entries Source: custom_components/landroid_cloud/init.py:208 Integration: Landroid Cloud (documentation, issues) First occurred: 16:48:58 (2 occurrences) Last logged: 17:06:02

Error setting up entry Worx - "e-mail" for landroid_cloud Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 226, in _call req.raise_for_status() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.worxlandroid.com/api/v2/users/certificate

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/landroid_cloud/init.py", line 64, in async_setup_entry result = await _async_setup(hass, entry) File "/config/custom_components/landroid_cloud/init.py", line 208, in _async_setup await hass.async_add_executor_job(cloud.connect, False, False) File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 269, in connect with self._get_cert() as cert: File "/usr/local/lib/python3.10/contextlib.py", line 135, in enter return next(self.gen) File "/usr/local/lib/python3.10/site-packages/pyworxcloud/init.py", line 324, in _get_cert certresp = self._api.get_cert() File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 135, in get_cert calldata = self._call("/users/certificate") File "/usr/local/lib/python3.10/site-packages/pyworxcloud/api.py", line 236, in _call raise NotFoundError() pyworxcloud.exceptions.NotFoundError

MTrab commented 1 year ago

Jeez - EVERYONE has this error ;)

TheDK commented 1 year ago

Just took out the mower after winter and noticed it didn't work in HA - found this thread. :)

Thanks for your efforts - looking forward to v3! :)

Rafifi commented 1 year ago

The first coffee of my life that i pay is for you. Thank you for all !

lonevvolf commented 1 year ago

Just started setting up my Home Assistant installation, and this is the only item which I can't yet move over from Homebridge. So happy to see someone is working on this so diligently! Keep up the good work, still some weeks before lawn season here. 👍

michaldobrotka commented 1 year ago

+1, Thanks Malene

azertigrou64 commented 1 year ago

@MTrab , I have found that the API URL to get data has changed: https://api.worxlandroid.com/api/v2/product-items/?status=1 instead of https://api.worxlandroid.com/api/v2/product-items//status

but the API to get certificate does not exist anymore: https://api.worxlandroid.com/api/v2/users/certificate

TOKEN=$(curl -v -X POST -d '{"client_id": "150da4d2-bb44-433b-9429-3773adc70a2a", "grant_type": "password", "scope": "*", "client_secret": "nCH3A0WvMYn66vGorjSrnGZ2YtjQWDiCvjg7jNxK", "username": "", "password":""}' -H 'Content-Type: application/json' https://id.eu.worx.com/oauth/token | jq -r '.access_token') curl -X GET -H 'Accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" https://api.worxlandroid.com/api/v2/product-items/?status=1

curl -X GET -H 'Accept: application/json' -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" https://api.worxlandroid.com/api/v2/users/certificate | jq -r '.pkcs12' | base64 --decode > certif.p12 ==> NOT FOUND 401

If you have found how to connect to MQTT landroid AWS, could you give me information? Thx

MTrab commented 1 year ago

Did you even read the latest comments??

"Thanks, but not necessary, as I have gained full access to the API documentation from Positec"

azertigrou64 commented 1 year ago

Nice ! @MTrab . Could you give me it?

MTrab commented 1 year ago

Again - did you read the comments??

"I'm not allowed to share the docs"

azertigrou64 commented 1 year ago

Sorry, I didn't see that. I hope you will finish the job soon! A lot of people seem to be impatient like me!

MTrab commented 1 year ago

An early beta release is just about to be released, hopefully within a few days.

azertigrou64 commented 1 year ago

Thanks ! Good job !

MTrab commented 1 year ago

Still issues installing v3, now due to some dependencies not playing nice on HAOS.