[New Binding] Enphase Envoy Solar System gateway

Tags: #<Tag:0x00007f616fe5b410> #<Tag:0x00007f616fe5b2d0> #<Tag:0x00007f616fe5b028>

I’ve created a binding for the Enphase Envoy Solar System gateway (https://enphase.com/en-us/products-and-services/envoy). Unlike the existing OHAB 1.0 binding, this binding works via the local network, and doesn’t require the Enphase Enlighten cloud setup.

The binding should be able to discover the Envoy gateway device on your local network, and if you never changed the original password, it should be able to add it as Thing without any further action. If you changed the default password, you’ll need to set that in the bridge configuration. Once added as thing, it should be able to find all the micro-inverters of your solar system, and add them to your inbox.

The bridge device has four channels for a system summary. The inverters that are discovered have their individual channels as reported by the device, with their individual updates. The scan rate for the device can be configured in the bridge configuration, however since the internal update rate is 15 minutes, it doesn’t make much sense to scan at a high rate. My device became unstable when the scan rate was lower than 15 seconds, so keep it well clear of that (it’s not like you’d gain anything).

Some docs and the source is here: https://github.com/HentschelT/openhab2-addons/tree/master/addons/binding/org.openhab.binding.enphaseenvoy

You can download the latest addon jar file from this location: https://github.com/HentschelT/openhab2-addons/tree/master/addons/binding/org.openhab.binding.enphaseenvoy/releases and add it to your OpenHAB’s addon folder.

Cheers,
-Th

4 Likes

Hi Thomas,
I’m new to the hole OH2 consept. I have a raspberry running the latest version of openHABIan. Do you have any instructions regarding how to install your add-on to openHABian and get it configured?

Thank you.
Torben

You should just need to copy the .jar file (downloaded from the link above) into the “addons” directory (should be ‘/usr/share/openhab2/addons’ in your case), and you should see the envoy in your inbox shortly after. If not, make sure you have frontail installed (can be done via the openhab config tool), and look at the log (http://your.rpi.ip:9001) if there is anything that looks suspicious.

Cheers,
-Th

Thank you for the quick response. I was able to install the addon - OK :slight_smile: but I get offline - communication_Error when trying to connect to the Enphase Envoy Bridge. Any suggestions?

The plugin have detected the system IP, version number of the SW, etc. The bridge pw is the default. I can login from a browser.

Tried changing the PW, but no luck.

2018-06-18 22:27:46.960 [hingStatusInfoChangedEvent] - ‘enphaseenvoy:envoy_bridge:121422049612’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR)

2018-06-18 22:28:02.875 [me.event.ThingUpdatedEvent] - Thing ‘enphaseenvoy:envoy_bridge:121422049612’ has been updated.

2018-06-18 22:28:02.897 [hingStatusInfoChangedEvent] - ‘enphaseenvoy:envoy_bridge:121422049612’ changed from OFFLINE (COMMUNICATION_ERROR) to ONLINE

2018-06-18 22:28:02.931 [me.event.ThingUpdatedEvent] - Thing ‘enphaseenvoy:envoy_bridge:121422049612’ has been updated.

==> /var/log/openhab2/openhab.log <==

2018-06-18 22:28:04.019 [WARN ] [y.internal.EnphaseEnvoyBridgeHandler] - envoy scanner update failed: unsupported auth scheme: [���A]

Drats, looks like your envoy doesn’t use digest auth for the inverter data. Can you please get me the software version and software build date from the envoy web page (the local page). To figure how to make this work, in your web browser, could you see if

http://envoy:<passwd>@<hostname>/api/v1/production/inverters

works w/o popping up a login box? Substitute as follows:

  • < password > is the last 6 digits of your serial number (unless you changed the password, then it’s whatever you set it to)
  • < hostname > is the ip address of your envoy.

Funny enough, for the most part, authentication isn’t even needed for this device, just for the inverter data. Maybe I should change the algorithm to at least get that data, even if auth for the inverters fails.

Good luck,
-Th

Hi Thomas,
Current Software Version: R3.11.30 (0c976a)
Software Build Date: Tue Oct 07, 2014 02:48 PM PDT

When I try executing the below web link in a browser I get the following error.
{
“status”: 401,
“error”: “”,
“info”: “Authentication required”,
“moreInfo”: “”
}

The administrator username / password for my unit is still default. No change.

Please let me know if there is any additional information I can provide you. Thank you for your help.

Looks like your version is quite a bit down from what I got:
D4.5.72 (c7e5cc)
31 Jan, 2017 11:28 AM

There is a option to update (if a update is available for your device) from the enlighten cloud page (main page -> devices-> click on the “envoy” link), see if there is a update available.

However, one question before you do that: is the local user name “envoy” for you? (i.e. when you try to call up the “diagnostics tools” on the local page).

Reason for that is while developing the binding, since I didn’t see an option to change the user name, I assumed it’s always “envoy”. Perhaps there was such an option in a prior software version, which means I’d need to add that to the binding.

Good luck,
-Th

Hi,
According to Envoy’s home page the API call location format:
http://{IP Address}/api/v1/production

In my case
http://192.168.1.106/api/v1/production

This results in:
{
“wattHoursToday”: 19572,
“wattHoursSevenDays”: 275896,
“wattHoursLifetime”: 39790682,
“wattsNow”: 239
}

I therefore assume you just need to loose the envoy@IP adddress to make it work. I shall be happy to test:slight_smile:

Thanks,
Torben

Hi Torben,

yes, I know, I think I mentioned this earlier in this thread that I’ll change the binding to always return those values - independent of authentication status.

However, the binding does more: it finds your individual micro-inverters and adds those as 'things" to openhab, including their data channels. For that it needs authentication (it’s a bit weird that this device is so inconsistent when it comes to auth).

So, yes, I’ll change the binding to always be able to return the default stuff even tho it cannot authenticate. But for the individual inverters, it will need auth.

Cheers,
-Th

Hi Thomas,

For my unit - password only seem to be required to enter the administration tab. (username: admin)
Other tabs on the local web. Events, Production and Inventory does not require a user login / password.

Hope this helps.

Kind regards,
Torben Madsen

This worked like a charm! 20 inverters added as things.

Now if I can just figure out getting them into a site map.

Thanks for this, I’m in the middle of setting up a small array to test if its worth getting more. My envoy is on the slow boat from california so I should be able to test this out next week. sweet!

BTW, some rather helpful individual has figured out how to get the “installer” password and has made an android app for it. I don’t know if this would be helpful for this binding or not, if more information could be gathered, but I thought I’d mention it.

the apk download is toward the bottom. I’ve installed it and tested the generated password and it works.

Thanks for this binding, got my envoy yesterday and it seems to be working just fine.

Expecting my enphase setup to be installed next week. (yay) Would it be possible to add this binding in the Marketplace and/or do you plan to make a pull request to the oh2 addons repo?
I ordered an Envoy s with IQ7 inverters. Is it any different then the M250 inverters (api wise)?

Hi Thomas,

I have an older Enphase Envoy-R. I can access the inverters page now that I got the password using the Android app that generates the password based on the serial number.

Looking through the code it looks like the username is hardcoded to “envoy”. Is it possible to parameterize the username? On my Envoy the username for the inverters page is “installer”

I just don’t know if that is the only change that would be needed to talk to the Envoy-R, as I couldn’t set up a development environment to make a private build.
https://community.openhab.org/t/eclipse-installer-failed/50917/3

Here is the output from http://ip/api/v1/production/inverters

[
  {
    "serialNumber": "12345",
    "lastReportDate": 1539394263,
    "lastReportWatts": 1,
    "maxReportWatts": 148
  },
  {
    "serialNumber": "123456",
    "lastReportDate": 1539394265,
    "lastReportWatts": 1,
    "maxReportWatts": 152
  },
  {
    "serialNumber": "123457",
    "lastReportDate": 1539394255,
    "lastReportWatts": 1,
    "maxReportWatts": 175
  },
  {
    "serialNumber": "123458",
    "lastReportDate": 1539394260,
    "lastReportWatts": 1,
    "maxReportWatts": 158
  },
  {
    "serialNumber": "123459",
    "lastReportDate": 1539394267,
    "lastReportWatts": 2,
    "maxReportWatts": 174
  },
  {
    "serialNumber": "123450",
    "lastReportDate": 1539394256,
    "lastReportWatts": 1,
    "maxReportWatts": 175
  },
  {
    "serialNumber": "12341",
    "lastReportDate": 1539394261,
    "lastReportWatts": 2,
    "maxReportWatts": 196
  },
  {
    "serialNumber": "123412",
    "lastReportDate": 1539394253,
    "lastReportWatts": 2,
    "maxReportWatts": 171
  },
  {
    "serialNumber": "123413",
    "lastReportDate": 1539394257,
    "lastReportWatts": 2,
    "maxReportWatts": 200
  },
  {
    "serialNumber": "123414",
    "lastReportDate": 1539394262,
    "lastReportWatts": 2,
    "maxReportWatts": 196
  },
  {
    "serialNumber": "123415",
    "lastReportDate": 1539394264,
    "lastReportWatts": 1,
    "maxReportWatts": 170
  },
  {
    "serialNumber": "123416",
    "lastReportDate": 1539394254,
    "lastReportWatts": 1,
    "maxReportWatts": 171
  },
  {
    "serialNumber": "123417",
    "lastReportDate": 1539394259,
    "lastReportWatts": 1,
    "maxReportWatts": 152
  },
  {
    "serialNumber": "123418",
    "lastReportDate": 1539394264,
    "lastReportWatts": 1,
    "maxReportWatts": 199
  }
]

You think the binding would work with only changing the username?

Is it possible to add the thing in textfile instead of inbox? And if so, what would the syntax ? I couldn’t find anything related in the documenation of this binding.
Binding looks good, hope it is not abandoned before it is added to the openhab2 addons repo. @captndelta Are you planning a pull request?

Hi folks, I haven’t gotten around too much OHAB stuff lately over the summer, but I think (hope) this will change in the next few weeks and I get around to making some of the bug fixes and improvements mentioned here.

Just so nothing gets forgotten, could you folks please file “issues” (bug reports or feature requests) on github here: https://github.com/HentschelT/openhab2-addons/issues
This way there is less chance that something gets forgotten once I get around to it. Thanks!

@gregd: Yea, the user name should be easy to make a config item, I was wondering if that was hardcoded for all the envoys.

@lsiepel: I was planning on getting it into the marketplace once feature requests and bugs stabilize a bit. So, maybe after this round I’ll upload it there.

Cheers,
-Th

Looks like an interesting binding, will try it for sure.
I’m just wondering why this isn’t in the binding repository of OpenHAB ?

Does this binding use the Units of Measurement? I tried to get it to convert from Watts to MW via the item, but was unsuccessful. It might just be me, so I will look at it further - just wondering if it should work?

Second comment is that I am also getting the issue that another person reported. Everything appears to work fine, but my log file is filling with these messages:

2018-10-15 23:30:18.479 [WARN ] [okhttp3.OkHttpClient                ] - previous digest authentication with same nonce failed, returning null

Hi Thomas,

Some issue’s are filed at that repo. I really hope that you can find some time to move them forward. If i can help in any way, please let me know.

Regards, Leo