pyenphase / pyenphase

MIT License
10 stars 4 forks source link

No longer able to authenticate Envoy-R after firmware update D3.18.10 (f0855e) #123

Closed dotMorten closed 9 months ago

dotMorten commented 9 months ago

Describe the bug Since December 16th, my Home Assistant integration has stopped working with Enphase. I noticed a new firmware update got installed, likely around that time, considering the build date:

Current Software Version    D3.18.10 (f0855e)
Software Build Date Mon Oct 30, 2023 07:21 PM GMT

I tried using the latest pyenphase directly, but haven't been able to run any of the examples from the documentation, failing to authenticate.

I'm not able to log into this endpoint it's failing on via the browser either - it prompts me for username/password ,but the old "Installer" and "Envoy" usernames on this old gateway no longer seem to be working. Also tried with the Enlighten username/password + generated token with no luck.

  File "%USER_PROFILE%\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pyenphase\envoy.py", line 231, in _request
    raise EnvoyAuthenticationRequired(
pyenphase.exceptions.EnvoyAuthenticationRequired: Authentication failed for http://192.168.1.84/ivp/meters with status 401, please check your username/password or token.

To Reproduce

Additional context Add any other context about the problem here.

catsmanac commented 9 months ago

Hi @dotMorten, is /info page on the envoy accessible using the webbrowser? And can you try /api/v1/production as well with the browser. Optionally try using last 6 digits of the serialnr as password with Envoy and/or Installer when prompted for username/password

dotMorten commented 9 months ago

/info works:

image

Same for production:

image

I had already tried the Envoy/Installer user with last six of serialnr for password with no luck. I'm getting a little worried Enphase removed this feature, to force users to pay for their new upgrade that enables by-panel tracking in their app ($250 one-time fee or $10/mo).

catsmanac commented 9 months ago

and /api/v1/production/inverters?

dotMorten commented 9 months ago

401 in the returned json and http status code:

image
catsmanac commented 9 months ago

And you had individual inverters reporting before, right?

dotMorten commented 9 months ago

Yup been tracking them all for over a year until 3 days ago.

catsmanac commented 9 months ago

I see what you mean. And does it pop-up a login page with some ref to authentication?

dotMorten commented 9 months ago

No it didn’t. That only seem to happen on the :9094 port endpoint

dotMorten commented 9 months ago

Sorry strike that, if I hit refresh it does ask me. Again admin password doesn't work, nor does envoy/installer/sn#

catsmanac commented 9 months ago

There's one other tool to get/generate a password, but that's not currently used in this pyenphase. It generates a pw for (I think) an installer account. I wonder if you would need that to get a password. But chances are with this new software that it won't work either.

Is /home showing something about tokens?

catsmanac commented 9 months ago

Ah no, pyenphase is using the tool already for a for installer username. And if no username was specified it will use installer.

dotMorten commented 9 months ago

/home doesn't say anything about tokens:

image

Btw the above tool link gives me a 404

catsmanac commented 9 months ago

So all classic pages work, but the inverters not any more.

Is Home Assistant showing the overall numbers, or is all failing?

(the tool: pypi envoy_utils, but as mentioned, it's used already.)

dotMorten commented 9 months ago

Home Assistant is completely failing to authenticate, so no data available anywhere.

dotMorten commented 9 months ago

Btw also opened a support ticked with Enphase, but they've not responded so far. They probably pulled a chamberlain and tried to make some more money

catsmanac commented 9 months ago

Could very well be. It's not the first time fw changes is a real surprise.

As for HA and pyenphase, it should be able to get /api/v1/production, but will fail with /api/v1/inverters. Need to do a bit of digging where that will have impact. Not having /api/v1/inverters accessible is not a case considered currently as real old legacy are not supported.

Matthew1471 commented 9 months ago

IQ Gateway (formerly Envoy) firmware D3.18.10 is impressive! I assume you have the original grey "Envoy" rather than the newer black models.

There's some old legacy advice (and in the screenshot it references D3.17.3 : https://support.enphase.com/s/article/What-is-the-Username-and-Password-for-the-Administration-page-of-the-Envoy-local-interface

Your 401 to the meter endpoint ~I suspect might be~ is due to that endpoint being locked down to an installer password rather than an admin password.. can you log in with "installer" as the username (and try same password in the hope it's the same?)

I have a copy of the D3.15.7 source and you need to be logged in as “arraygun” or “installer” users or better for the inverters stats.

dotMorten commented 9 months ago

D3.18.10 is impressive? It might be the older version but the system is 8yo. Considering these systems are supposed to last 20+ years it’s not even halfway there yet nor out of the 10y warranty.

Matthew1471 commented 9 months ago

I guess the hardware won't support V7.. I guess the V3 releases are still supported on older hardware so yes it will last - but I guess that's different from them rolling out new features - and no CT clamps and live status etc. or the new web interface.

I've had a look at the source and you definitely now need to be logging in with the installer username for the inverters page to work, the password might be generated from https://github.com/sarnau/EnphaseEnergy/blob/main/passwordCalc.py ?

You definitely don't have a tokens release (admin wouldn't work) so wouldn't waste time trying to provide tokens to it (it's looking at pam_emu.so).

bdraco commented 9 months ago
Current Software Version D3.18.10 (f0855e)
Software Build Date Mon Oct 30, 2023 07:21 PM GMT
Database Size 27 MB (7 % full)
Current Timezone US/Hawaii

Just got the update, and getting 401s and failures. installer password still works in the web ui though

bdraco commented 9 months ago

https://github.com/pyenphase/pyenphase/pull/125 adds support for the D3.18.10 (f0855e) firmware

Matthew1471 commented 9 months ago

Does /ivp/bin/pcu_status work on V3 firmwares as an alternative to get the inverter stats?

Matthew1471 commented 9 months ago

Current Software Version D3.18.10 (f0855e) Software Build Date Mon Oct 30, 2023 07:21 PM GMT Database Size 27 MB (7 % full) Current Timezone US/Hawaii

Just got the update, and getting 401s and failures. installer password still works in the web ui though

So you log in as an installer and then try visiting the /api/v1/production/inverters url and it 401s? Does /ivp/bin/pcu_status work?

bdraco commented 9 months ago

Current Software Version D3.18.10 (f0855e) Software Build Date Mon Oct 30, 2023 07:21 PM GMT Database Size 27 MB (7 % full) Current Timezone US/Hawaii Just got the update, and getting 401s and failures. installer password still works in the web ui though

So you log in as an installer and then try visiting the /api/v1/production/inverters url and it 401s? Does /ivp/bin/pcu_status work?

{ "error" : "404 - Not Found" }