Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State becoming unavailable and won't recover until Home Assistant is restarted #16

Closed
arnoldpistorius opened this issue Feb 14, 2022 · 7 comments

Comments

@arnoldpistorius
Copy link

Hi,

I have the issue that at some time (after few days) the states of the integration become "unavailable" and won't recover until I restart Home Assistant.

I don't see anything in HA logs, but I also don't have the debug log of this integration enabled. I have used same e-mail address as the Zonneplan app on my phone uses, could that be a problem?

I will enable the debug logging and let you know when it happens again

@arnoldpistorius
Copy link
Author

The issue started this morning again. Now having some logging. Seems that at some point the service returns 503 Service Unavailable and then the integration does not recover from that:

2022-03-18 10:16:55 INFO (MainThread) [custom_components.zonneplan_one.coordinator] _async_update_data: start
2022-03-18 10:16:55 DEBUG (MainThread) [custom_components.zonneplan_one.api] ZonneplanAPI response header: <CIMultiDictProxy('Date': 'Fri, 18 Mar 2022 09:16:55 GMT', 'Server': 'Apache', 'Content-Length': '299', 'Connection': 'close', 'Content-Type': 'text/html; charset=iso-8859-1')>
2022-03-18 10:16:55 DEBUG (MainThread) [custom_components.zonneplan_one.api] ZonneplanAPI response status: 503
2022-03-18 10:16:55 ERROR (MainThread) [custom_components.zonneplan_one.coordinator] Authentication failed while fetching zonneplan_one data: 503, message='Service Unavailable', url=URL('https://app-api.zonneplan.nl/user-accounts/me')
2022-03-18 10:16:55 DEBUG (MainThread) [custom_components.zonneplan_one.coordinator] Finished fetching zonneplan_one data in 0.346 seconds (success: False)
2022-03-18 10:16:55 INFO (MainThread) [custom_components.zonneplan_one.config_flow] __init__
2022-03-18 10:16:55 DEBUG (MainThread) [custom_components.zonneplan_one.config_flow] reauth {'auth_implementation': 'zonneplan_one', 'token': {'token_type': 'Bearer', 'expires_in': 28800, 'access_token': '**REDACTED**', 'refresh_token': '**REDACTED**', 'expires_at': 1647598975.465228}, 'email': '**REDACTED**'}

After this happens, the zonneplan_one component doesn't log anything anymore (it happened almost 4 hours ago).

@arnoldpistorius
Copy link
Author

Tagging you @fsaris :)

@fsaris
Copy link
Owner

fsaris commented Apr 20, 2022

don't you get an notification to re-authenticate the app in this case? With version 0.0.10 this should be improved

@arnoldpistorius
Copy link
Author

Yes I get that, but it happens not in a consequent interval sometimes a few weeks, sometimes a few hours. The mobile app doesnt have to reauthenticate. So I guess something can be improved in refreshing the access token?

@fsaris
Copy link
Owner

fsaris commented Apr 21, 2022

Can you test version 0.0.10 to see if it's still happens?

@arnoldpistorius
Copy link
Author

I’ve just installed it via HACS, let’s see how it goes! 👏

@arnoldpistorius
Copy link
Author

@fsaris looks like the issue is not happening anymore. Thanks for the update!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants