HomeAssistant-Mods / home-assistant-miele

Miele integration for Home assistant
138 stars 32 forks source link

Error during setup of component miele #129

Open Ritschi75 opened 1 year ago

Ritschi75 commented 1 year ago

Hello I had the Miele integration running before. After importing a backup it did not work anymore.

Here is the error message in the log: `Logger: homeassistant.setup Source: custom_components/miele/miele_at_home.py:174 Integration: miele (documentation, issues) First occurred: 17:09:02 (1 occurrences) Last logged: 17:09:02

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 448, 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)`

Kann mier jemand weiterhelfen?

nenadmilano commented 1 year ago

I have the same error:

`Logger: homeassistant.setup Source: custom_components/miele/miele_at_home.py:174 Integration: miele (documentation, issues) First occurred: 21:46:23 (1 occurrences) Last logged: 21:46:23

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 448, 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)`

Connection via the official miele app works fine so I expect a change in the Miele API which needs an adjustment in the code of the integration.

z3kt0r commented 1 year ago

I got something slightly different. -> And i dont have any UI to set something up.

ERROR:

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant.setup Source: custom_components/miele/init.py:109 Integration: miele (documentation, issues) First occurred: 22:37:22 (1 occurrences) Last logged: 22:37:22

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 153, in async_setup hass.data[DOMAIN][DATA_DEVICES] = _to_dict(data_get_devices) File "/config/custom_components/miele/init.py", line 109, in _to_dict for item in items: TypeError: 'NoneType' object is not iterable

piechade commented 1 year ago

Is the development of this extension active and will fix someone this issue?

dolodobendan commented 1 year ago

I think this is more of a hiccup. Try deleting the content of /config/custom_components/miele/__pycache__, uninstalling and then reinstalling the integration. That's how I somehow fixed this. Not sure what exactly caused or fixed this issue, but here it's working again.

You have to check "Notifications" after the reinstallation for the authentication process to start.

piechade commented 1 year ago

I think this is more of a hiccup. Try deleting the content of /config/custom_components/miele/__pycache__, uninstalling and then reinstalling the integration. That's how I somehow fixed this. Not sure what exactly caused or fixed this issue, but here it's working again.

You have to check "Notifications" after the reinstallation for the authentication process to start.

<

I removed the integration, now I'm notable to find it in hacs again.

smarteqvist commented 1 year ago

Getting crazy. Experience the same since I updated HA. This is my log. Can somone pleeeeeease help me?

Logger: homeassistant.setup Source: custom_components/miele/miele_at_home.py:174 Integration: miele (documentation, issues) First occurred: 12:44:58 (1 occurrences) Last logged: 12:44:58

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

I think this is more of a hiccup. Try deleting the content of /config/custom_components/miele/__pycache__, uninstalling and then reinstalling the integration. That's how I somehow fixed this. Not sure what exactly caused or fixed this issue, but here it's working again.

You have to check "Notifications" after the reinstallation for the authentication process to start.

I did this and it's working again.

HeinzLehner commented 1 year ago

I think this is more of a hiccup. Try deleting the content of /config/custom_components/miele/__pycache__, uninstalling and then reinstalling the integration. That's how I somehow fixed this. Not sure what exactly caused or fixed this issue, but here it's working again. You have to check "Notifications" after the reinstallation for the authentication process to start.

I did this and it's working again.

Unfortunately this does not work for me. I still have the same error. Is there possibly another solution?

piechade commented 1 year ago

I think this is more of a hiccup. Try deleting the content of /config/custom_components/miele/__pycache__, uninstalling and then reinstalling the integration. That's how I somehow fixed this. Not sure what exactly caused or fixed this issue, but here it's working again. You have to check "Notifications" after the reinstallation for the authentication process to start.

I did this and it's working again.

Unfortunately this does not work for me. I still have the same error. Is there possibly another solution?

Same for me, deleted everything with the keyword miele and added it again. Nothing is working.

