home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.13k stars 29.8k forks source link

Enphase envoy looses connection #122737

Open moritzgoebel15 opened 1 month ago

moritzgoebel15 commented 1 month ago

The problem

The envoy integration looses the connection and shows temporarily no data. I have already disconnected the WiFi and I am only using Ethernet. Here is the protocol

What version of Home Assistant Core has the issue?

System Information version | core-2024.6.4 -- | -- installation_type | Home Assistant Container dev | false hassio | false docker | true user | root virtualenv | false python_version | 3.12.2 os_name | Linux os_version | 4.4.302+ arch | x86_64 timezone | Europe/Berlin config_dir | /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1386 Downloaded Repositories | 41
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | 24. August 2024 um 02:00 relayer_connected | true relayer_region | eu-central-1 remote_enabled | true remote_connected | true alexa_enabled | true google_enabled | true remote_server | eu-central-1-14.ui.nabu.casa certificate_status | ready instance_id | 0dfb6dc6f08c402695be42a8fd0742ae can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 2 -- | -- resources | 32 views | 12 mode | storage
Recorder oldest_recorder_run | 21. Juli 2024 um 18:31 -- | -- current_recorder_run | 22. Juli 2024 um 19:15 estimated_db_size | 3357.76 MiB database_engine | sqlite database_version | 3.44.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Enphase Envoy

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.components.enphase_envoy.coordinator
Quelle: helpers/update_coordinator.py:312
Integration: Enphase Envoy (Dokumentation, Probleme)
Erstmals aufgetreten: 22. Juli 2024 um 19:46:17 (390 Vorkommnisse)
Zuletzt protokolliert: 16:10:09

