sander1988 / Indego

Home Assistant Custom Component for Bosch Indego Lawn Mower
Apache License 2.0
95 stars 29 forks source link

errors in log + battery & temp lost #146

Closed kuradi closed 3 years ago

kuradi commented 3 years ago

i see those errors in my log. also battery and temp sensors are lost. ha 2021.9.7. app working as expected.

2021-10-01 10:37:51 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:37:54 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:37:58 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:01 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:04 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:07 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:10 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:13 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:17 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:20 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:23 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:26 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:29 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:32 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:35 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:38 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:41 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry 2021-10-01 10:38:44 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/706605093/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry

kuradi commented 3 years ago

i have those errors already 5834 times :)

MartinKuhl commented 3 years ago

which logger do you activated to get these lines?

kuradi commented 3 years ago

which logger do you activated to get these lines?

logger: default: error

Eime commented 3 years ago

Same here...

kingrun commented 3 years ago

getting the same error logs on my indego +350 . Also blocks using the indego app on phone.

Windmelodie commented 3 years ago

Same here. Indego +500. HA 2021.6.6.

When integration is activated in HA and getting errors, it blocks access of indego mobile app from the "home" network (WIFI). https://indego.grauonline.de/ works also instable and getting Error429. If using mobile data, then app works fine.

Deactivate the integration in HA, then the mobile apps works also with "home" netwotk.

Log when restarting HA

2021-10-03 21:04:43 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform indego Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities await asyncio.gather(tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 614, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/indego/sensor.py", line 68, in async_added_to_hass self.state = state.state File "/config/custom_components/indego/sensor.py", line 97, in state self.async_schedule_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 525, in async_schedule_update_ha_state self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 368, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 422, in _async_write_ha_state icon = (entry and entry.icon) or self.icon File "/config/custom_components/indego/sensor.py", line 125, in icon int(self._state) if self._state is not None else None, self.charging ValueError: invalid literal for int() with base 10: 'unknown' 2021-10-03 21:04:43 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up indego platform for sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 258, in _async_setup_platform await asyncio.gather(pending) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 614, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/indego/sensor.py", line 68, in async_added_to_hass self.state = state.state File "/config/custom_components/indego/sensor.py", line 97, in state self.async_schedule_update_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 525, in async_schedule_update_ha_state self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 368, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 422, in _async_write_ha_state icon = (entry and entry.icon) or self.icon File "/config/custom_components/indego/sensor.py", line 125, in icon int(self._state) if self._state is not None else None, self.charging ValueError: invalid literal for int() with base 10: 'unknown' 2021-10-03 21:04:48 WARNING (MainThread) [custom_components.indego] Uncaught error: init() got an unexpected keyword argument 'renew_date' on index: 0 2021-10-03 21:04:52 ERROR (MainThread) [pyIndego.indego_async_client] 429, message='Too Many Requests', url=URL('https://api.indego.iot.bosch-si.com/api/v1/alms/124608138/state?longpoll=true&timeout=300&last=0'): Failed GET to Indego, won't retry

DEBUG shows

2021-10-03 21:15:20 DEBUG (MainThread) [custom_components.indego] Starting initial update. 2021-10-03 21:15:21 DEBUG (MainThread) [custom_components.indego] Refreshing state. 2021-10-03 21:15:21 DEBUG (MainThread) [custom_components.indego] Refreshing 10m. 2021-10-03 21:15:21 DEBUG (MainThread) [custom_components.indego] Refreshing 24h. 2021-10-03 21:15:21 INFO (MainThread) [custom_components.indego] Update state got an exception: init() got an unexpected keyword argument 'enabled' 2021-10-03 21:15:21 DEBUG (MainThread) [custom_components.indego] Refreshing state. 2021-10-03 21:15:22 INFO (MainThread) [custom_components.indego] Update state got an exception: init() got an unexpected keyword argument 'enabled' 2021-10-03 21:15:22 DEBUG (MainThread) [custom_components.indego] Refreshing state. 2021-10-03 21:15:22 WARNING (MainThread) [custom_components.indego] Uncaught error: init() got an unexpected keyword argument 'renew_date' on index: 0 2021-10-03 21:15:22 INFO (MainThread) [custom_components.indego] Update state got an exception: init() got an unexpected keyword argument 'enabled' 2021-10-03 21:15:22 DEBUG (MainThread) [custom_components.indego] Refreshing initial operating data. 2021-10-03 21:15:22 DEBUG (MainThread) [custom_components.indego] Refreshing state. 2021-10-03 21:15:22 INFO (MainThread) [custom_components.indego] Update state got an exception: init() got an unexpected keyword argument 'enabled'

for those who might help. the API response of state request is now:

{ "state" : 258, "enabled" : true, "map_update_available" : false, "mowed" : 25, "mowmode" : 2, "xPos" : 192, "yPos" : 107, "runtime" : { "total" : { "operate" : 511, "charge" : 91 }, "session" : { "operate" : 5, "charge" : 0 } }, "mapsvgcache_ts" : 1633292875901, "svg_xPos" : 240, "svg_yPos" : 880, "config_change" : false, "mow_trig" : false }

MartinKuhl commented 3 years ago

error 429 says that to many requests try to access the indego API. For some reasons the home assistant integration tries to call the API to often.

jm-73 commented 3 years ago

My mower is in the storage until nex summer. So I am not giving this much thought right now. But feel free to contribute with pull requests when you find the problem.

Siggy101 commented 3 years ago

I have this issue as well.

jm-73 commented 3 years ago

Probably someone has to go into the Android App and unzip/debug that software. People have done that before and from there reverse-engineered the API calls.

quinten94b commented 3 years ago

Having the same issues with mi S500+

Controlling the indego works from HA but loss of the following entities/not updating: battery, mower state,....

Next mow, alarms, last mow, ... do seem to work.

Also the android app gives different errors when connected to the same wifi as HA. Over 4G the android app is error free. Once Indego is disabled in HA, my android app works fine again over wifi.

MartinKuhl commented 3 years ago

{ "state" : 258, "enabled" : true, "map_update_available" : false, "mowed" : 25, "mowmode" : 2, "xPos" : 192, "yPos" : 107, "runtime" : { "total" : { "operate" : 511, "charge" : 91 }, "session" : { "operate" : 5, "charge" : 0 } }, "mapsvgcache_ts" : 1633292875901, "svg_xPos" : 240, "svg_yPos" : 880, "config_change" : false, "mow_trig" : false }

I get the message that the integration has problems with "enabled" : true MainThread) [custom_components.indego] Update state got an exception: init() got an unexpected keyword argument 'enabled'

