Closed otterlo closed 2 weeks ago
That error means the specified username or password failed when connecting to the Enphase website to get a token.
Relation to the new firmware is probably that it forces to get a new token which surfaces the issue with username or password. Therefore the integration won't load as it needs the token to access the Envoy.
Do the username and password work when going to https://enlighten.enphaseenergy.com/ ?
That firmware is for the California NEM 3 with AI Optimization replacing savings mode. (https://enphase.com/download/ai-optimization-california-net-billing-tariff-nem-30-user-guide , https://support.enphase.com/s/article/how-does-my-enphase-energy-system-with-iq-batteries-work)
HI, thanks for the replies. yes, the authorisation works normally for enlighten, everything works including the app. system is fully functional. it is only the integration that does not load
Anything in the log file aside from that error? If you enable debug in HA on the Envoy and let it run for some time there maybe some more info on what is going on.
I've seen similar reports in the past where the issue mysteriously disappeared again. In most of these cases the Enlighten web-site was suspected to be overloaded. Can't say if that is the case here too.
If the issue persists, one work-around to attempt is getting a token manually. Visit https://entrez.enphaseenergy.com/ to get a token using your credentials. Test the token by opening the envoy local web-page https://envoy.local and pasting it in there.
Once you have the token you can update it in the HA file that holds the token:
envoy.1cc04dea6776540521e6aeff2cf1d25b
.
will be different in your case.{
"version": 1,
"minor_version": 1,
"key": "envoy.1cc04dea6776540521e6aeff2cf1d25b",
"data": {
"token": "a very long string which is the token"
}
}
a very long string which is the token
in the token file by the new token.
To enable debug:
When you disable debug again, the logfile will download to your PC.
As for the firmware, that can also be pushed out due to recently discover vulnarabilities in the Envoy firmware
Hi, i confirm that above procedure of generating new token has worked for me, it is operatational now.
not sure if this procedure is written down somewhere but will be very valuable perhaps for other users having same issue
i thank you so much for your help
i forgot to take snapshot from the log, but basically the error was: could not authenticate.
all is working now
I was a little too early i guess. It stoppen working today. Some 2 hours ago. So not from midnight exactly.
I have the same error again.
I will copy log output below. Perhaps the system wrote back the old token. I can not check this richt now but will do later.
Logboek Details (FOUT) Deze fout is ontstaan door een aangepaste integratie. Logger: custom_components.enphase_envoy Bron: helpers/update_coordinator.py:354 integratie: Enphase Envoy (DEV) (documentatie) Eerst voorgekomen: 06:49:23 (154 gebeurtenissen) Laatst gelogd: 09:17:28
Unexpected error fetching envoy Envoy 122243062107 data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/enphase_envoy/init.py", line 66, in async_update_data await envoy_reader.getData() File "/config/custom_components/enphase_envoy/envoy_reader.py", line 587, in getData await self._getEnphaseToken() File "/config/custom_components/enphase_envoy/envoy_reader.py", line 502, in _getEnphaseToken self._token = await self._fetch_owner_token_json() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/enphase_envoy/envoy_reader.py", line 485, in _fetch_owner_token_json raise RuntimeError(f"Could not Authenticate with Enlighten, status: {resp.status_code}, {resp}") RuntimeError: Could not Authenticate with Enlighten, status: 401, <Response [401 Unauthorized]>
So it worked for couple of hours and then failed again? What type of account do you have, homeowner or diy/ installer? The last one expires in couple of hours and nerds refresh then. Might be the Reason you are back in same situation.
Op 22 aug. 2024 om 09:21 heeft otterlo @.***> het volgende geschreven:
I was a little too early i guess. It stoppen working today. Some 2 hours ago. So not from midnight exactly.
I have the same error again.
I will copy log output below. Perhaps the system wrote back the old token. I can not check this richt now but will do later.
Logboek Details (FOUT) Deze fout is ontstaan door een aangepaste integratie. Logger: custom_components.enphase_envoy Bron: helpers/update_coordinator.py:354 integratie: Enphase Envoy (DEV) (documentatiehttps://github.com/briancmpbll/home_assistant_custom_envoy#readme) Eerst voorgekomen: 06:49:23 (154 gebeurtenissen) Laatst gelogd: 09:17:28
Unexpected error fetching envoy Envoy 122243062107 data Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 271, in _async_update_data return await self.update_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/enphase_envoy/init.py", line 66, in async_update_data await envoy_reader.getData() File "/config/custom_components/enphase_envoy/envoy_reader.py", line 587, in getData await self._getEnphaseToken() File "/config/custom_components/enphase_envoy/envoy_reader.py", line 502, in _getEnphaseToken self._token = await self._fetch_owner_token_json() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/enphase_envoy/envoy_reader.py", line 485, in _fetch_owner_token_json raise RuntimeError(f"Could not Authenticate with Enlighten, status: {resp.status_code}, {resp}") RuntimeError: Could not Authenticate with Enlighten, status: 401, <Response [401 Unauthorized]>
— Reply to this email directly, view it on GitHubhttps://github.com/briancmpbll/home_assistant_custom_envoy/issues/202#issuecomment-2303960086, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4XI5JHW3CKSNC5R2MIUYG3ZSWGPJAVCNFSM6AAAAABMZ7X4RWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBTHE3DAMBYGY. You are receiving this because you commented.Message ID: @.***>
Hi, i installed the system myself, so i guess installer. i dont do it for profession, just this installation at home. then why would it have been working for the last year? it was working fine.
when i went to the site for the token, it asked whether it was for commissioned systems or uncommissioned if you select commissioned, you can then select your system, when selecting uncommissioned i also got a token, but did not work
so i think i did it right way but as you mention: it may be a token for a short duration
then i probably have to create a account for me being the home owner?
Really don’t know. You asked the right question, it worked before, why not anymore.
Is something changed in that Enlighten login page for installers? Getting a token is documented by Enphase so you could ask their support about this.
@vincentwolsink has a custom integration for installers, but switching might break your stored history, not sure.
I’ll have another look at the code just to be sure.
Op 22 aug. 2024 om 10:54 heeft otterlo @.***> het volgende geschreven:
Hi, i installed the system myself, so i guess installer. i dont do it for profession, just this installation at home. then why would it have been working for the last year? it was working fine.
when i went to the site for the token, it asked whether it was for commissioned systems or uncommissioned if you select commissioned, you can then select your system, when selecting uncommissioned i also got a token, but did not work
so i think i did it right way but as you mention: it may be a token for a short duration
then i probably have to create a account for me being the home owner?
— Reply to this email directly, view it on GitHubhttps://github.com/briancmpbll/home_assistant_custom_envoy/issues/202#issuecomment-2304131620, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A4XI5JFTR3AT5POCXCEUJYDZSWRMLAVCNFSM6AAAAABMZ7X4RWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBUGEZTCNRSGA. You are receiving this because you commented.Message ID: @.***>
Another simple check you can do is to have a look in the file /config/.storage/core.config_entries. (Don't change the file while HA is running!) Look for Envoy
in there and validate username and password are correct. These are only used upon token expiration.
thanks again for your support, much appreciated. i was able to have a look now and indeed, the password in this file differs from the password i am currently using. so this may have triggered it. i change my password now and then...
what is your advise: stop HA and change the file?
Either edit the file or remove the Envoy and re-add it. When editing the file, first stop HA and make a copy of the original file before editing it. Since editing the token file worked fine, this one will probably be fine too. Only change the password part.
i stopped HA and changed the password section only and restarted HA< it did not work unfortunately.
so what i did is requested new token and changed the enjoy conf file with the new token and rebooted. it works now.
let see if this will make a change...
Hmm, not what I had hoped for. Fingers crossed, but wouldn't be surprised if it fails again.
so far so good, 24 hours later. . i also manually reloaded the integration just now to seeif it would stop working but it is still OK...
Nice, pleasant surprise. Not speculating yet on plausible reasons why ;-)
Today also still working. Let me monitor for week or so and let you know if still ok
Ok, good to hear it seems to be fine now.
still stable so i think we can close this issue. thanks a lot for the support! really great
Hi,
since 19-aug my integration stops working, reporting Authorisation failure "could not authenticate with enlighten, statuys 401"
i am suspicious that it is related to the new firmware 8.2.4264 that was pushed to my system recently. it is even not described on the enlighten firmware page, so perhaps very new
could this be the issue that the integration would not load?