How to sum up the total consumption correctly?

Hello ,

I’m afraid I didn’t fully understand the platform:integration including the Riemann sum and now I need help with the implementation of my project.
I would like to measure most of my energy consumption and display it in Home Assistant. But i g
For this I have done the following steps.

  1. measured or calculated all consumers by
    a) equipped them with a measuring socket
    b) measured them and simulate the consumption in a sensor, f.e.
sensor:
- platform: template
  sensors:
    current_power_network:
      friendly_name: "power (current): network devices"
      unit_of_measurement: "W"
      value_template: 12
  1. use platform:integration to convert current power (W) to energy (kWh):
sensor:
- platform:integration
  source: sensor.current_power_network
  name: energy_spent_network
  unit_prefix: k
  round: 3
  1. use utility_meter as electricity meter
utility_meter:
  monthly_energy_network:
    source: sensor.energy_spent_network
    cycle: monthly
  yearly_energy_network:
    source: sensor.energy_spent_network
    cycle: yearly

Now my problem:
I have big differences in total consumption depending on how I sum them. If I sum up the current power of all consumers and then use it in integration and utility_meter, I end up with a total consumption of 30 kWh.


But if I use all consumers individually in integration and utility_meter and then sum up the results, I get 43 kWh.

I assumed it didn’t matter when and how I sum everything, but I guess I was wrong. I probably didn’t understand the integration correctly. Can anyone find my error in thinking and explain it to me?

Put a space here:

sensor:
- platform: integration

Also the integration sensor is an approximation. Read the paragraph about the method option and try the left method. https://www.home-assistant.io/integrations/integration/#method

I can’t really think which summation method would be more accurate but I suspect only doing one integration will introduce less error.

1 Like