briancmpbll / home_assistant_custom_envoy

171 stars 76 forks source link

Microinverters appear on wrong Envoy #198

Closed SteveJack34 closed 4 days ago

SteveJack34 commented 1 month ago

I have 2 Envoys each with 3 microinverters provisioned. One has IQ7s and the other has IQ8s. I have them setup in HA. When I do a restart on HA, I find all of the microinverters are suddenly assigned to only one of the Envoys. Consequently I dont get any readings from the ones that are wrongly assigned. If I reload the envoys in HA the microinverters all reappear on the correct Envoy. Prior to restart both Envoys have 7 entities. After restart one has 10 entities and the other has 4.

Anybody have any thoughts?

Steve

catsmanac commented 1 month ago

Hi @SteveJack34, what's the story on the whole? Was the envoy with the 3 iq7 first and the one with the iq8 later, where they added at the same time to HA? The 7th one sounds weird as you have 2x3. Where there other inverters in the past?

Can you share the diagnostic files for both Envoys?

Can you then enable debug on the Envoy integration, let it run for couple of minutes, restart HA. Let it run for few minutes and then reload both Envoys. Let it run again for a few minutes and then stop disable the debug again. Log file will download to your workstation. Then share it as well.

SteveJack34 commented 1 month ago

Hi Catsmanac The Envoy with the IQ7s was first. Didn't realise when we did the second set of Panels that you couldn't have a mix of IQ7s and IQ8s on the same Envoy. So cheapest option was to buy a second Envoy. Long term will probably swap out the IQ7s for IQ8s and get rid of the first envoy. Logs attached along with a couple of screenshots. Steve home-assistant_enphase_envoy_2024-06-06T07-09-06.338Z.log Enphase correct Enphase with issue

catsmanac commented 1 month ago

I see 10.1.6.123 and 10.6.1.126. Which is the IQ7 envoy and which the IQ8 envoy?

SteveJack34 commented 1 month ago

Hi Arie

10.1.6.126 is the IQ7

Steve

From: Arie Catsman @.> Sent: Thursday, June 6, 2024 9:38 AM To: briancmpbll/home_assistant_custom_envoy @.> Cc: SteveJack34 @.>; Mention @.> Subject: Re: [briancmpbll/home_assistant_custom_envoy] Microinverters appear on wrong Envoy (Issue #198)

I see 10.1.6.123 and 10.6.1.126. Which is the IQ7 envoy and which the IQ8 envoy?

— Reply to this email directly, view it on GitHub https://github.com/briancmpbll/home_assistant_custom_envoy/issues/198#issuecomment-2151722680 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A3TYEFOJCNNXWYLRWNNCC4LZGANWVAVCNFSM6AAAAABI3PNKBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJRG4ZDENRYGA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/A3TYEFL7EPVKA3QOQLJLYALZGANWVA5CNFSM6AAAAABI3PNKBSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUAICXLQ.gif Message ID: @. @.> >

catsmanac commented 1 month ago

Steve, it looks like the old envoy has somehow picked up the new panels. It's sending these in its data report with zero values. The new envoy reports these as well with values, but as the serial number is used as key it ignores them for the new envoy.

You may want to check the old envoy config (or have it checked) as I wouldn't be surprised they are in there.

024-06-06 08:08:03.049 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader]
Fetched (1 of 2) in 0.2 sec from https://10.1.6.126/api/v1/production/inverters: <Response [200 OK]>: [
  {
    "serialNumber": "482241023623",   <-- old panel
    "lastReportDate": 1717657462,
    "devType": 1,
    "lastReportWatts": 99,
    "maxReportWatts": 294
  },
  {
    "serialNumber": "482241023804",  <-- old panel
    "lastReportDate": 1717657013,
    "devType": 1,
    "lastReportWatts": 101,
    "maxReportWatts": 292
  },
  {
    "serialNumber": "482241028347",  <-- old panel
    "lastReportDate": 1717656803,
    "devType": 1,
    "lastReportWatts": 103,
    "maxReportWatts": 296
  },
  {
    "serialNumber": "512334001585",  <-- new panel
    "lastReportDate": 0,
    "devType": 1,
    "lastReportWatts": 0,
    "maxReportWatts": 0
  },
  {
    "serialNumber": "512332000673",  <-- new panel
    "lastReportDate": 0,
    "devType": 1,
    "lastReportWatts": 0,
    "maxReportWatts": 0
  },
  {
    "serialNumber": "512332000700",  <-- new panel
    "lastReportDate": 0,
    "devType": 1,
    "lastReportWatts": 0,
    "maxReportWatts": 0
  }
]

