Energy Dashboard logic: grid vs solar consumption confusion

Hi everyone,
I’m trying to understand the logic behind the Energy Dashboard, because I’m clearly missing something.

In the attached image you can see my setup:

  • Clamp 1 (P1) measures the total house consumption
  • Clamp 2 (P2) measures solar production
    (both from Shelly EM)

This is how I configured the Energy Dashboard:

  • Grid consumption → Riemann integral of P1
  • Return to grid → Riemann integral of
max(0, produced_power - absorbed_power)
  • Grid supply → sensor
max(0, absorbed_power - produced_power)

(by the way: why is this field required in W and not in Wh?)

  • Solar production → Riemann integral of P2

Up to this point, does this approach look correct to you?


Step 2 – the problem

As shown in the example image, “absorbed power” (P1) is displayed in blue and is added to “solar consumed”(orange) to calculate the total consumption of 0.59 kWh.

But this is not correct:
between 12:00 and 13:00, my house actually consumed 0.29 kWh in total.

So it looks like the Energy Dashboard is double-counting something.

Where am I going wrong?
What am I misunderstanding about the Energy Dashboard logic?

Thanks in advance to anyone willing to help :pray:


Move P1 to here:

Then:

Grid consumption power: positive P1 power or 0, e.g. max(0, P1_power)

Return to grid power: absolute value of negative P1 power or zero. e.g. min(0, P1_power)|abs

You can use template sensors to do this. See: How to split a sensor into positive and negative sensors

P2 is all you need for the solar power.

Then use the riemann sum on those sensors. Use method: left to reduce approximation errors.

Home assistant will calculate your house consumption from these sensors.

The energy dashboard can now support energy and power. You need Wh (or kWh) for energy. Power (W) is optional.

1 Like

Thank you for your feedback!
I’m following your suggestion.

I’ ll come back with the results.

1 Like

The Shelly EM has energy sensors so there is no need use the Riemann Sum. Not sure why you are doing this.

I used to use a Shelly EM. I found it to be within +/-10% of my energy provider’s information. Using an IoTaWatt instead has reduced this error to less than +2%.

I will verify using the integrated energy sensors of Shelly but, at the moment, I need to understand how the energy dashboard works.

As you can see, the solar orange line does not work; it seems that there is no flow from solar to home and this is wrong because, at the time of the screenshot, I was using approximately 70-80% of solar production.

I don’t understand why. What am I doing wrong?

That’s an energy graph for the last day. Not the power now.

It updates a bit past each hour.

1 Like

Thank you for your patience, really appreciate!
I will keep monitored the dashboard.

For IoTaWatt devices, Where I can buy them?
I see them website but the shop does not work well

They stopped production in the US due to the unfavourable business environment. There was talk of producing them in Canada: IoTaWatt Discussion - #102 by tom_l