Enphase Envoy - Current state of things

The ensemble API isn’t available on your firmware version. Please try my version of the plugin GitHub - posixx/home_assistant_custom_envoy

1 Like

Hi All,

It seems a lot of involved people are watching this threat, however I need some help with a new installation:

The Enphase Envoy-S has the following firmware:

<envoy_info>
  <device>
    <software>D7.0.88</software>
    <apiver>1</apiver>
  </device>

One of the things I noticed is that the webserver always performs a HTTP redirect to HTTPS on any request. As the certificate is self-signed, I added this webserver certificate to both the docker-container running H.A., as on the hosts certificate store. From now I can successfully perform HTTPS requests:

* Server certificate:
*  subject: CN=envoy-XXXXXXXXXXXX
*  start date: Nov  9 08:46:36 2022 GMT
*  expire date: Nov  9 08:46:36 2023 GMT
*  common name: envoy-XXXXXXXXXXXX (matched)
*  issuer: CN=envoy-XXXXXXXXXXXX
*  SSL certificate verify ok.

Now when using the ‘DEV’ integration to add the gateway into H.A., I am getting the following error, and from the container log I can see the queries performed are only HTTP, and not HTTPS as the redirect is not followed and stuck in this loop (envoy-XXXXXXXXXX is the hostname resolvable from within the container):

2023-01-12 16:57:16.798 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] HTTP GET Attempt #1: http://envoy-XXXXXXXXXXX/api/v1/production: Header:None
2023-01-12 16:57:16.813 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Fetched from http://envoy-XXXXXXXXXXXX/api/v1/production: <Response [301 Moved Permanently]>: <html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>openresty/1.17.8.1</center>
</body>
</html>

Questions:

  • Am I on the right track with this DEV integration for this specific device?
  • I am unable to report an ‘ISSUE’ on the GitHub page. How to approach the maintainer?

I have this same question…
Which github repo should we be using until this is pushed into core HASS?

Probably this one? posixx/home_assistant_custom_envoy (github.com)

I am also watching this thread, hoping to get some clues to integrate Enphase Envoy S, getting installed this week.

If this work with both fw5 and 7, why is this not the official plugin? Would prefer the native HA one vs a HACS version. Hopefully this replaces the current integration soon!

so here are all of the githubs I know of… (I ended up going with the first on one the list)

REF: Issues · briancmpbll/home_assistant_custom_envoy · GitHub
REF: GitHub - DanBeard/enphase_envoy: Custom component for enphase_envoy Firmware D7.0.0 +
REF: GitHub - jrutski/home_assistant_envoy_d7_fw: Update for D7 based firmware on Envoy gateways
REF: GitHub - posixx/home_assistant_custom_envoy

Kinda makes it a mess in my opinion when there are 4 paths available… can only imagine the issues this presents for troubleshooting. I hope one of these are pulled in as the source of truth to HA.

4 Likes

I successfully integrated the Enphase Envoy (DEV), which entity should I use for the Energy Dashboard?

Is it Envoy xxxxxxxxxx Lifetime Energy Production ?

@jrutski can you help?

I mostly use enphase as a background service and pull certain stats into other cards or the energy dashboard…

mushroom card
image

clicking the card above navigates me to a “Solar” page that has more info like…

also created a card to help predict the electric bill

@fireheadman how do you integrate to the energy dashboard?

Which sensors do you use?

If you are using template.sensors or helpers, how do you set it up?

Please help me. I got my Enphase connected to HA, and I saw lots sensors.

:pray:

This link explains how to setup enphase with energy dashboard. Enphase Envoy with Energy Dashboard

1 Like

Thanks @del13r , I read your guide. But, unfortunately, due to the D7.* firmware, I have to use the Enphase Envoy (DEV) integration from this forum thread. And the “today_s_energy” always 0.

I then convert the sensor.envoy_XXXX_current_power_production to kWh using Riemann Sum helper GUI. And I use this for the Energy Dashboard. It looks it works, at least it has the same value compared to the Enphase Enlighten mobile app (slightly different because Enphase app only has 1 decimal). I hope this is the correct way to get the solar production.

And for the Grid Import and Export, I use the reading from P1 meter connected to the smart meter. I think, this is the way if we have smart meter with P1 port. The reading should have been calculated with the solar panel production. Again, this is my understanding.

Gosh! What a very confusing to setup. I setup Home Assistant mainly for this Energy Dashboard, but it turned out super difficult, with non-working integration, limited documentation. I should not complain, I know. The devs have done very good job, but one of “core” functionality of HA is for this energy monitoring/management, and it is bad. /rant

2 Likes

Is there any idea why the official integration has not yet been updated to support the latest fw? My envoy was just updated and now cannot get it to login. Would much prefer the official Integration to avoid unnecessary churn, but if it isn’t going to be updated for a while will need to look at what options are available.

I did some digging around in GitHub to try and answer this question. Here is what I found.

Let’s start with who is the code owner for the enphase_envoy integration?

According to that list, the owner is

This is the most likely corresponding user in this forum

If we dig a little deeper into GitHub, we can see that the code owner for the enphase_envoy integration has most recently made some commits to another relevant code repository.

I think the common misconception is that just because an integration is “official”, doesn’t automatically mean that the manufacturer was involved or contributed at all. Most of home assistant is community contributions and I would expect no different here.

If I was on v7 firmware, (which I am not so I can’t help test unfortunately) I would have to assume that the jesserizzo repository is being used as the beta for the official integration. This assumption is based solely on the contributions of the official enphase integration code owner.

Maybe if I mention @gregtd, they can comment themselves on the current status.

