mikey0000 / ha-electric-kiwi

HACS compatible version of the electric kiwi integration
GNU General Public License v3.0
17 stars 0 forks source link

When internet is down, integration triggers a re-auth #2

Closed mikey0000 closed 1 year ago

mikey0000 commented 1 year ago

Authentication failed while fetching Electric Kiwi HOP Data data: Access token failure: Cannot connect to host account-link.nabucasa.com:443 ssl:default [Try again]

Expected: Fail and don't trigger re-auth

What happens: triggers re-auth

obrendino commented 1 year ago

Hi Mikey. I need to reconfigure the integration every few hours as select.hour_of_free_power becomes unavailable. HA is has an ethernet connection to the internet so unsure if this is the same issue that you have raised. Other sensors seem to be available and keep the same data. I use select.hour_of_free_power as drop down input or through voice command.

mikey0000 commented 1 year ago

Yeah this is likely a problem with EK, and their auth server, I've tried raising it, maybe an issue on github will raise it, I'll raise it with them there again, I've been in direct contact with both Nabu Casa and EK but things have fallen away on this issue. I'll see if I can stop it from refreshing so often. Unfortunately due to the prod keys being with Nabu it's hard to resolve on my own. I'll see what I can do, I'm suffering too.

mikey0000 commented 1 year ago

@obrendino can you try now with my latest update, I've reduced the interval for hop updates to 15 minutes as I went back through some old emails and suspect the refresh token expires causing the 500, just made the change now so please give it a go and let me know if this resolves the issue.

obrendino commented 1 year ago

Thanks Mikey. Seems stable now. Been like that since yesterday arvo and overnight ;)

mikey0000 commented 1 year ago

I think I've resolved this bug as well in a previous commit. So I'll close for now. Any new issues just open a ticket/issue.