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

Appropriate action when Zaptec cloud is not working #90

Open
sveinse opened this issue Jan 14, 2024 · 5 comments
Open

Appropriate action when Zaptec cloud is not working #90

sveinse opened this issue Jan 14, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@sveinse
Copy link
Collaborator

sveinse commented Jan 14, 2024

Discussion: What is the appropriate action when Zaptec cloud is not responding or returns error?

Currently the Zaptec integration will log them to the HA system log. This can easily be interpreted that its the zaptec integration which is at fault. Typical errors that are observed are timeouts and HTTP error code 500 (internal server error). When this happens, quite many errors and warnings are logged.

The Home Assistant integration Quality scale states that a integration should (for silver):

  • Handles internet unavailable. Log a warning once when unavailable, log once when reconnected.
  • Handles device/service unavailable. Log a warning once when unavailable, log once when reconnected.

So what should we do? Do we need to implement some way to determine Zaptec cloud's "healthyness" in order for our integration to reduce the error logging?

@svenakela
Copy link
Contributor

Could be solved by setting an attribute on the binary_sensor when an API call fails. Then log the problem. When the API is working again the time stamp can be cleared and a reconnected is logged.
That would make it easy to visualize if the API is down as well.

I've had some issue last two nights with charging stopped several times and I suspect APIs. Could have been detected with an error time stamp.

@Bluhme1
Copy link

Bluhme1 commented Jan 31, 2024

Agree. Zaptec API has been unstable during the last few days. Error 500.
Has given a lot of errors in the log

@sveinse
Copy link
Collaborator Author

sveinse commented Jan 31, 2024

Interestingly, there already exists entities for this: The "* Charger", "* Circuit" and "* Installation" entities. This entity exists to provide a place to store the legacy attributes and only reads "Connected". But it would be a very useful extension to this that they indeed show the status of the API connection. In hindsight it kinda seems obvious to have this feature.

Definitely something to put on the list! Thanks.

@sveinse sveinse added the enhancement New feature or request label Jan 31, 2024
@Bluhme1
Copy link

Bluhme1 commented Feb 23, 2024

Still getting Time Outs like:

Denne fejl stammer fra en brugerdefineret integration.

Logger: custom_components.zaptec.api
Source: custom_components/zaptec/api.py:855
Integration: Zaptec EV charger (documentation)
First occurred: 16.52.35 (1 occurrences)
Last logged: 16.52.35

Request to https://api.zaptec.com/api/installation/bf68a41d-d2f9-44f5-bfc6-20bf42e645a8 failed (attempt 1): TimeoutError:

Perhaps the Zaptec integration should be more patient before reporting an error. After a short while the connection is established

@Bluhme1
Copy link

Bluhme1 commented May 5, 2024

Hi @sveinse

Did you get any further in your considerations to solve this issue. A pity that a very useful integration produces so many errors

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

No branches or pull requests

3 participants