dolodobendan commented 1 year ago

Okay, there's one more probably silly thing I did. Try this:

  1. Uninstall integration
  2. Delete the token (/config/.storage/.miele-token-cache) "Show hidden files" must be enabled
  3. Delete the entry in configuration.yaml
  4. Restart HA
  5. Reinstall integration
  6. Restart HA
  7. Add entry, but with path to the token. You probably have to modify the path:
miele:
  client_id: ***
  client_secret: ***
  cache_path: /config/.storage/.miele-token-cache
  1. Restart HA
  2. Check "Notifications" for the auth. process to start.
elliottwalker commented 1 year ago

The added steps of token cache deletion and setting the path in the config worked. Thank you!

Ede711 commented 1 year ago

Same here. I uninstalled and reinstalled it several times, added the cache_path like mentioned here and removed the files in the folder before the reinstallation. Nothing seems to work. The notification for the authentication doesn't appear. It's always the same error.

dolodobendan commented 1 year ago

Okay, there's one more probably silly thing I did. Try this:

  1. Uninstall integration
  2. Delete the token (/config/.storage/.miele-token-cache) "Show hidden files" must be enabled
  3. Delete the entry in configuration.yaml
  4. Restart HA
  5. Reinstall integration
  6. Restart HA
  7. Add entry, but with path to the token. You probably have to modify the path:
miele:
  client_id: ***
  client_secret: ***
  cache_path: /config/.storage/.miele-token-cache
  1. Restart HA
  2. Check "Notifications" for the auth. process to start.

Try this and don't skip any steps.

Ede711 commented 1 year ago

My bad. It seems to be the token. Now it runs like a charm :) Thank you!

HeinzLehner commented 1 year ago

Okay, there's one more probably silly thing I did. Try this:

  1. Uninstall integration
  2. Delete the token (/config/.storage/.miele-token-cache) "Show hidden files" must be enabled
  3. Delete the entry in configuration.yaml
  4. Restart HA
  5. Reinstall integration
  6. Restart HA
  7. Add entry, but with path to the token. You probably have to modify the path:
miele:
  client_id: ***
  client_secret: ***
  cache_path: /config/.storage/.miele-token-cache
  1. Restart HA
  2. Check "Notifications" for the auth. process to start.

Try this and don't skip any steps.

This is the solution. Now it works again as it should. Thank you very much.

Sn4k3E4t3r commented 1 year ago

This does not work for me. I get the Same Error.

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 222, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 82, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 236, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle result = await result File "/config/custom_components/miele/init.py", line 252, in get result = await hass.async_add_executor_job(func) 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 151, in get_access_token token = self._session.fetch_token( File "/usr/local/lib/python3.10/site-packages/requests_oauthlib/oauth2_session.py", line 366, in fetch_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.InvalidClientError: (invalid_client)

miele.yaml

client_id: 06f28c71-853xxxxxxxxxxxxxxxxxxxxxxx
client_secret: !secret miele
lang: de=german
cache_path: /config/.storage/.miele-token-cache
smolders33 commented 1 year ago

I tried everything that is mentioned in this ticket but now this error

Deze fout is ontstaan door een aangepaste integratie.

Logger: homeassistant.setup Source: custom_components/miele/init.py:109 Integration: miele (documentation, issues) First occurred: 21:16:15 (1 occurrences) Last logged: 21:16:15

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 153, in async_setup hass.data[DOMAIN][DATA_DEVICES] = _to_dict(data_get_devices) File "/config/custom_components/miele/init.py", line 109, in _to_dict for item in items: TypeError: 'NoneType' object is not iterable

N3rdix commented 1 year ago

For me it was enough to delete the cache file, restart home assistant and authorize the integration from the notifications

SolutionHacker commented 1 year ago

Yes, deleting the .miele_token_cache file, restarting HA and authorising the integration was enough for me too!

smolders33 commented 1 year ago

Deleted the token also in the hidden storage folder Works here