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

Error 401, message='Unauthorized' #17

Open jheling opened 1 year ago

jheling commented 1 year ago

Hello,

I have used your integration for a few weeks with no problems. But now the integration is offline and the home assistant log shows the following error:

stihl_imow: Error on device update!

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 537, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update await self.async_update() File "/config/custom_components/stihl_imow/sensor.py", line 194, in async_update mower_state: MowerState = await self.imow.receive_mower_by_id( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/imow/api/init.py", line 494, in receive_mower_by_id response = await self.api_request( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/imow/api/init.py", line 291, in api_request raise e File "/usr/local/lib/python3.11/site-packages/imow/api/init.py", line 286, in apirequest payload.raise_for_status() File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 1005, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 401, message='Unauthorized', url=URL('https://api.imow.stihl.com/mowers/81771/')

Have you seen this error before? The normal app is working as normally.

Best, Johan

stefnats commented 9 months ago

i receive the same error. i suspect some kind of refresh-token issue. Seems a re-init of the cloud connection could work, but this integration doesn't seem to detect or offer it (like a dialog in home assistant where it prompts you to login again)