1 Like

I restarted HA, and suddenly the Enphase integration didn’t work.
I deleted it, restarted HA.

And it failed to connect. How to debug this? My Enphase Enlighten App is working fine.

image

[SOLVED] For whatever reason, the Envoy didn’t connect to WiFi. You can see the WiFi connection status light was red, like this:

image

The Enlighten app received the last report from Envoy was 2 hours ago. I didn’t know how to restart it. I found how to enable AP-mode, to re-configure WiFi, but I didn’t want to do that.

Then, out of sudden, that red-light turned green!

Then I went to HA, re-add the integration. Success! All went fine, all data were still there. Let’s see tomorrow :smiley:

1 Like

Pretty much all of the many different forks/repository choices will be named (DEV) so they won’t get confused with the official integration.

Can I ask what the exact version and url of the repository you are using is so we can all be on the same page here?

Also, can I ask what your decision process was that led you to choosing that specific repo and version?

Example answers that can influence repo choices instead of using the official integration:

  • I have batteries and want to do X with them.
  • I am on version 4.x or 5.x or 7.x.
  • I am on v7.x and am having token trouble.
  • I have 2 independent envoys with different versions.

For example, if I was asking for help, I would visit http://envoy.local/home and grab the following information.

  • Part Number 800-00654-r06
  • Software Version D5.0.62 (5e57a9)

Then I would go to HACS (or whatever method you are using to load unofficial integrations) and go to integrations and click on the integration and then tap the 3 dots and click repository which is how you get the url.

@del13r I am using this repository:

jrutski/home_assistant_envoy_d7_fw: Update for D7 based firmware on Envoy gateways (github.com)

The reason I chose that because of this thread. At least @jrutski posted quite a lot of information, also in several other githubs.

You see, the main part of the integration is this envoy_reader.py

I downloaded that source code, and also from other repository “briancmpbll”. Then I use text editor to compare both files. Pretty much the same, only minor details, like error handling or whatever. So, I would expect others would also be the “same”. From other forum, I read many people success with “briancmpbll”, and I read they have the same issue (confusion) on how to get the value of the solar panel productions and how to add it to the Energy Dashboard.

And me too, I have that confusion! After reading and reading, finally I found that the EASIEST way is to use this entity:

sensor.envoy_XXXXXXXX_current_power_production

Current power production, when the solar panel is generating electricity, this entity will have value in WATT. Otherwise, it would be zero. So, I created helper using Riemann Sum to convert that entity value to kWh, I named it:

sensor.helper_envoy_current_power_production_riemann

That helper would convert the Envoy Current Power from watt to kWh.

But that’s not enough, you still cannot add that to the Energy Dashboard. For that I created a template.sensor like this:

  - sensor:
      name: Solar Panel Production
      state_class: total_increasing
      unit_of_measurement: kWh
      device_class: energy
      icon: mdi:solar-panel-large
      state: >
        {{ states("sensor.helper_envoy_current_power_production_riemann")|float }}

That template.sensor “Solar Panel Production”, I can add it to the Energy Dashboard and it was working fine for two days. The value was the same compared to the Enlighten App “Energy Produced”. So, I can then confirmed the value is correct!.

That’s enough for me.

I also read that we can do the same method with individual inverter entities (convert to kWh then add them all). I am doing that for curiosity.

1 Like

Thanks for sharing what repo you are using, however you havent really explained why you are using that repository.

What problem are you trying to solve by using an unofficial integration?

For example, is it because you:

  • have firmware D7.x and the offical integration doesnt support D7.x ?
  • have batteries ?
  • have single phase power or three phase power?

I ask these questions because different repo’s appear to be trying to solve different specific problems.

I only say this because using specific repositories may solve 1 problem but simultaneously introduce another problem like the one you reported with today_s_energy being 0.

At that point, the repository code author would best understand why this problem was introduced.

The reason because my Enphase Envoy S Metered Gateway has firmware D7.0.88.
And like everyone else in this thread, we cannot use the official integration.

Why?

Because the authentication mechanism has been changed in D7.x firmware.

The official integration is broken because of that.

And this (broken) hasn’t changed for I don’t know how long. To be honest, I can’t wait someone fixed the official integration. I read that the original author also made his last attempt long ago, he made some changes which wasn’t enough. Unfortunately, I don’t save the URL, I think it’s on the envoy_reader.py Github.

So yeah, having official integration would be nice, but it seems it won’t happen anytime soon.

2 Likes

when I read about the repo you are using, it says the following.

Repo: jrutski/home_assistant_envoy_d7_fw

jrutski forked from briancmpbll

Repo: briancmpbll/home_assistant_custom_envoy

briancmpbll is based off work done by DanBeard and forked from jesserizzo/envoy_reader

Repo: DanBeard/enphase_envoy

DanBeard “Copied from ha core and modified for forked envoy_reader lib”.
Official HA Core Enphase_Envoy integration author is jesserizzo and gtdiehl is listed as the code owner.

Repo: homeassistant/components/enphase_envoy/

That’s 4 repo’s. Each repo has variations.
Can you see how all of this fragmentation (forking from another fork) might introduce new issues?

If I was on D7.x firmware, and didn’t have Enphase batteries, i would be more comfortable trying the following pre-release repo written by the author of the official HA Core enphase_envoy integration which is jesserizzo.

gtdiehl has also made commits to this repo and is the listed code owner for the official integration.

Anyone else getting SSL errors today? I am using briancmpbll fork. No issue. I hardcoded the envoy IP in the envoy_reader.py and my IP changed. Duh!