Enphase Envoy - Current state of things

@PureeTofu and @madbrain

You need to switch to the Posixx repository. That one is updated to the HA update 2023-03.

See my post in this topic.

https://community.home-assistant.io/t/async-forward-entry-setups-this-will-fail-in-version-2023-3/533293?u=panzer_v

Panzer_V,
I tried the Posixx repository, after multiple reboots - took a good hour.
Unfortunately, it doesn’t work with the Envoy R (2010 generation, LCD model), unlike the briancampbell integration I was using.
It does work with my MY2022 IQ Envoy, but I won’t be able to find out if it solves the problem I had with connectivity.
I have both the old gen and new gen Envoy and need an integration that supports both models. The briancampbell integration did support both.
However, it was exhibiting intermittent connectivity issues with the IQ Envoy. The connecitivity with the Envoy R (LCD) never had issues, though.

Back to briancampbell for now.
Edit : looks like it already has the async fix for 2023/3 .

1 Like

Getting same error. I have uninstalled and reinstalled a couple of times. Each time it works for a few days.

I am terrified to touch my integration at all.

Our existing system (firmware v5) has been working flawlessly for over a year… If it ain't broke don't fix it

Does anybody know if Enphase forces updates firmware?
Is there any way to downgrade the firmware?

I spun up at VM with HASS.io + HACS to try out @posixx and @briancmpbll but both fail with an Unexpected error

@briancmpbll’s repo at least detects the host, but still no luck

@madbrain did you reboot HASS or your Envoy IQ?

Thoughts?

I rebooted my HAOS. Didn’t reboot the IQ Envoy. That needs to be done outside at the breaker panel.

I don’t believe Enphase forces firmware updates, but if you have issues with your Envoy or micro-inverters, you can call them and ask them to push the update to you. They don’t auto-update.

I am using this integration with async fix taken from posixx. It’s better to use posixx btw, I m just too busy with other things, not touching HA.

To use the integration you must have the enlighten app account. Then use the username and password, thick “use enlighten” option.

Ah, that was the trick.


I wrongfully assumed it would prompt me for the username and password due to the Use Enlighten box being enabled.

I am using @briancmpbll’s integration with HA 2023.3.6 but you mention that I should use @posixx’s integration, I’m confused as to why.

I mentioned posixx because he updated his. I saw brian also. So, either one should be good, we don’t have much choice. :laughing:

The HA official integration hasn’t been updated, probably the developers are still using the old firmware.

I have D7 firmware, an encharge battery and solar. Would like to be able to get battery percentage(or kWH remaining) , house and battery power draw. High preference on this being local.

Does anyone have recommendations on which integration to use?

Posixx appear to be an ok integration.

Running @briancmpbll version since mid Feb when my panels where installed with D7 firmware from the get go. Envoy is connected using wire, not wifi, was auto-detected and all running fine.

I tried making the riemann helper, and added the template to my configuration.yaml but it is not working, I get errors “statistics_not_defined” & entity not available

FYI - Received the following email from Enphase on 2023-04-15. The gist is:

No clue as to how soon it will be. I’m considering reaching out to Enphase Support to see if I can defer the update for a while to make sure the Home Assistant integration gets updated.


Subject: Security enhancements to Enphase IQ Gateway API

To our valued partners and customers,

At Enphase, we take security seriously. We want to ensure that all customers and stakeholders have access to the most secure and reliable operating environment possible.

We’ll be updating the API security protocols associated with the software running on the IQ Gateway, and we’re writing to share information about these changes with all Enphase homeowners, installers, software developers, and partners who may be affected.

These updates have begun propagating across accounts and will continue to roll out over time to all accounts. If you’re creating, using, or maintaining custom monitoring software that relies on interactions with IQ Gateway local interfaces, formally known as Envoy, this critical information will require your review and potential action.

Here is a summary of the changes that will go into effect with release 07.03.120 and higher:
Added a new capability to generate and authenticate secure access tokens via web UI to secure all custom applications and API calls. Documentation now includes examples of how to use URLs to get tokens programmatically using shell script-based or Python-based methods. Revised documentation also explains how to connect securely using the updated IQ Gateway local UI and/or IQ Gateway APIs.
Note that if your system is a beta system, an IQ8 system, or an IQ Battery-based system, you may already be running version 07.03.120 or higher on your Gateway.

Complete and newly updated API documentation is available here.

If you have further questions or require additional support after consulting the updated API documentation, please reach out for support.

