msvisser / remeha_home

Remeha Home integration for Home Assistant
60 stars 13 forks source link

Integration gets stuck when token refresh fails #22

Open HanSyt opened 1 year ago

HanSyt commented 1 year ago

I noticed that the Remeha plugin stopped working 2 days ago. The Remeha app is working, so maybe something went wrong with the api? I have tried to reload the plugin but I am getting this error: 2023-05-20 23:16:23.466 ERROR (MainThread) [custom_components.remeha_home.coordinator] Error fetching remeha_home data: 2023-05-22 17:37:07.493 WARNING (MainThread) [homeassistant.config_entries] Config entry 'email' for remeha_home integration not ready yet; Retrying in background

Anyone noticed this too?

HanSyt commented 1 year ago

Solved it, noticed that there was version 1.9, installed that one - didn't help. Added a new instance of the integration,filled out user name and password and it was back online.

msvisser commented 1 year ago

I've seen some weird behaviour from the OAuth2 endpoint, where it sometimes just returns a 400 Bad Request response on a token refresh causing the integration to get stuck. I have a workaround planned that will be in the next version, which allows you to manually re-authenticate, but I'm investigating the underlying problem.

Issue #20 is probably also related to this problem.

msvisser commented 1 year ago

In version v0.1.10 I have added in a workaround which allows you to re-authenticate from the Home Assistant user interface. The integration should now also log the error, which can be used for further debugging.

dsgepers commented 12 months ago

In version v0.1.10 I have added in a workaround which allows you to re-authenticate from the Home Assistant user interface. The integration should now also log the error, which can be used for further debugging.

Can you elaborate on this re-authenticate from the HA UI?

I cannot seem to find this feature in v0.1.12

msvisser commented 11 months ago

The re-authentication feature will only show up if the current token cannot be refreshed. In that case a message will show up on the Remeha Home integration and it will allow you to login again.

If you are running in to this issue, please post the error log from the Remeha Home integration.

dsgepers commented 11 months ago

I was, however, the issue was unrelated in the end. My instance has having issues with connecting over IPv6. Disabeling it resolved this (and other) issue(s).

Thanks for taking the time to reply though! :-)