I highly recommend you to take a look at the link I shared in the post previous to yours.
Yes, i upgraded to the mentioned integration without problems; all data and entity names were preserved. Remove the current integration, add new source in HACS, install (i chose MAIN version so i was up to date with latest patches not yet released).
I did change the update interval from 60 to 30 seconds like i was used to with posixx.
Like @vbh (thanks for the summary of steps to take), I also migrated from the deprecated posixx to the “briancmpbll” version. All good and up and running.
Note that v.0.13 has configurable “Update intrval”, no need to manually change it anymore in the “init.py” file.
Good to see that our hardworking coding community has gathered forces and we are on one flow now.
tnx
John
@bokepasa79 Same behaviour noticed here. I am using Evoy-S-metered-EU, on V7,x since it was installed, - these things seem to restart itself every day around 23:00 local time. As such not a big issue, I learnt to live with it, as during that time I have zero Solar production ongoing. Unavailability of the sensors is mostly 1-2 minutes.
HOWEVER - I am using the “Current production xxxx” sensors as input to my energy dashboard. First to a Rieman Sum helper, who then feeds into the final helper which is configured as utility meter which feeds my Energy Dashboard.When the “Current production xxx” becomes unavailable, the Rieman helper becomes unavailble. Understandable, and correct behaviour.
When the Envoy “Current production xxx” becomes available again at about 23:02, it comes available with a value of 0 (zero). The Rieman Sum helper will not trigger on this to also become available, it does so in the early morning when it sees production > 0 value coming in. You might want to leave your system untouched overnight to see if it has exactly this behaviour.
My solution for this:
I run an automation (limited to be triggered onyl during 22:50 - 23:10), which triggers when my Rieman Sum helper becomes unavailable. Then it waits a couple of minutes, checks if Envoy Production xxx is available, and calls a service as per below to force the Rieman Sum helper to update itself. It does that with the new value of 0 (zero) of “Current production xxx”.
I hope I explained it in an understandable fashion, and it helps you.
grtz
John
Alrighty guys,
Here is the fully manual solution I came up with using just the rest sensor for Enphase Envoy on D7 firmware.
It’s a lengthy guide with lots of explanation.
Hopefully it helps someone else out.
I see that home assistant 2023.9 has updated the official enphase integration to support newer firmware. It seems logical to try to move towards the official integration, however I am afraid of losing the historical statistics for energy usage. Does a migration path exist which minimises loss of data ?
There was something mentioned about this in readme of latest version update IIRC. Maybe check that? And if you change over, let us know the results I will wait a bit longer before deciding to switch over or not, current solution works fine and has also active development so i don’t see a real benefit ATM.
Having this issue since upgrading to 2023.9 - the Current Power Production data coming from my Enphase Integration (which has been running fine for a year) has suddenly started putting out negative data. This obviously has major effects on the Energy Dashboard data. Has anyone else seen this?
Since 2023.9 (red line is where I updated) updated the native integration, do I need to delete and re-add the Enphase module?
If you are having an issue with the native integration, I would go to
and raise a problem there.
I did days ago and I came back to Enphase DEV because a lot of issues.
I will wait a while before try to change again.
I have 2 Enphase configurations. One with 3 phases (Envoy S Standard EU D5.0.55), one with 1 phase (Envoy S Metered EU D8.2.4225).
The D5.0.55 is working flawless in HA.
The D8.2.4225 I’m trying to get integrated since version D7 but nothing work. I’m using the latest v0.20 of GitHub - briancmpbll/home_assistant_custom_envoy
But for more than a year, I cannot get it integrated. Whatever I do. I’m using the enlighten username password, it filling in the envoy serial number automatically, “use Enlighten” ticked on…
What else can I do? I never got this integrated into HA while the D5 version is perfect within HA.
Hello @jnathalia,
Have you tried logging into the device yourself via the browser?
This is exactly what the integration does on your behalf.
To attempt this, I am able to visit https://envoy.local/
Once I get past the security warnings, I am presented with the following login screen.
Press Login with Enphase
And then try your Enlighten login details.
If you are successful, you will see the following
and then you will see this indicating you are successfully logged in
If you are unable to do these steps successfully, then that is probably why the integration/addon can’t perform these steps on your behalf either.
Thanks @del13r,
I have followed your clear instructions with the following results:
Then I logged in with the correct Enlighten credentials:
Then going back to integration:
But it is still failing… (although the error message is now simple as far as I can remember from yesterday when tweaking around again…)
Does it have something to do that I’m working with duckdns.org and https, so accessing from outside? However, I tested it by using my https://192.168.1.140:8123 and it doesn’t make a difference. Same error…
You can add below to your configuration.yaml in the HA config folder. Then restart HA and try adding the envoy again. Inspect the home-assistant.log file for any indication of issues.
logger:
default: warning
logs:
custom_components.enphase_envoy: debug
httpx: debug
httpcore: debug
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?
It is actually retrieving a token successfully. The empty token at the start is as expected as you are adding the envoy. Then it reaches out to enphase and obtains a token which is valid till October 1, 2025.
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
As a next step it is reaching out to your envoy to authenticate with the envoy, but no reply is returned, a timeout occurs. And it tries again to connect to the envoy
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: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
And times-out for the second time
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 the issue is that the Envoy is not replying to authentication requests with the token.
I assume you picked some parts from the log. There may be more detailed lines between the first connection attempt to the Envoy and the last failure, These may contain some more information.
What type of Enphase account do you have, installer/diy or home owner?
I’m a homeowner when looking into account details. System maintainer is someone else (the installer) unfortunately.
I have found this article and I’m testing it: Enphase Envoy - D7 firmware with JWT - A Different Approach
Although the sun is not shining at all, the sensors have been created and measuring 0 Watt at the moment… I hope the sun comes to make me more happy with some figures and overcome the autumn
EDIT: this is actually close to this thread… what a mistake! When I go to top, I see the final implementation. Great work…! Thanks @del13r