2024-06-06 08:08:06.059 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] 
Fetched (1 of 2) in 0.3 sec from https://10.1.6.123/api/v1/production/inverters: <Response [200 OK]>: [
  {
    "serialNumber": "512332000673",  <-- new panel
    "lastReportDate": 1717657320,
    "devType": 1,
    "lastReportWatts": 119,
    "maxReportWatts": 393
  },
  {
    "serialNumber": "512332000700",  <-- new panel
    "lastReportDate": 1717656362,
    "devType": 1,
    "lastReportWatts": 21,
    "maxReportWatts": 339
  },
  {
    "serialNumber": "512334001585",  <-- new panel
    "lastReportDate": 1717657321,
    "devType": 1,
    "lastReportWatts": 38,
    "maxReportWatts": 350
  }

2024-06-06 08:08:16.586 ERROR (MainThread) [homeassistant.components.sensor] 
Platform enphase_envoy does not generate unique IDs. ID 512332000673 already exists - ignoring sensor.envoy_122310039288_inverter_512332000673
2024-06-06 08:08:16.587 ERROR (MainThread) [homeassistant.components.sensor] 
Platform enphase_envoy does not generate unique IDs. ID 512332000700 already exists - ignoring sensor.envoy_122310039288_inverter_512332000700
2024-06-06 08:08:16.587 ERROR (MainThread) [homeassistant.components.sensor] 
Platform enphase_envoy does not generate unique IDs. ID 512334001585 already exists - ignoring sensor.envoy_122310039288_inverter_512334001585
SteveJack34 commented 1 month ago

We did originally provision the IQ8s on the original Envoy but hit the IQ7 and IQ8 mix issue. The new inverters where then de-provissioned and removed. Installer toolkit doesn’t show them in Envoy 1 now. I’ve also connected to the micoroinverter itself and that doesn’t show them either.

Suspect there is a ghost in the system.

Steve

