HomeAssistant-Mods / home-assistant-miele

Miele integration for Home assistant
138 stars 32 forks source link

Integration stopped working ("invalid config") after update to 2022.9.x #130

Closed dolodobendan closed 1 year ago

dolodobendan commented 1 year ago

As the title suggests, the integration stopped working here. It still works on my 2022.8.9 installation, though, so I guess 2022.9 broke something.

Nome200 commented 1 year ago

I updated home assistant and browser mod, but because i didnt want to redo all the popups rn i installed a backp from 2 days ago. Now the miele integration refuses to work even with 2022.8.7

pwwukpw commented 1 year ago

Same here

dolodobendan commented 1 year ago

It still works on my test installation (snap install on ubuntu server) with 2022.9.1.

It still does NOT work on my main installation (Home Assistant Operating System, v2022.9.2).

image

**Log Details (ERROR)**

This error originated from a custom integration.

Logger: homeassistant.setup
Source: custom_components/miele/miele_at_home.py:174
Integration: miele ([documentation](https://github.com/HomeAssistant-Mods/home-assistant-miele), [issues](https://github.com/HomeAssistant-Mods/home-assistant-miele/issues))
First occurred: 00:35:13 (1 occurrences)
Last logged: 00:35:13

Error during setup of component miele
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
    result = await task
  File "/config/custom_components/miele/__init__.py", line 152, in async_setup
    data_get_devices = await client.get_devices(lang)
  File "/config/custom_components/miele/miele_at_home.py", line 48, in get_devices
    home_devices = await self._get_devices_raw(lang)
  File "/config/custom_components/miele/miele_at_home.py", line 32, in _get_devices_raw
    if await self._session.refresh_token(self.hass):
  File "/config/custom_components/miele/miele_at_home.py", line 165, in refresh_token
    self._token = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/miele/miele_at_home.py", line 174, in sync_refresh_token
    return self._session.refresh_token(
  File "/usr/local/lib/python3.10/site-packages/requests_oauthlib/oauth2_session.py", line 452, in refresh_token
    self.token = self._client.parse_request_body_response(r.text, scope=self.scope)
  File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 427, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in parse_token_response
    validate_token_parameters(params)
  File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 448, in validate_token_parameters
    raise_from_error(params.get('error'), params)
  File "/usr/local/lib/python3.10/site-packages/oauthlib/oauth2/rfc6749/errors.py", line 399, in raise_from_error
    raise cls(**kwargs)
oauthlib.oauth2.rfc6749.errors.InvalidGrantError: (invalid_grant)
dolodobendan commented 1 year ago

Sorry, same as #129.

However, I was able to get it running again:

Someone suggested that adding the cache path helped.

miele:
  client_id: !secret miele_client_id
  client_secret: !secret miele_client_secret
  cache_path: /config/.storage/.miele-token-cache

Since I un- and reinstalled it several times, this might have been it.

EDIT: And then again, maybe not. I removed the line and it's still working as expected.

dolodobendan commented 1 year ago

Since this is a duplicate and I have no idea what fixed the issue, I'm gonna close it.