ChrisHaPunkt / ha-stihl-imow

Using https://github.com/ChrisHaPunkt/stihl-imow-webapi to provide STIHL iMow lawn mower information to Home Assistant
19 stars 1 forks source link

HA integration stopped working (May 3rd) #13

Closed tgilis closed 1 year ago

tgilis commented 1 year ago

I noticed there were some maintenance activities on the platform recently and the HA integration no longer works since May the 3rd.

Error on my side


This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/stihl_imow/__init__.py:138 
Integration: STIHL iMow 
First occurred: 08:04:05 (6 occurrences) 
Last logged: 16:13:13

Error setting up entry Lawn Mower for stihl_imow
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/stihl_imow/__init__.py", line 138, in async_setup_entry
    hass.config_entries.async_setup_platforms(entry, PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'
steve125125 commented 1 year ago

For me it stopped working after updating HA to 2023.5.1 and still not working with HA 2023.5.2

2023-05-06 00:49:00.003 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Lawn Mower for stihl_imow File "/config/custom_components/stihl_imow/init.py", line 138, in async_setup_entry 2023-05-06 20:56:42.365 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Lawn Mower for stihl_imow File "/config/custom_components/stihl_imow/init.py", line 138, in async_setup_entry

ChrisHaPunkt commented 1 year ago

Will have a look into this in the upcoming days. Please provide information about what version of the component you have installed.

tgilis commented 1 year ago

My upgrade to 5.1 and the maintenance window of the iMow platform happened at the same time, so it could be down to the platform update indeed. I'm running the latest v0.1.3 on HA 2023.5.2

Baswart commented 1 year ago

My system also runs HA 2023.5.2 and your latest version v0.1.3. The integration stopped to function at the same time Stihl/iMow had their trouble(s), so I guess it's not due to an update to HA 5.2.

steve125125 commented 1 year ago

Hi Chris - thanks

I use:

Home Assistant 2023.5.2 Supervisor 2023.04.1 Operating System 10.1 Frontend 20230503.3 - latest

HACS Version: 1.32.1 HomeAssistant custom component for STIHL iMow lawn mower v0.1.3

MI 632 C von STIHL Firmware: 3.09

ChrisHaPunkt commented 1 year ago

Looks like this was not related to the upstream maintenance on STIHL. I updated the config_entry setup of the integration ("how to load integration configs in HA") to the in the meantime proposed way. Looks good so far. Please feel free to test the 0.1.4 version. And report back. Thanks

SeraphimSerapis commented 1 year ago

Not OP but I gave 0.14 a spin. Authentication seems to work, however only two sensors are added for the device (a 422PC). As we speak, I get the battery level and total blade operation sensor -- previously, I got a bunch of additional sensors when using this integration.

Screenshot 2023-05-09 at 12 00 01

EDIT: Docked state appeared a few mins later, too.

ChrisHaPunkt commented 1 year ago

@SeraphimSerapis I guess you used the beta release which adds all the other sensors (v1.x)

The 0.1.4 release is a Bugfix release for the 0.x version

Edit: I will release another beta to address the confusion

tgilis commented 1 year ago

Running V1.0.0rc27 now and works again with all sensors back! Thanks @ChrisHaPunkt

IMG_8506

SeraphimSerapis commented 1 year ago

I just (re-)installed the latest rc (27) and am getting an error after the initial login:

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/stihl_imow/__init__.py:57
Integration: STIHL iMow
First occurred: 14:53:25 (1 occurrences)
Last logged: 14:53:25

Error setting up entry Lawn Mower for stihl_imow
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/imow/api/__init__.py", line 221, in __fetch_new_csrf_token_and_request_id
    ).get("value")
AttributeError: 'NoneType' object has no attribute 'get'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/stihl_imow/__init__.py", line 57, in async_setup_entry
    await imow_api.get_token(force_reauth=True)
  File "/usr/local/lib/python3.10/site-packages/imow/api/__init__.py", line 123, in get_token
    await self.__authenticate(self.api_email, self.api_password)
  File "/usr/local/lib/python3.10/site-packages/imow/api/__init__.py", line 174, in __authenticate
    await self.__fetch_new_csrf_token_and_request_id()
  File "/usr/local/lib/python3.10/site-packages/imow/api/__init__.py", line 226, in __fetch_new_csrf_token_and_request_id
    raise ProcessLookupError(
ProcessLookupError: Did not find necessary csrf token and/or request id in html source
ChrisHaPunkt commented 1 year ago

@SeraphimSerapis try restarting home assistant. This solved the problem for me

SeraphimSerapis commented 1 year ago

I confirm that restarting Home Assistant fixed that issue. Thanks!

ChrisHaPunkt commented 1 year ago

Gonna close this issue, feel free to reopen if the error reappears.

steve125125 commented 1 year ago

Thanks 🙏