enode icon indicating copy to clipboard operation
enode copied to clipboard

Questions - more than issues..

Open drlauridsen opened this issue 1 year ago • 3 comments

I made my own enode integration for HA https://github.com/drlauridsen/Enode-for-HA/

Looking through your code, your integration is far more elegant, especially in regards to token/oauth and webhooks. I am curious.. How/where do you update the token every hour with the oauth function?

  • I have an issue with the plugged in status being wrong, when the car goes into deep sleep mode. Enode does not really seem to believe me 🙂. When charging or when sentry mode or 12V plug is active, the plugged in status is correct, but otherwise it will return not plugged in quite randomly, even when plugged in. This makes it impossible to reliably control charging from homeassistant.. This is not my integration that fails to report the correct status, the status is the same on the enode webpage.. Have you seen the same pattern?

Image

drlauridsen avatar Jun 03 '25 18:06 drlauridsen

@drlauridsen thank you for the compliment 🙂

Regarding the token expiry there are 2 ways that it is handled. If webhooks are enabled then it will receive an event when the credentials have expired and will inform HA to trigger a reauth. The non-webhook way is via HA's Oauth integration that is used when making requests, it will do all the checks and mark to be reauthed if the creds expire. This method does not handle if the API responds with forbidden though because HA just checks the expiration date I believe. It remedies itself when the integration is reloaded though.

I have noticed that Enode's data does occasionally get stuck which was why I included a button to force an update. This is a function that Enode supports. Based on their documentation it seems they try to minimise their interactions with their partners but those optimisations may cause staleness.

I hope that answers your questions.

evilmarty avatar Jun 09 '25 08:06 evilmarty

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Jul 09 '25 20:07 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Jul 14 '25 20:07 github-actions[bot]