Unexpected error fetching Envoy 122329042310 data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/enphase_envoy/coordinator.py", line 147, in _async_update_data
    envoy_data = await envoy.update()
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyenphase/envoy.py", line 417, in update
    await updater.update(data)
  File "/usr/local/lib/python3.12/site-packages/pyenphase/updaters/api_v1_production.py", line 53, in update
    envoy_data.system_production = EnvoySystemProduction.from_v1_api(
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyenphase/models/system_production.py", line 34, in from_v1_api
    watt_hours_lifetime=data["wattHoursLifetime"],
                        ~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'wattHoursLifetime'

Additional information

No response

home-assistant[bot] commented 1 month ago

Hey there @bdraco, @cgarwood, @joostlek, @catsmanac, mind taking a look at this issue as it has been labeled with an integration (enphase_envoy) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `enphase_envoy` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign enphase_envoy` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


enphase_envoy documentation enphase_envoy source (message by IssueLinks)

catsmanac commented 1 month ago

Hi @moritzgoebel15, is this a new enphase installation and has the issue been there for ever, or was it running fine in the past and did the issue start recently? If the last is the case, any idea what triggered the change?

Can you upload the diagnostics file here? Clicking the Download Diagnostics will download it to your workstation. Then drag it in the afbeelding area below a new comment.

afbeelding

This seems to happen quite often looking at the numbers reported, 390 occurrences in 6 days. Can you enable debug on the Enphase integration and let it run for some time/hours so the debug can capture the issue with a bit more detail? Then disable the debug again and the log file will download to your workstation. Please upload it here as file as well as described above for the diagnostics file.

afbeelding

moritzgoebel15 commented 1 month ago

config_entry-enphase_envoy-888d98d94cb046fe679aa5ef545f8eee.json

moritzgoebel15 commented 1 month ago

@catsmanac Thanks for your response. I have uploaded the diagnostics. I installed it all anew in April and had these problems pretty much from the beginning on. Then I already shut down WIFI to only have one connection but it does not help unfortunately.

catsmanac commented 1 month ago

Hi @moritzgoebel15, the diagnostics file shows an Envoy-S Standard, non-metered I think, no CT. Same type as mine, only difference is that yours has a slightly newer firmware version (7.6.358 versus 7.6.175 in mine).

There is one item that is not what I would have expected. In the inverters section of the diagnostic report I see 16 inverters with last update times ranging from 2024-07-30 21:23:53 (1722367433) to 2024-07-30 21:25:23 (1722367523). HA reports these as last update at 2024-07-30 21:33:08. But all the inverters have the maxReportWatts with a value of zero. I would expect a value there which is the maximum ever reported watts for the inverter. maxReportWatts is not used by Home Assistant but I would expect a non-zero value there. LastReportWatts is expected to be zero at this time of the day and should go up when the panels are producing.

        {
          "serialNumber": "482328019086",
          "lastReportDate": 1722367433,
          "devType": 1,
          "lastReportWatts": 0,
          "maxReportWatts": 0
        },

If this is related to your problem is hard to tell. It could suggest something is not functioning as it should, but it can also be this firmware version is just not setting that value.

As for the communication outages, are you using the default 60 seconds intervals or did you configure custom triggers to collect data more often?

Have you tried cycling the Envoy (power down/up) to see if that resolves anything?

To see if there is any pattern in this I would need a logfile with Enphase debug enabled. Enable debug and let it run for 24 hours with debug enabled, end the debug again, log file will download, (zip it) and upload it here.

moritzgoebel15 commented 1 month ago

Thanks for the feedback! Here config_entry-enphase_envoy-888d98d94cb046fe679aa5ef545f8eee.json is a longer diagnostics file

catsmanac commented 1 month ago

THis one looks more as expected with maxReportWatts included.

        {
          "serialNumber": "482328019086",
          "lastReportDate": 1722616154,
          "devType": 1,
          "lastReportWatts": 33,
          "maxReportWatts": 54
        },

And it shows the unavailable state

            "state": {
              "entity_id": "sensor.inverter_482328019086",
              "state": "unavailable",
              "attributes": {
                "state_class": "measurement",
                "unit_of_measurement": "W",
                "device_class": "power",
                "icon": "mdi:flash",
                "friendly_name": "Inverter 482328019086"
              },
              "last_changed": "2024-08-02T16:35:53.725368+00:00",
              "last_reported": "2024-08-02T16:35:53.725368+00:00",
              "last_updated": "2024-08-02T16:35:53.725368+00:00"

What I meant to ask is a debug run as well.

catsmanac commented 1 month ago

What I meant to ask is a debug run. Enable debug by clicking the button on the Integration, let it run long enough to catch some issues and then click it again. It will download the log file for you then.

afbeelding

moritzgoebel15 commented 1 month ago

Thanks - I think I ran debug only on the device and not the entire integration. It is running now and I will upload tomorrow.

moritzgoebel15 commented 1 month ago

@catsmanac here is the longer debug file config_entry-enphase_envoy-888d98d94cb046fe679aa5ef545f8eee 2.json

catsmanac commented 1 month ago

Thanks @moritzgoebel15, what you uploaded is the diagnostic file, not the debug log file. With debug enabled as shown above you see the button change to disable debug logging.

afbeelding

At the end of the debugging period click the button to disable it again. Then the debug log file will download to your workstation named something like home-assistant_enphase_envoy_2024-08-06T07-39-41.699Z.log

afbeelding

moritzgoebel15 commented 1 month ago

Sorry for the misunderstanding - I was looking in the wrong place and now I understand the difference :). Please find attached @catsmanac Archiv.zip

catsmanac commented 1 month ago

Thanks @moritzgoebel15. Looking at the log there seems some kind of pattern.

An outage mostly starts with one of the KeyError: 'wattHoursLifetime' error. These are caused by the Envoy not returning anything and some time-out occurring. (A newer HA version will report this as a timeout rather as this error). But it also means the Envoy could be connected, but some internal program over there never replied.

Then on many occasions the next error is a httpcore.ConnectError: All connection attempts failed. This error indicates HA could not even connect to the Envoy.

Then one or more KeyError: 'wattHoursLifetime' again (Envoy could be connected, but internal program is not replying).

After this pattern all works fine till next occurrence.

One would almost think the Envoy is restarting although I have no direct proof for that.

It always seems to start with an error 502 when requesting admin/lib/tariff. Almost as if requesting for this page every now and then crashes the Envoy. Again no hard proof but it's a strange pattern. Need to digest this a bit...

Here's a typical example, no need to read in detail, just for future reference.

2024-07-28 14:40:32.633 DEBUG (MainThread) [homeassistant.components.enphase_envoy.coordinator] Finished fetching Envoy 122329042310 data in 0.553 seconds (success: True)

2024-07-28 14:41:33.081 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:41:33.252 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/api/v1/production status 200: application/json b'{\n  "wattHoursToday": 14572,\n  "wattHoursSevenDays": 95120,\n  "wattHoursLifetime": 1410739,\n  "wattsNow": 4368\n}\n'
2024-07-28 14:41:33.253 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production/inverters with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:41:33.268 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/api/v1/production/inverters status 200: application/json b'[\n  {\n    "serialNumber": "482328019086",\n    "lastReportDate": 1722176821,\n    "devType": 1,\n    "lastReportWatts": 235,\n    "maxReportWatts": 251\n  },\n  {\n    "serialNumber": "482328031752",\n    "lastReportDate": 1722176822,\n    "devType": 1,\n    "lastReportWatts": 235,\n    "maxReportWatts": 271\n  },\n  {\n    "serialNumber": "482328031397",\n    "lastReportDate": 1722176823,\n    "devType": 1,\n    "lastReportWatts": 231,\n    "maxReportWatts": 268\n  },\n  {\n    "serialNumber": "482329077762",\n    "lastReportDate": 1722176851,\n    "devType": 1,\n    "lastReportWatts": 311,\n    "maxReportWatts": 316\n  },\n  {\n    "serialNumber": "482329078582",\n    "lastReportDate": 1722176852,\n    "devType": 1,\n    "lastReportWatts": 310,\n    "maxReportWatts": 321\n  },\n  {\n    "serialNumber": "482328031596",\n    "lastReportDate": 1722176852,\n    "devType": 1,\n    "lastReportWatts": 311,\n    "maxReportWatts": 321\n  },\n  {\n    "serialNumber": "482329077883",\n    "lastReportDate": 1722176881,\n    "devType": 1,\n    "lastReportWatts": 228,\n    "maxReportWatts": 238\n  },\n  {\n    "serialNumber": "482329078317",\n    "lastReportDate": 1722176882,\n    "devType": 1,\n    "lastReportWatts": 225,\n    "maxReportWatts": 239\n  },\n  {\n    "serialNumber": "482329077879",\n    "lastReportDate": 1722176882,\n    "devType": 1,\n    "lastReportWatts": 225,\n    "maxReportWatts": 239\n  },\n  {\n    "serialNumber": "482329078383",\n    "lastReportDate": 1722176883,\n    "devType": 1,\n    "lastReportWatts": 312,\n    "maxReportWatts": 319\n  },\n  {\n    "serialNumber": "482329078199",\n    "lastReportDate": 1722176884,\n    "devType": 1,\n    "lastReportWatts": 311,\n    "maxReportWatts": 318\n  },\n  {\n    "serialNumber": "482329078270",\n    "lastReportDate": 1722176885,\n    "devType": 1,\n    "lastReportWatts": 310,\n    "maxReportWatts": 317\n  },\n  {\n    "serialNumber": "482329078366",\n    "lastReportDate": 1722176886,\n    "devType": 1,\n    "lastReportWatts": 233,\n    "maxReportWatts": 254\n  },\n  {\n    "serialNumber": "482329077886",\n    "lastReportDate": 1722176887,\n    "devType": 1,\n    "lastReportWatts": 233,\n    "maxReportWatts": 253\n  },\n  {\n    "serialNumber": "482329074060",\n    "lastReportDate": 1722176888,\n    "devType": 1,\n    "lastReportWatts": 327,\n    "maxReportWatts": 337\n  },\n  {\n    "serialNumber": "482329073940",\n    "lastReportDate": 1722176889,\n    "devType": 1,\n    "lastReportWatts": 331,\n    "maxReportWatts": 340\n  }\n]\n'
2024-07-28 14:41:33.269 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/admin/lib/tariff with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:42:19.348 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/admin/lib/tariff with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:42:57.974 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/admin/lib/tariff status 502: text/html b'<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n<hr><center>openresty/1.17.8.1</center>\r\n</body>\r\n</html>\r\n'
2024-07-28 14:42:57.974 DEBUG (MainThread) [pyenphase.json] Unable to decode response from Envoy endpoint /admin/lib/tariff: unexpected character: line 1 column 1 (char 0)

2024-07-28 14:42:57.974 ERROR (MainThread) [homeassistant.components.enphase_envoy.coordinator] Unexpected error fetching Envoy 122329042310 data
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)
2024-07-28 14:42:57.980 DEBUG (MainThread) [homeassistant.components.enphase_envoy.coordinator] Finished fetching Envoy 122329042310 data in 84.899 seconds (success: False)

2024-07-28 14:43:58.081 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:44:06.614 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:44:08.117 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:44:09.284 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:44:09.286 ERROR (MainThread) [homeassistant.components.enphase_envoy.coordinator] Unexpected error fetching Envoy 122329042310 data
httpcore.ConnectError: All connection attempts failed
httpx.ConnectError: All connection attempts failed
2024-07-28 14:44:09.295 DEBUG (MainThread) [homeassistant.components.enphase_envoy.coordinator] Finished fetching Envoy 122329042310 data in 11.214 seconds (success: False)

2024-07-28 14:45:09.081 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:45:09.601 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/api/v1/production status 503: application/json b'{\n  "status": 503,\n  "error": "",\n  "info": "Resource busy, please retry after 30 seconds",\n  "moreInfo": ""\n}\n'
2024-07-28 14:45:09.601 ERROR (MainThread) [homeassistant.components.enphase_envoy.coordinator] Unexpected error fetching Envoy 122329042310 data
KeyError: 'wattHoursLifetime'

2024-07-28 14:45:09.603 DEBUG (MainThread) [homeassistant.components.enphase_envoy.coordinator] Finished fetching Envoy 122329042310 data in 0.522 seconds (success: False)
2024-07-28 14:46:10.081 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:46:10.299 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/api/v1/production status 503: application/json b'{\n  "status": 503,\n  "error": "",\n  "info": "Resource busy, please retry after 30 seconds",\n  "moreInfo": ""\n}\n'
2024-07-28 14:46:10.300 ERROR (MainThread) [homeassistant.components.enphase_envoy.coordinator] Unexpected error fetching Envoy 122329042310 data
KeyError: 'wattHoursLifetime'
2024-07-28 14:46:10.301 DEBUG (MainThread) [homeassistant.components.enphase_envoy.coordinator] Finished fetching Envoy 122329042310 data in 0.220 seconds (success: False)

2024-07-28 14:47:10.081 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:47:10.264 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/api/v1/production status 200: application/json b'{\n  "wattHoursToday": 14572,\n  "wattHoursSevenDays": 95120,\n  "wattHoursLifetime": 1410739,\n  "wattsNow": 4368\n}\n'
2024-07-28 14:47:10.264 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/api/v1/production/inverters with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:47:10.284 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/api/v1/production/inverters status 200: application/json b'[\n  {\n    "serialNumber": "482328019086",\n    "lastReportDate": 1722176821,\n    "devType": 1,\n    "lastReportWatts": 235,\n    "maxReportWatts": 235\n  },\n  {\n    "serialNumber": "482328031752",\n    "lastReportDate": 1722176822,\n    "devType": 1,\n    "lastReportWatts": 235,\n    "maxReportWatts": 235\n  },\n  {\n    "serialNumber": "482328031397",\n    "lastReportDate": 1722176823,\n    "devType": 1,\n    "lastReportWatts": 231,\n    "maxReportWatts": 231\n  },\n  {\n    "serialNumber": "482329077762",\n    "lastReportDate": 1722176851,\n    "devType": 1,\n    "lastReportWatts": 311,\n    "maxReportWatts": 311\n  },\n  {\n    "serialNumber": "482329078582",\n    "lastReportDate": 1722176852,\n    "devType": 1,\n    "lastReportWatts": 310,\n    "maxReportWatts": 310\n  },\n  {\n    "serialNumber": "482328031596",\n    "lastReportDate": 1722176852,\n    "devType": 1,\n    "lastReportWatts": 311,\n    "maxReportWatts": 311\n  },\n  {\n    "serialNumber": "482329077883",\n    "lastReportDate": 1722176881,\n    "devType": 1,\n    "lastReportWatts": 228,\n    "maxReportWatts": 228\n  },\n  {\n    "serialNumber": "482329078317",\n    "lastReportDate": 1722176882,\n    "devType": 1,\n    "lastReportWatts": 225,\n    "maxReportWatts": 225\n  },\n  {\n    "serialNumber": "482329077879",\n    "lastReportDate": 1722176882,\n    "devType": 1,\n    "lastReportWatts": 225,\n    "maxReportWatts": 225\n  },\n  {\n    "serialNumber": "482329078383",\n    "lastReportDate": 1722176883,\n    "devType": 1,\n    "lastReportWatts": 312,\n    "maxReportWatts": 312\n  },\n  {\n    "serialNumber": "482329078199",\n    "lastReportDate": 1722176884,\n    "devType": 1,\n    "lastReportWatts": 311,\n    "maxReportWatts": 311\n  },\n  {\n    "serialNumber": "482329078270",\n    "lastReportDate": 1722176885,\n    "devType": 1,\n    "lastReportWatts": 310,\n    "maxReportWatts": 310\n  },\n  {\n    "serialNumber": "482329078366",\n    "lastReportDate": 1722176886,\n    "devType": 1,\n    "lastReportWatts": 233,\n    "maxReportWatts": 233\n  },\n  {\n    "serialNumber": "482329077886",\n    "lastReportDate": 1722176887,\n    "devType": 1,\n    "lastReportWatts": 233,\n    "maxReportWatts": 233\n  },\n  {\n    "serialNumber": "482329074060",\n    "lastReportDate": 1722176888,\n    "devType": 1,\n    "lastReportWatts": 327,\n    "maxReportWatts": 327\n  },\n  {\n    "serialNumber": "482329073940",\n    "lastReportDate": 1722176889,\n    "devType": 1,\n    "lastReportWatts": 331,\n    "maxReportWatts": 331\n  }\n]\n'
2024-07-28 14:47:10.284 DEBUG (MainThread) [pyenphase.envoy] Requesting https://192.168.1.162/admin/lib/tariff with timeout Timeout(connect=10.0, read=45.0, write=10.0, pool=10.0)
2024-07-28 14:47:11.523 DEBUG (MainThread) [pyenphase.envoy] Request reply from https://192.168.1.162/admin/lib/tariff status 200: application/json b'{"tariff":{"currency":{"code":"EUR"},"logger":"mylogger","date":"1718307561","storage_settings":{"mode":"self-consumption","operation_mode_sub_type":"","reserved_soc":0.0,"very_low_soc":5,"charge_from_grid":false,"date":"1718307561"},"single_rate":{"rate":0.32,"sell":0.08},"seasons":[],"seasons_sell":[]},"schedule":{"source":"Tariff","date":"2024-07-25 19:17:50 UTC","version":"00.00.02","reserved_soc":0.0,"operation_mode_sub_type":"","very_low_soc":5,"charge_from_grid":false,"battery_mode":"self-consumption","schedule":{"Disable":[{"Sun":[{"start":0,"duration":1440,"setting":"ID"}]},{"Mon":[{"start":0,"duration":1440,"setting":"ID"}]},{"Tue":[{"start":0,"duration":1440,"setting":"ID"}]},{"Wed":[{"start":0,"duration":1440,"setting":"ID"}]},{"Thu":[{"start":0,"duration":1440,"setting":"ID"}]},{"Fri":[{"start":0,"duration":1440,"setting":"ID"}]},{"Sat":[{"start":0,"duration":1440,"setting":"ID"}]}],"tariff":[{"start":"1/1","end":"1/1","Sun":[{"start":0,"duration":1440,"setting":"ZN"}],"Mon":[{"start":0,"duration":1440,"setting":"ZN"}],"Tue":[{"start":0,"duration":1440,"setting":"ZN"}],"Wed":[{"start":0,"duration":1440,"setting":"ZN"}],"Thu":[{"start":0,"duration":1440,"setting":"ZN"}],"Fri":[{"start":0,"duration":1440,"setting":"ZN"}],"Sat":[{"start":0,"duration":1440,"setting":"ZN"}]}]},"override":false,"override_backup_soc":30.0,"override_chg_dischg_rate":0.0,"override_tou_mode":"StorageTouMode_DEFAULT_TOU_MODE"}}'
2024-07-28 14:47:11.524 DEBUG (MainThread) [homeassistant.components.enphase_envoy.coordinator] Envoy data: EnvoyData(encharge_inventory=None, encharge_power=None, encharge_aggregate=None, enpower=None, system_consumption=None, system_production=EnvoySystemProduction(watt_hours_lifetime=1410739, watt_hours_last_7_days=95120, watt_hours_today=14572, watts_now=4368), system_consumption_phases=None, system_production_phases=None, ctmeter_production=None, ctmeter_consumption=None, ctmeter_storage=None, ctmeter_production_phases=None, ctmeter_consumption_phases=None, ctmeter_storage_phases=None, dry_contact_status={}, dry_contact_settings={}, inverters={'482328019086': EnvoyInverter(serial_number='482328019086', last_report_date=1722176821, last_report_watts=235, max_report_watts=235), '482328031752': EnvoyInverter(serial_number='482328031752', last_report_date=1722176822, last_report_watts=235, max_report_watts=235), '482328031397': EnvoyInverter(serial_number='482328031397', last_report_date=1722176823, last_report_watts=231, max_report_watts=231), '482329077762': EnvoyInverter(serial_number='482329077762', last_report_date=1722176851, last_report_watts=311, max_report_watts=311), '482329078582': EnvoyInverter(serial_number='482329078582', last_report_date=1722176852, last_report_watts=310, max_report_watts=310), '482328031596': EnvoyInverter(serial_number='482328031596', last_report_date=1722176852, last_report_watts=311, max_report_watts=311), '482329077883': EnvoyInverter(serial_number='482329077883', last_report_date=1722176881, last_report_watts=228, max_report_watts=228), '482329078317': EnvoyInverter(serial_number='482329078317', last_report_date=1722176882, last_report_watts=225, max_report_watts=225), '482329077879': EnvoyInverter(serial_number='482329077879', last_report_date=1722176882, last_report_watts=225, max_report_watts=225), '482329078383': EnvoyInverter(serial_number='482329078383', last_report_date=1722176883, last_report_watts=312, max_report_watts=312), '482329078199': EnvoyInverter(serial_number='482329078199', last_report_date=1722176884, last_report_watts=311, max_report_watts=311), '482329078270': EnvoyInverter(serial_number='482329078270', last_report_date=1722176885, last_report_watts=310, max_report_watts=310), '482329078366': EnvoyInverter(serial_number='482329078366', last_report_date=1722176886, last_report_watts=233, max_report_watts=233), '482329077886': EnvoyInverter(serial_number='482329077886', last_report_date=1722176887, last_report_watts=233, max_report_watts=233), '482329074060': EnvoyInverter(serial_number='482329074060', last_report_date=1722176888, last_report_watts=327, max_report_watts=327), '482329073940': EnvoyInverter(serial_number='482329073940', last_report_date=1722176889, last_report_watts=331, max_report_watts=331)}, tariff=EnvoyTariff(currency={'code': 'EUR'}, logger='mylogger', date='1718307561', storage_settings=EnvoyStorageSettings(mode=<EnvoyStorageMode.SELF_CONSUMPTION: 'self-consumption'>, operation_mode_sub_type='', reserved_soc=0.0, very_low_soc=5, charge_from_grid=False, date='1718307561'), single_rate={'rate': 0.32, 'sell': 0.08}, seasons=[], seasons_sell=[]), raw={'/api/v1/production': {'wattHoursToday': 14572, 'wattHoursSevenDays': 95120, 'wattHoursLifetime': 1410739, 'wattsNow': 4368}, '/api/v1/production/inverters': [{'serialNumber': '482328019086', 'lastReportDate': 1722176821, 'devType': 1, 'lastReportWatts': 235, 'maxReportWatts': 235}, {'serialNumber': '482328031752', 'lastReportDate': 1722176822, 'devType': 1, 'lastReportWatts': 235, 'maxReportWatts': 235}, {'serialNumber': '482328031397', 'lastReportDate': 1722176823, 'devType': 1, 'lastReportWatts': 231, 'maxReportWatts': 231}, {'serialNumber': '482329077762', 'lastReportDate': 1722176851, 'devType': 1, 'lastReportWatts': 311, 'maxReportWatts': 311}, {'serialNumber': '482329078582', 'lastReportDate': 1722176852, 'devType': 1, 'lastReportWatts': 310, 'maxReportWatts': 310}, {'serialNumber': '482328031596', 'lastReportDate': 1722176852, 'devType': 1, 'lastReportWatts': 311, 'maxReportWatts': 311}, {'serialNumber': '482329077883', 'lastReportDate': 1722176881, 'devType': 1, 'lastReportWatts': 228, 'maxReportWatts': 228}, {'serialNumber': '482329078317', 'lastReportDate': 1722176882, 'devType': 1, 'lastReportWatts': 225, 'maxReportWatts': 225}, {'serialNumber': '482329077879', 'lastReportDate': 1722176882, 'devType': 1, 'lastReportWatts': 225, 'maxReportWatts': 225}, {'serialNumber': '482329078383', 'lastReportDate': 1722176883, 'devType': 1, 'lastReportWatts': 312, 'maxReportWatts': 312}, {'serialNumber': '482329078199', 'lastReportDate': 1722176884, 'devType': 1, 'lastReportWatts': 311, 'maxReportWatts': 311}, {'serialNumber': '482329078270', 'lastReportDate': 1722176885, 'devType': 1, 'lastReportWatts': 310, 'maxReportWatts': 310}, {'serialNumber': '482329078366', 'lastReportDate': 1722176886, 'devType': 1, 'lastReportWatts': 233, 'maxReportWatts': 233}, {'serialNumber': '482329077886', 'lastReportDate': 1722176887, 'devType': 1, 'lastReportWatts': 233, 'maxReportWatts': 233}, {'serialNumber': '482329074060', 'lastReportDate': 1722176888, 'devType': 1, 'lastReportWatts': 327, 'maxReportWatts': 327}, {'serialNumber': '482329073940', 'lastReportDate': 1722176889, 'devType': 1, 'lastReportWatts': 331, 'maxReportWatts': 331}], '/admin/lib/tariff': {'tariff': {'currency': {'code': 'EUR'}, 'logger': 'mylogger', 'date': '1718307561', 'storage_settings': {'mode': 'self-consumption', 'operation_mode_sub_type': '', 'reserved_soc': 0.0, 'very_low_soc': 5, 'charge_from_grid': False, 'date': '1718307561'}, 'single_rate': {'rate': 0.32, 'sell': 0.08}, 'seasons': [], 'seasons_sell': []}, 'schedule': {'source': 'Tariff', 'date': '2024-07-25 19:17:50 UTC', 'version': '00.00.02', 'reserved_soc': 0.0, 'operation_mode_sub_type': '', 'very_low_soc': 5, 'charge_from_grid': False, 'battery_mode': 'self-consumption', 'schedule': {'Disable': [{'Sun': [{'start': 0, 'duration': 1440, 'setting': 'ID'}]}, {'Mon': [{'start': 0, 'duration': 1440, 'setting': 'ID'}]}, {'Tue': [{'start': 0, 'duration': 1440, 'setting': 'ID'}]}, {'Wed': [{'start': 0, 'duration': 1440, 'setting': 'ID'}]}, {'Thu': [{'start': 0, 'duration': 1440, 'setting': 'ID'}]}, {'Fri': [{'start': 0, 'duration': 1440, 'setting': 'ID'}]}, {'Sat': [{'start': 0, 'duration': 1440, 'setting': 'ID'}]}], 'tariff': [{'start': '1/1', 'end': '1/1', 'Sun': [{'start': 0, 'duration': 1440, 'setting': 'ZN'}], 'Mon': [{'start': 0, 'duration': 1440, 'setting': 'ZN'}], 'Tue': [{'start': 0, 'duration': 1440, 'setting': 'ZN'}], 'Wed': [{'start': 0, 'duration': 1440, 'setting': 'ZN'}], 'Thu': [{'start': 0, 'duration': 1440, 'setting': 'ZN'}], 'Fri': [{'start': 0, 'duration': 1440, 'setting': 'ZN'}], 'Sat': [{'start': 0, 'duration': 1440, 'setting': 'ZN'}]}]}, 'override': False, 'override_backup_soc': 30.0, 'override_chg_dischg_rate': 0.0, 'override_tou_mode': 'StorageTouMode_DEFAULT_TOU_MODE'}}})
2024-07-28 14:47:11.524 INFO (MainThread) [homeassistant.components.enphase_envoy.coordinator] Fetching Envoy 122329042310 data recovered
catsmanac commented 1 month ago

Hi @moritzgoebel15, for now going by the theory that the Envoy Standard (not metered) crashes every now and then when the Tariff data is accessed.

To confirm if that is indeed the case I've created a custom integration that can be installed next to the standard core Enphase Envoy integration, it leaves the core one running as before. When configured it will (only) remove the Tariff data collector from the core Enphase envoy integration so the core integration will no longer collect the tariff data and only collect production and inverter data. The tariff data is not used in case of a Envoy Standard (not metered) but it is collected.

No obligation, only if you would like to try it:

Let me know if you have any questions.

catsmanac commented 4 days ago

Hi @moritzgoebel15, did you ever try the above option and if so did it solve anything? If it solves the issue we can look into adding it to the production versions.