thanks @catsmanac as well for supporting me.
I found a few lines interesting (“Found empty token:”):
2024-10-01 21:01:35.486 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Checking Token value: (Only first 10 characters shown)
2024-10-01 21:01:35.486 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Found empty token:
2024-10-01 21:01:35.487 DEBUG (MainThread) [httpx] load_ssl_context verify=True cert=None trust_env=True http2=False
2024-10-01 21:01:35.490 DEBUG (MainThread) [httpx] load_verify_locations cafile='/usr/local/lib/python3.12/site-packages/certifi/cacert.pem'
2024-10-01 21:01:35.505 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to load_verify_locations with args (<ssl.SSLContext object at 0x7f4cd1be4d50>,) inside the event loop by custom integration 'enphase_envoy' at custom_components/enphase_envoy/envoy_reader.py, line 253: return self._async_client or httpx.AsyncClient(verify=True, (offender: /usr/local/lib/python3.12/site-packages/httpx/_config.py, line 147: context.load_verify_locations(cafile=cafile)), please report it to the author of the 'enphase_envoy' custom integration
a bit further I found this (seems the token is ok)
2024-10-01 21:01:35.546 DEBUG (MainThread) [httpcore.connection] connect_tcp.started host='enlighten.enphaseenergy.com' port=443 local_address=None timeout=30 socket_options=None
2024-10-01 21:01:35.655 DEBUG (MainThread) [httpcore.connection] connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f4cd1f5f890>
2024-10-01 21:01:35.655 DEBUG (MainThread) [httpcore.connection] start_tls.started ssl_context=<ssl.SSLContext object at 0x7f4cd1be4d50> server_hostname='enlighten.enphaseenergy.com' timeout=30
2024-10-01 21:01:35.757 DEBUG (MainThread) [httpcore.connection] start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f4cd26b22d0>
2024-10-01 21:01:35.758 DEBUG (MainThread) [httpcore.http11] send_request_headers.started request=<Request [b'POST']>
2024-10-01 21:01:35.761 DEBUG (MainThread) [httpcore.http11] send_request_headers.complete
2024-10-01 21:01:35.761 DEBUG (MainThread) [httpcore.http11] send_request_body.started request=<Request [b'POST']>
2024-10-01 21:01:35.762 DEBUG (MainThread) [httpcore.http11] send_request_body.complete
2024-10-01 21:01:35.763 DEBUG (MainThread) [httpcore.http11] receive_response_headers.started request=<Request [b'POST']>
2024-10-01 21:01:37.597 DEBUG (MainThread) [httpcore.http11] receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Tue, 01 Oct 2024 19:01:37 GMT'), (b'Content-Type', b'application/json; charset=utf-8'), (b'Transfer-Encoding', b'chunked'), (b'Connection', b'keep-alive'), (b'Cache-Control', b'max-age=0, private, must-revalidate'), (b'Content-Encoding', b'gzip'), (b'Content-Security-Policy', b"font-src 'self' https: data:; img-src 'self' http://www.google-analytics.com https: blob: data:; object-src 'none'; style-src 'self' https: 'unsafe-inline'; frame-ancestors https://*.enphaseenergy.com;"), (b'Etag', b'W/"a1d04fbe80aee798ddc7f3524775eaba"'), (b'Expect-Ct', b'max-age=1728000, enforce'), (b'Set-Cookie', b'locale=en; path=/; expires=Wed, 01 Oct 2025 19:01:35 GMT; secure; HttpOnly; SameSite=Lax'), (b'Set-Cookie', b'enlighten_manager_token_production=eyJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7InNlc3Npb25faWQiOiIzM2M4NTFkYzdiMzFmNzkwYzBlOTA1NmI3Nzk5ZDM1MCIsImNvbXBhbnlfaWQiOm51bGwsImVtYWlsX2lkIjoiamVyb2VuQG5hdGhhbGlhYmVoZWVyLm5sIiwidXNlcl9pZCI6MzAwMTM5NiwiY2xpZW50X2FwcCI6Iml0azMiLCJmaXJzdF9uYW1lIjoiSmVyb2VuIiwibGFzdF9uYW1lIjoiTmF0aGFsaWEiLCJsb2dpbl91c2VyIjpudWxsLCJpc19kaXN0cmlidXRvciI6ZmFsc2V9LCJleHAiOjE3Mjg0MTQwOTcsInN1YiI6Implcm9lbkBuYXRoYWxpYWJlaGVlci5ubCJ9.KhJChtoRfz14SfInZhLSfIGQJmjEcHSFwaSpxfjrsdE; domain=.enphaseenergy.com; path=/; SameSite=None; secure'), (b'Set-Cookie', b'_enlighten_4_session=33c851dc7b31f790c0e9056b7799d350; path=/; secure; HttpOnly; SameSite=Lax'), (b'Status', b'200 OK'), (b'Strict-Transport-Security', b'max-age=15724800; includeSubDomains'), (b'X-Content-Type-Options', b'nosniff'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'X-Powered-By', b'Phusion Passenger(R) 6.0.19'), (b'X-Request-Id', b'005a7ca03287dba60d0627180d9181e4'), (b'X-Runtime', b'1.730849'), (b'X-Xss-Protection', b'1; mode=block')])
2024-10-01 21:01:37.599 INFO (MainThread) [httpx] HTTP Request: POST https://enlighten.enphaseenergy.com/login/login.json "HTTP/1.1 200 OK"
2024-10-01 21:01:37.599 DEBUG (MainThread) [httpcore.http11] receive_response_body.started request=<Request [b'POST']>
2024-10-01 21:01:37.600 DEBUG (MainThread) [httpcore.http11] receive_response_body.complete
2024-10-01 21:01:37.601 DEBUG (MainThread) [httpcore.http11] response_closed.started
2024-10-01 21:01:37.601 DEBUG (MainThread) [httpcore.http11] response_closed.complete
2024-10-01 21:01:37.603 DEBUG (MainThread) [httpcore.connection] connect_tcp.started host='entrez.enphaseenergy.com' port=443 local_address=None timeout=30 socket_options=None
2024-10-01 21:01:37.710 DEBUG (MainThread) [httpcore.connection] connect_tcp.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f4cd8d3e5a0>
2024-10-01 21:01:37.710 DEBUG (MainThread) [httpcore.connection] start_tls.started ssl_context=<ssl.SSLContext object at 0x7f4cd1be4d50> server_hostname='entrez.enphaseenergy.com' timeout=30
2024-10-01 21:01:37.838 DEBUG (MainThread) [httpcore.connection] start_tls.complete return_value=<httpcore._backends.anyio.AnyIOStream object at 0x7f4cd8d3dbe0>
2024-10-01 21:01:37.839 DEBUG (MainThread) [httpcore.http11] send_request_headers.started request=<Request [b'POST']>
2024-10-01 21:01:37.841 DEBUG (MainThread) [httpcore.http11] send_request_headers.complete
2024-10-01 21:01:37.841 DEBUG (MainThread) [httpcore.http11] send_request_body.started request=<Request [b'POST']>
2024-10-01 21:01:37.843 DEBUG (MainThread) [httpcore.http11] send_request_body.complete
2024-10-01 21:01:37.843 DEBUG (MainThread) [httpcore.http11] receive_response_headers.started request=<Request [b'POST']>
2024-10-01 21:01:38.018 DEBUG (MainThread) [httpcore.http11] receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Tue, 01 Oct 2024 19:01:37 GMT'), (b'Content-Type', b'text/plain;charset=UTF-8'), (b'Content-Length', b'419'), (b'Connection', b'keep-alive'), (b'Strict-Transport-Security', b'max-age=15724800; includeSubDomains'), (b'server', b'hide'), (b'X-Content-Type-Options', b'nosniff')])
2024-10-01 21:01:38.018 INFO (MainThread) [httpx] HTTP Request: POST https://entrez.enphaseenergy.com/tokens "HTTP/1.1 200 OK"
2024-10-01 21:01:38.019 DEBUG (MainThread) [httpcore.http11] receive_response_body.started request=<Request [b'POST']>
2024-10-01 21:01:38.019 DEBUG (MainThread) [httpcore.http11] receive_response_body.complete
2024-10-01 21:01:38.020 DEBUG (MainThread) [httpcore.http11] response_closed.started
2024-10-01 21:01:38.020 DEBUG (MainThread) [httpcore.http11] response_closed.complete
2024-10-01 21:01:38.021 DEBUG (MainThread) [httpcore.connection] close.started
2024-10-01 21:01:38.022 DEBUG (MainThread) [httpcore.connection] close.complete
2024-10-01 21:01:38.023 DEBUG (MainThread) [httpcore.connection] close.started
2024-10-01 21:01:38.024 DEBUG (MainThread) [httpcore.connection] close.complete
2024-10-01 21:01:38.024 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Obtained Token
2024-10-01 21:01:38.025 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Token expires at: 2025-10-01 21:01:37
2024-10-01 21:01:38.032 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] HTTP GET Attempt #1 of 2: https://192.168.1.192/auth/check_jwt: use token: True: Header: <Token hidden> Timeout: 60 Holdoff: 0
2024-10-01 21:01:38.032 DEBUG (MainThread) [httpx] load_ssl_context verify=False cert=None trust_env=True http2=False
2024-10-01 21:01:38.036 DEBUG (MainThread) [httpcore.connection] connect_tcp.started host='192.168.1.192' port=443 local_address=None timeout=60 socket_options=None
Further, it looks like it’s trying to connect again:
2024-10-01 21:02:38.038 WARNING (MainThread) [custom_components.enphase_envoy.envoy_reader] HTTP Timeout in fetch_with_retry, waiting 0 sec:
2024-10-01 21:02:38.039 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] HTTP GET Attempt #2 of 2: https://192.168.1.192/auth/check_jwt: use token: True: Header: <Token hidden> Timeout: 60 Holdoff: 0
2024-10-01 21:02:38.039 DEBUG (MainThread) [httpx] load_ssl_context verify=False cert=None trust_env=True http2=False
2024-10-01 21:02:38.043 DEBUG (MainThread) [httpcore.connection] connect_tcp.started host='192.168.1.192' port=443 local_address=None timeout=60 socket_options=None
Further on:
2024-10-01 21:03:38.046 WARNING (MainThread) [custom_components.enphase_envoy.envoy_reader] HTTP Timeout in fetch_with_retry, raising:
2024-10-01 21:03:38.061 WARNING (MainThread) [custom_components.enphase_envoy.config_flow] Validate input, getdata returned HTTPError:
So, maybe there is a problem with the token…
When I call the URL https://entrez.enphaseenergy.com/login I can type in the name of my Enphase instance and then the gateway appears. I can create the token.
When I select uncommissioned I can also create a token:
Should I define this token somewhere in my yaml?