From: Arie Catsman @.> Sent: Thursday, June 6, 2024 10:08 AM To: briancmpbll/home_assistant_custom_envoy @.> Cc: SteveJack34 @.>; Mention @.> Subject: Re: [briancmpbll/home_assistant_custom_envoy] Microinverters appear on wrong Envoy (Issue #198)

Steve, it looks like the old envoy has somehow picked up the new panels. It's sending these in its data report with zero values. The new envoy reports these as well with values, but as the serial number is used as key it ignores them for the new envoy.

You may want to check the old envoy config (or have it checked) as I wouldn't be surprised they are in there.

024-06-06 08:08:03.049 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Fetched (1 of 2) in 0.2 sec from https://10.1.6.126/api/v1/production/inverters: <Response [200 OK]>: [ { "serialNumber": "482241023623", <-- old panel "lastReportDate": 1717657462, "devType": 1, "lastReportWatts": 99, "maxReportWatts": 294 }, { "serialNumber": "482241023804", <-- old panel "lastReportDate": 1717657013, "devType": 1, "lastReportWatts": 101, "maxReportWatts": 292 }, { "serialNumber": "482241028347", <-- old panel "lastReportDate": 1717656803, "devType": 1, "lastReportWatts": 103, "maxReportWatts": 296 }, { "serialNumber": "512334001585", <-- new panel "lastReportDate": 0, "devType": 1, "lastReportWatts": 0, "maxReportWatts": 0 }, { "serialNumber": "512332000673", <-- new panel "lastReportDate": 0, "devType": 1, "lastReportWatts": 0, "maxReportWatts": 0 }, { "serialNumber": "512332000700", <-- new panel "lastReportDate": 0, "devType": 1, "lastReportWatts": 0, "maxReportWatts": 0 } ]

2024-06-06 08:08:06.059 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Fetched (1 of 2) in 0.3 sec from https://10.1.6.123/api/v1/production/inverters: <Response [200 OK]>: [ { "serialNumber": "512332000673", <-- new panel "lastReportDate": 1717657320, "devType": 1, "lastReportWatts": 119, "maxReportWatts": 393 }, { "serialNumber": "512332000700", <-- new panel "lastReportDate": 1717656362, "devType": 1, "lastReportWatts": 21, "maxReportWatts": 339 }, { "serialNumber": "512334001585", <-- new panel "lastReportDate": 1717657321, "devType": 1, "lastReportWatts": 38, "maxReportWatts": 350 }

— Reply to this email directly, view it on GitHub https://github.com/briancmpbll/home_assistant_custom_envoy/issues/198#issuecomment-2151785864 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A3TYEFK7ISFJZLS2REK4TALZGARHNAVCNFSM6AAAAABI3PNKBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJRG44DKOBWGQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/A3TYEFJWO3QBJLYVYLX6YW3ZGARHNA5CNFSM6AAAAABI3PNKBSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUAIGSYQ.gif Message ID: @. @.> >

catsmanac commented 1 month ago

Sounds like an envoy power down / up has happened already then, which would have been my next thought.

The only handle to use to ignore these is

    "lastReportDate": 0,

and ignore these inverters when HA starts. Would be the first code to deal with envoy 'features', but if there a simple way of 'cleaning' the Envoy that would be first choice.

What are you getting when you browse to the envoy/production.json, something with inverter activecount in it:

{
  "production": [
    {
      "type": "inverters",
      "activeCount": 24,
      "readingTime": 1717668845,
      "wNow": 2731,
      "whLifetime": 967445
    }

And /inventory reports all panels labeled as pcu, wonder if and how the new panels show there.

  {
    "type": "PCU",
    "devices": [
      {
        "part_num": "800-01127-r02",
        "installed": "1675855804",
        "serial_num": "122219085275",
        "device_status": [
          "envoy.global.ok"
        ],
        "last_rpt_date": "1717668694",
        "admin_state": 1,
        "dev_type": 1,
        "created_date": "1675855804",
        "img_load_date": "1613405094",
        "img_pnum_running": "520-00082-r01-v04.27.04",
        "ptpn": "540-00169-r01-v04.27.09",
        "chaneid": 1627390225,
        "device_control": [
          {
            "gficlearset": false
          }
        ],
        "producing": true,
        "communicating": true,
        "provisioned": true,
        "operating": true
      },
SteveJack34 commented 1 month ago

Activecount is showing 6 and inventory shows all 6 panels.

Steve

From: Arie Catsman @.> Sent: Thursday, June 6, 2024 11:28 AM To: briancmpbll/home_assistant_custom_envoy @.> Cc: SteveJack34 @.>; Mention @.> Subject: Re: [briancmpbll/home_assistant_custom_envoy] Microinverters appear on wrong Envoy (Issue #198)

Sounds like an envoy power down / up has happened already then, which would have been my next thought.

The only handle to use to ignore these is

"lastReportDate": 0,

and ignore these inverters when HA starts. Would be the first code to deal with envoy 'features', but if there a simple way of 'cleaning' the Envoy that would be first choice.

What are you getting when you browse to the envoy/production.json, something with inverter activecount in it:

{ "production": [ { "type": "inverters", "activeCount": 24, "readingTime": 1717668845, "wNow": 2731, "whLifetime": 967445 }

And /inventory reports all panels labeled as pcu, wonder if and how the new panels show there.

{ "type": "PCU", "devices": [ { "part_num": "800-01127-r02", "installed": "1675855804", "serial_num": "122219085275", "device_status": [ "envoy.global.ok" ], "last_rpt_date": "1717668694", "admin_state": 1, "dev_type": 1, "created_date": "1675855804", "img_load_date": "1613405094", "img_pnum_running": "520-00082-r01-v04.27.04", "ptpn": "540-00169-r01-v04.27.09", "chaneid": 1627390225, "device_control": [ { "gficlearset": false } ], "producing": true, "communicating": true, "provisioned": true, "operating": true },

— Reply to this email directly, view it on GitHub https://github.com/briancmpbll/home_assistant_custom_envoy/issues/198#issuecomment-2151937774 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A3TYEFIOOGJSHWJ2BCBNSKDZGA2SJAVCNFSM6AAAAABI3PNKBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJRHEZTONZXGQ . You are receiving this because you were mentioned. https://github.com/notifications/beacon/A3TYEFI6QNXBHHBWVC3HNHDZGA2SJA5CNFSM6AAAAABI3PNKBSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUAIP3O4.gif Message ID: @. @.> >

catsmanac commented 1 month ago

Definitely something ghostly in there.

Let me get you a hack to see if ignoring last report time 0 solves the issue. Be back in a while.

catsmanac commented 1 month ago

Unzip below zip, it will provide envoy_reader.py. To test it, copy the envoy_reader.py to /config/custom_components/enphase_envoy folder after first saving the original envoy_reader.py in there.

envoy_reader.zip

Then restart HA. This should ignore the inverters with 0 last report time. A debug log would show something like

2024-06-06 14:20:43.161 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] 
Ignoring Inverter 122334400007, its reporting zero last reported time

To undo the change copy the saved original one back in /config/custom_components/enphase_envoy and restart HA again.

SteveJack34 commented 1 month ago

Hi Arie

That all appears to be working thanks.

Steve

2024-06-06 13:40:59.786 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Ignoring Inverter 512334001585, its reporting zero last reported time

2024-06-06 13:40:59.786 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Ignoring Inverter 512332000673, its reporting zero last reported time

2024-06-06 13:40:59.786 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Ignoring Inverter 512332000700, its reporting zero last reported time

From: Arie Catsman @.> Sent: Thursday, June 6, 2024 1:31 PM To: briancmpbll/home_assistant_custom_envoy @.> Cc: SteveJack34 @.>; Mention @.> Subject: Re: [briancmpbll/home_assistant_custom_envoy] Microinverters appear on wrong Envoy (Issue #198)

Unzip below zip, it will provide envoy_reader.py. To test it, copy the envoy_reader.py to /config/custom_components/enphase_envoy folder after first saving the original envoy_reader.py in there.

envoy_reader.zip https://github.com/user-attachments/files/15618233/envoy_reader.zip

Then restart HA. This should ignore the inverters with 0 last report time. A debug log would show something like

2024-06-06 14:20:43.161 DEBUG (MainThread) [custom_components.enphase_envoy.envoy_reader] Ignoring Inverter 122334400007, its reporting zero last reported time

To undo the change copy the saved original one back in /config/custom_components/enphase_envoy and restart HA again.

— Reply to this email directly, view it on GitHub https://github.com/briancmpbll/home_assistant_custom_envoy/issues/198#issuecomment-2152288767 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A3TYEFPR26PDUCJTQA3CBOTZGBI7VAVCNFSM6AAAAABI3PNKBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNJSGI4DQNZWG4 . You are receiving this because you were mentioned. https://github.com/notifications/beacon/A3TYEFKHLCHDHTSZNLGQS6DZGBI7VA5CNFSM6AAAAABI3PNKBSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUAJFI76.gif Message ID: @. @.> >