Is this a new parameter the HA integration is not able to handle? In the documentation here: https://github.com/zazaz-de/iot-device-bosch-indego-controller/blob/master/PROTOCOL.md I am not able to find this new data field. @jm-73 could you have a look here. Maybe there could be a quick fix from site?

Windmelodie commented 3 years ago

So the API has changed as far as we know 2 parts: "enabled" in "state" and "renew_date" in "serial" (generic data)

As far as I can tell, all API level functinos are coded in PYINDEGO I believe we only need to add below code in https://github.com/jm-73/pyIndego/blob/master/pyIndego/states.py

in line 320, add enable: bool = None

in line 182, add self.renew_date = convert_bosch_datetime(self.renew_date)

in line 170, add renew_date: datetime = None

I am not familiar with Github and I have no idea how do modify the code here. I believe there should be a new reversion of pyindego created and then to make it work in HA, it need to be changed to pyIndego==2.0.30 or something in manifest of this repository

just noticed that it seems to be already added as issue in pyindego https://github.com/jm-73/pyIndego/issues/110

jm-73 commented 3 years ago

I have build a new version of the python library used by the Bosch integration. Please try this change in your config/custom_components/indego/manifest.json:

"requirements": ["pyIndego==2.0.29"],

change to

"requirements": ["pyIndego==2.0.30"],

Please let me know if it works for you!

/J

dodg3r commented 3 years ago

Hi. I can comfirm that its working.

Thanks....Great work !!

Windmelodie commented 3 years ago

I have build a new version of the python library used by the Bosch integration. Please try this change in your config/custom_components/indego/manifest.json:

"requirements": ["pyIndego==2.0.29"],

change to

"requirements": ["pyIndego==2.0.30"],

Please let me know if it works for you!

/J

Thank you very much for the quick fix. It works perfectly for me. Indego s+ 500

No errors or warning

2021-10-12 08:23:22 DEBUG (MainThread) [custom_components.indego] Starting initial update. 2021-10-12 08:23:22 DEBUG (MainThread) [custom_components.indego] Refreshing state. 2021-10-12 08:23:22 DEBUG (MainThread) [custom_components.indego] Refreshing 10m. 2021-10-12 08:23:22 DEBUG (MainThread) [custom_components.indego] Refreshing 24h. 2021-10-12 08:23:22 DEBUG (MainThread) [custom_components.indego] Refreshing state. 2021-10-12 08:23:26 DEBUG (MainThread) [custom_components.indego] Refreshing initial operating data. 2021-10-12 08:23:26 DEBUG (MainThread) [custom_components.indego] Refreshing state. 2021-10-12 08:23:29 INFO (MainThread) [custom_components.indego] Updating operating data 2021-10-12 08:23:29 DEBUG (MainThread)

MartinKuhl commented 3 years ago

for me too

Siggy101 commented 3 years ago

Thank you for another rapid fix, @jm-73 It sure is fun trying to keep up with Bosch and their random changes! I wonder what this one was intended to achieve. Can anyone with more technical skills hazard a guess as to what they were trying to improve? I'm not sure that these changes pave the way for any additional features...

jm-73 commented 3 years ago

New version of component released. Should be visible in HACS shortly.