vincentwolsink / home_assistant_enphase_envoy_installer

This is a HACS custom integration for Enphase Envoys with firmware version 7 and up.
Apache License 2.0
54 stars 10 forks source link

[BUG] "Error communicating with API" #133

Closed rrozema closed 2 weeks ago

rrozema commented 3 weeks ago

Describe the bug After installing HA Core 2024.6.2 all entities created by the Enphase Envoy (Installer) are shown as 'Unavailable'. The integration status cycles between 'Initializing' and 'Failed setup, will retry: Error communicating with API:'. Before the update everything worked fine.

Restarted the envoy, restarted HA, restarted router, reloaded the integration nothing helps.

Also -and I think this means that this is something caused by Enphase, not the integration- if I open in a browser (both Chrome and Edge) http://envoy.local, the page takes a very long time (several minutes of just a wait cursor) to open, then

504 Gateway Time-out
openresty/1.17.8.1

is shown. If I use the envoy's ip address, http://192.168.128.103, the exact same thing happens. Yet, my envoy successfully reports to Enlighten, the data in there does get updated plus shows a success status, and even the live status screen -which is supposed to connect to the envoy directly- works correctly.

Account type

Envoy

Home Assistant

Additional context home-assistant_enphase_envoy_2024-06-12T12-30-25.741Z.log

vincentwolsink commented 3 weeks ago

Hi @rrozema, the process pushing data to Enlighten is a different one from serving the API on the Envoy. It is possible that the one broke and the other still working. Can you try to power cycle your Envoy?

rrozema commented 3 weeks ago

I already did that, and I power cycled the router and ha too (several times). I also removed the integration and reinstalled it. I also tried removing the integration, removing the hacs project and tried installing the official Enphase envoy integration. Still same result. I verified in my router the envoy still has the same ip: it has a reserved op address in the dhcp and it is on that ip. So I am sure now that it is not something in the installer integration, or at least if it is, it is in the official Enphase envoy integration too. To me it looks like my IP is getting blocked (maybe intentionally or not?) when trying to refresh the token required for getting local api access.

Op do 13 jun. 2024 08:05 schreef Vincent Wolsink @.***>:

Hi @rrozema https://github.com/rrozema, the process pushing data to Enlighten is a different one from serving the API on the Envoy. It is possible that the one broke and the other still working. Can you try to power cycle your Envoy?

— Reply to this email directly, view it on GitHub https://github.com/vincentwolsink/home_assistant_enphase_envoy_installer/issues/133#issuecomment-2164518428, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANKYDS5DFT4KXB5RGP3SETZHEZD5AVCNFSM6AAAAABJGIRHA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRUGUYTQNBSHA . You are receiving this because you were mentioned.Message ID: <vincentwolsink/home_assistant_enphase_envoy_installer/issues/133/2164518428 @github.com>

rrozema commented 3 weeks ago

FYI: just to check I opened https://entrez.enphaseenergy.com/ from my work network and got myself a token from there for my envoy. Tonight I will try to do the same from my home network.

https://enphase.com/download/accessing-iq-gateway-local-apis-or-local-ui-token-based-authentication

jsimonetti commented 2 weeks ago

I have an identical problem. Also started yesterday. My gut says enphase did a booboo...

Edit: i just did a reboot gateway command from enlighten diagnostics dashboard and that fixed the issue.

rrozema commented 2 weeks ago

entrez.enephaseenergy.com works from home too, but gettting a fresh token doesn't fix the problem.

I just posted in the Enphase forum a question for help too: how-to-fix-504-gateway-timeout-openresty11781-when-calling-httpenvoylocal-or-httplocal-ip

rrozema commented 2 weeks ago

I have an identical problem. Also started yesterday. My gut says enphase did a booboo...

Edit: i just did a reboot gateway command from enlighten diagnostics dashboard and that fixed the issue.

How do I get to that enlighten diagnostics dashboard?

rrozema commented 2 weeks ago

I have an identical problem. Also started yesterday. My gut says enphase did a booboo... Edit: i just did a reboot gateway command from enlighten diagnostics dashboard and that fixed the issue.

How do I get to that enlighten diagnostics dashboard?

Found it.

For me "reboot gateway" also fixed the problem. At first the situation only changed a little: When I tried opening http://envoy.local/production.json, it showed me this screen image (401 Authorization required) When I clicked the link in that page, the page again loaded for a long time, but this time I did get a page like this: image (You are not authorized to view that page)

After clicking the OK button, I was able to enter the token I got from entrez.enphaseenergy.com and I did get in again!

THANK YOU!

rrozema commented 2 weeks ago

Not an issue in the integration. It's the local gateway in the envoy itself messing up with validating security via Enphase's stupid online token authorization (did I mention I hate cloud solutions already?).