Homewizard P1 phase utility meters not the same as total usage

Currently I’m wanting to build a sankey chart based on the usage and production of power per phase.

I use the Homewizard P1 meter for this and the local Goodwe integration, both have L1, L2 and L3 power sensors. From these sensors I’ve created Integration sensors which are included in Utility Meters. Three sets are created for each sensor with the Trapezional, Left and Right method in the Integration sensor.

When comparing the total import and export values from the P1 meter and the newly sensors, the closest to the real values are still 0,3 to 0,8 kWh off at the end of the day.

Anyone encountered such an issue (and came up with a solution) or is this how it is and should I accept the drift between te values?

Thank you!

Can you post some example data / calculations so we can better understand your situation?

Sure, first message was on my phone.

Template sensors to get import and export sensors

    - name: p1_meter_active_power_l1_export
      unit_of_measurement: W
      state_class: measurement
      device_class: power
      state: >-
        {% if (states('sensor.p1_meter_active_power_l1')|float(0)) < 0 %}
          {{ states('sensor.p1_meter_active_power_l1')|float(0)*-1 }}
        {% else %}
          0
        {% endif%}
    - name: p1_meter_active_power_l1_import
      unit_of_measurement: W
      state_class: measurement
      device_class: power
      state: >-
        {% if (states('sensor.p1_meter_active_power_l1')|float(0)) > 0 %}
          {{ states('sensor.p1_meter_active_power_l1')|float(0) }}
        {% else %}
          0
        {% endif%}

Template sensor for the solar part

    - name: on_grid_l1_power_custom
      unit_of_measurement: W
      state_class: measurement
      device_class: power
      state: >-
        {% set x = 'sensor.on_grid_l1_power' %}
        {% if states(x) == 'unavailable' %}
          0
        {% else %}
          {{states(x)}}
        {% endif %}

From this there are some Integration sensors

- platform: integration
  source: sensor.p1_meter_active_power_l1_export /export
  name: energy_export_l1
  unit_prefix: k
  round: 4
  method: trapezoidal / left / right

Then we have Utility Meters for all these sensors

energy_export_l1_daily:
  source: sensor.energy_export_l1
  cycle: daily

Picture below shows in the top the values from the totals of the P1 meter and Goodwe inverter. Direct usage is PV - Export. Bottom part of the picture is from the newly create sensors, for all these sensors the Left method is the most accurate.
image

Change that to:

method: left

It should give the least amount of error but it is still an approximation of an integral. The more updates / second your source sensor has the more accurate it will be.

I have increased the number of updates for the Solar Inverter to 1s. As far as I know I cannot change the update frequency of the Homewizard integration (@DCSBL am I correct?)

Semi correct. Changing update frequency is not a simple option but is certainly possible.

You have to disable “Enable polling for updates” in “System options” below, then create an automation that calls the homeassistant.update_entity service as often as you like.