fsaris / home-assistant-zonneplan-one

Unofficial Zonneplan integration for Home Assistant
https://github.com/fsaris/home-assistant-zonneplan-one
MIT License
104 stars 17 forks source link

Only one of two PV installation shown (both present on one address) #99

Closed kuuf1986 closed 5 months ago

kuuf1986 commented 6 months ago

hi,

I have 2 separate Zonneplan PV installations. One with 15 panels (installed in 2021) and one with 18 panels (installed in 2024). The integration only shows one of the installations. Some sensors are duplicated ('Zonneplan last measured value' / 'Zonneplan yield total') but the given values belong only to the first installation of 2021. The sensor Zonneplan yield today shows the combined value of both PV installations.

image

Debug log; The log shows both installations and unique 'last_measured_power_value' numbers.

[{'uuid': '', 'label': 'PV Installatie', 'type': 'pv_installation', 'start_date': '2021-06-24T22:00:00.000000Z', 'end_date': '2031-06-24T22:00:00.000000Z', 'meta': {'identifier': 'Identifier of installation 1', 'name': 'Zonneplan One omvormer', 'panel_count': 15, 'panel_type': None, 'installation_wp': 5550, 'panel_wp': 370, 'first_measured_at': '2021-06-24T18:31:23.000000Z', 'last_measured_at': '2024-03-06T08:55:23.000000Z', 'last_measured_power_value': 2281, 'grid_stabilization_active': False, 'total_power_measured': 13074780, 'network': {'name': 'Onbekend', 'color': 'unknown', 'status': 'Onbekend'}, 'sgn_serial_number': '', 'module_firmware_version': 'v3.0.10', 'inverter_firmware_version': 'v3.036', 'show_in_contract_screen': False, 'enable_pv_analysis': False}}, {'uuid': '', 'label': 'PV Installatie', 'type': 'pv_installation', 'start_date': None, 'end_date': None, 'meta': {'identifier': 'Identifier of installation 2', 'name': 'Zonneplan One omvormer', 'panel_count': 18, 'panel_type': None, 'installation_wp': 7920, 'panel_wp': 440, 'first_measured_at': '2024-03-05T15:10:09.000000Z', 'last_measured_at': '2024-03-06T08:55:00.000000Z', 'last_measured_power_value': 2819, 'grid_stabilization_active': False, 'total_power_measured': 5900, 'network': {'name': 'Vodafone', 'color': 'poor', 'status': 'Slecht'}, 'sgn_serial_number': '', 'module_firmware_version': '1.2.1r', 'inverter_firmware_version': '3063', 'show_in_contract_screen': False, 'enable_pv_analysis': False}}], 'features': [], 'buttons': []}]

I removed the integration from Homeassistant and deleted it from HACS. Installed again via HACS. Rebooted and installed the integration again but this didn't resolve my issue.

I hope you can help out!

Thanks in advance!

Best regards, Ruud

fsaris commented 6 months ago

Looks like 2 different installs. 1 with 15 panels and 1 with 18 panels.

Was your install changed from 15 to 18 panels?

kuuf1986 commented 6 months ago

I have two separate installations. So also two converters. 1 with 15 panels and 1 with 18 panels. Total 33 panels.

Verzonden vanaf Outlook voor Androidhttps://aka.ms/AAb9ysg


From: Frans Saris @.> Sent: Wednesday, March 6, 2024 8:04:03 PM To: fsaris/home-assistant-zonneplan-one @.> Cc: kuuf1986 @.>; Author @.> Subject: Re: [fsaris/home-assistant-zonneplan-one] Only one of two PV installation shown (both present on one address) (Issue #99)

Looks like 2 different installs. 1 with 15 panels and 1 with 18 panels.

Was your install changed from 15 to 18 panels?

— Reply to this email directly, view it on GitHubhttps://github.com/fsaris/home-assistant-zonneplan-one/issues/99#issuecomment-1981585202, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEMNOOI5FK4KU52OHRWJUZLYW5SCHAVCNFSM6AAAAABEIWCHFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBRGU4DKMRQGI. You are receiving this because you authored the thread.Message ID: @.***>

fsaris commented 6 months ago

Ah, sorry misread your first comment.

Need to investigate this further. This worked before but I suspect that the last changes broke this

LeonJansen commented 6 months ago

Hi @fsaris,

I don't know if it is any help, but i think the problem is in this part of the code:

  result[uuid]["live_data"] = live_data[0]

  # These params are not updated when only selecting data from before
  if not accounts and connection["live_data"]["measurements"]:
      new = connection["live_data"]["total"]
      last = connection["live_data"]["measurements"][-1]
      result[uuid]["pv_installation"][0]["meta"]["last_measured_at"] = last["measured_at"]
      result[uuid]["pv_installation"][0]["meta"]["last_measured_power_value"] = last["value"]
      _LOGGER.debug(
          "Update total power with: %d + (%d - %d)",
          result[uuid]["pv_installation"][0]["meta"]["total_power_measured"],
          new,
          old
      )
      connection["pv_installation"][0]["meta"]["total_power_measured"] += new - old

Looks like you only select the first pv_installation in the array if i'm correct?

fsaris commented 6 months ago

Can you provide some logs with debug data? That enables me to reproduce the situation in my test setup. You can send it to me for example using direct message on the forum https://community.home-assistant.io/u/minifranske/

fsaris commented 6 months ago

Are you able to view the statistics of each install separately in the Zonneplan app?

fsaris commented 6 months ago

Can you test version 2024.3.0b2

Each install gets its own device and the total yield is now part of a different device that holds all total values

kuuf1986 commented 6 months ago

Are you able to view the statistics of each install separately in the Zonneplan app?

per PV installation I can see the momentary delivered power and the total delivered power of the installation. the grahps only show thet combined power

kuuf1986 commented 6 months ago

I installed 2024.3.0b2 but don't see any difference. Only 1 device visible

image

image

(after update via hacs -> reboot -> deleted existing devices -> installed zonneplan integration)

fsaris commented 6 months ago

ah, sorry. tagged the wrong branch. Please try 2024.3.0b3

kuuf1986 commented 6 months ago

I get this now: Two devices: image

First one: image

Second one: image

The second one shows now two unique last measured values which match both installations so this is good. One remark; the device info mentions "Zonneplan One omvormer 18 panels door Zonneplan". While the sensors behind this device belong to both installations. So perhaps leave out the 18 panels in the name?

For the rest does this solve the issue I've initiated. I can read both installations now so that is already very nice! :) Thanks!

fsaris commented 6 months ago

Can you try to remove the integration and re-add it again? You should now have 3 devices.

  1. Zonneplan (totals)
  2. Zonneplan pv 1
  3. Zonneplan pv 2

Currently your PV installs are still combined

When that doesn't resolve the issue can you provide a dump of your logs with debug enabled for Zonneplan?

kuuf1986 commented 6 months ago

Reinstall did indeed create three devices, exactly as you indicated. Seems to work just fine now! Thanks!

fsaris commented 5 months ago

Fix is released with 2024.3.0