We’re here to help, and the small investment of time and resources required to enhance these security protocols will be well worth it to safeguard the health and uninterrupted function of your Enphase systems.

Thank you,

The Enphase Team

To our valued partners and customers,

At Enphase, we take security seriously. We want to ensure that all customers and stakeholders have access to the most secure and reliable operating environment possible.

We’ll be updating the API security protocols associated with the software running on the IQ Gateway, and we’re writing to share information about these changes with all Enphase homeowners, installers, software developers, and partners who may be affected.

These updates have begun propagating across accounts and will continue to roll out over time to all accounts. If you’re creating, using, or maintaining custom monitoring software that relies on interactions with IQ Gateway local interfaces, formally known as Envoy, this critical information will require your review and potential action.

Here is a summary of the changes that will go into effect with release 07.03.120 and higher:

  • Added a new capability to generate and authenticate secure access tokens via web UI to secure all custom applications and API calls.
  • Documentation now includes examples of how to use URLs to get tokens programmatically using shell script-based or Python-based methods.
  • Revised documentation also explains how to connect securely using the updated IQ Gateway local UI and/or IQ Gateway APIs.

Note that if your system is a beta system, an IQ8 system, or an IQ Battery-based system, you may already be running version 07.03.120 or higher on your Gateway.

Complete and newly updated API documentation is available here.

If you have further questions or require additional support after consulting the updated API documentation, please reach out for support.

We’re here to help, and the small investment of time and resources required to enhance these security protocols will be well worth it to safeguard the health and uninterrupted function of your Enphase systems.

Thank you,

The Enphase Team

1 Like

FYI the code owner hasn’t been active for a year. I’m not sure how soon a new API would be implemented.

ugh mine just got updated today without my knowledge to version 7. what are you guys using for HACS integration now?

the integration from Posixx works like a charm.

https://github.com/posixx/home_assistant_custom_envoy

thank you!

This just happened to me as well. Upgraded to V7 which killed connectivity for the classic integration.

I’m trying to use the posixx fork, but for the life of me, I can’t get the authentication working (times out with “unknown error” after about 60 seconds). Have I overlooked something obvious? Any tips appreciated!!

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/enphase_envoy/envoy_reader.py:197
Integration: Enphase Envoy
First occurred: 2:06:09 PM (1 occurrences)
Last logged: 2:06:09 PM

Error setting up entry Envoy 122035061711 for enphase_envoy
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 130, in _call_sslobject_method
    result = func(*args)
  File "/usr/local/lib/python3.10/ssl.py", line 917, in read
    v = self._sslobj.read(len)
ssl.SSLWantReadError: The operation did not complete (read) (_ssl.c:2548)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/enphase_envoy/__init__.py", line 99, in async_setup_entry
    await coordinator.async_config_entry_first_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 204, in async_config_entry_first_refresh
    await self._async_refresh(
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 195, in _async_update_data
    return await self.update_method()
  File "/config/custom_components/enphase_envoy/__init__.py", line 50, in async_update_data
    await envoy_reader.getData()
  File "/config/custom_components/enphase_envoy/envoy_reader.py", line 387, in getData
    await self.detect_model()
  File "/config/custom_components/enphase_envoy/envoy_reader.py", line 422, in detect_model
    await self._update_from_pc_endpoint()
  File "/config/custom_components/enphase_envoy/envoy_reader.py", line 156, in _update_from_pc_endpoint
    await self._update_endpoint(
  File "/config/custom_components/enphase_envoy/envoy_reader.py", line 181, in _update_endpoint
    response = await self._async_fetch_with_retry(
  File "/config/custom_components/enphase_envoy/envoy_reader.py", line 197, in _async_fetch_with_retry
    resp = await client.get(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1757, in get
    return await self.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1533, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1620, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1648, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1685, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1722, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 90, in handle_async_request
    return await self._connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 112, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 91, in handle_async_request
    ) = await self._receive_response_headers(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 155, in _receive_response_headers
    event = await self._receive_event(timeout=timeout)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/http11.py", line 191, in _receive_event
    data = await self._network_stream.read(
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 34, in read
    return await self._stream.receive(max_bytes=max_bytes)
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 195, in receive
    data = await self._call_sslobject_method(self._ssl_object.read, max_bytes)
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 137, in _call_sslobject_method
    data = await self.transport_stream.receive()
  File "/usr/local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 1265, in receive
    await self._protocol.read_event.wait()
  File "/usr/local/lib/python3.10/asyncio/locks.py", line 214, in wait
    await fut
asyncio.exceptions.CancelledError