Energy dashboard - Grid Export

Hi there!

Sorry, if I missed this somewhere, but I was parsing community for such topics for a couple of days and didn’t face with the similar case.
My Grid export is higher, that Produced Energy :smile:

Grid Consumption is calculated using template based on three consumption entities:
Grid Consumption Energy – 2.253kWh

{{ ( states('sensor.pump_tank_consumption_day') | float | round(3)) +
   ( states('sensor.hot_water_pump_consumption_day') | float | round(3)) +
   ( states('sensor.pump_heating_consumption_day') | float | round(3))}}

Grid Export is calculated in the same way:
Grid Export – 8.937 kWh

{{ ( states('sensor.solar_total_current_day_energy') | float | round(3)) -
   ( states('sensor.pump_tank_consumption_day') | float | round(3)) -
   ( states('sensor.hot_water_pump_consumption_day') | float | round(3)) -
   ( states('sensor.pump_heating_consumption_day') | float | round(3))}}

Solar accumulated energy for the current day
Solar Current Day Energy – 11.190 kWh

Energy dashboard settings:

And in the end :slight_smile:
In the Energy distribution diagram there’s
Net returned to grid - 16.41 kWh

No idea, where these 16.41 kWh come from…

Being a new user I couldn’t post more, than one embedded object, but I tried to put as much details, as I possible in the plain text :slight_smile:

Thanks for your help :slight_smile:

0 kWh Grid Consumption for now, but that’s ok.


If you calculate grid export, there are bound to be problems:

  • The way you do it, are you sure you count all consumption? In your case you do use the same sources for both templates, but measuring is always preferrable.
  • Sensors do not update at the same time. So when adding/subtracting, you are possibly using old and new measurements together. This is way worse for wattages then it is for dayly usage though.
  • But most important: Your grid consumption is not right. You list home consumption instead of grid consumption. You consume 0 from grid if all comsumption comes from solar.

Also note that if you have more than one phase coming into your home, you might import on one and export on the other at the same time. So - use actual measurements as much as you can.

Well, regarding new and old figures, this sounds indeed reasonable… That’s where such discrepancies could come from, you’re right…
As for the consumption, of course, this is not the whole house. I’ve just started to use this feature and there’s just a couple of devices for now, which reports energy consumption :slight_smile:
Thank you! This sensors update frequency could influence the calculation :slight_smile:

But you missed number three: the most important one! Installations measure what comes from the grid, but fail to see the solar production that goes straight into the devices. The energy dashboard calculates home use from grid import/export and solar. But you have (an estimate of) home use, not grid import. Putting that in place if grid import will give wrong calculations. So if you have an energy meter, see how you can get readings from that.

Lets put it differently. Your grid export can now be either positive or negative. That is also not right. If it is positive now you are exporting, if it is negative you are importing. So you can use calculations, but then you need to change both templates, one that isolates the positive bits and one that isolates the negative bits. Those are your grid import- and export.

I believe the dashboard is made in a way that you can also just use the reversed second template as import, and not specify export, but I’m not totally sure.

Yes, could be, but still this doesn’t explain to me, why Grid Export has one value, if checked via Settings --Devices–Entities, and completely another on the energy dashboard. On the same time.

PS I tried to remove export from settings btw. Then the diagram forwards everything to the house directly, without reverse connection to Grid

If you remove grid export, you still have wrong values. Reverse your export sensor (use minus solar), and put it for import. Leave export empty. If you do it right, house displays the same value as your first sensor.

All my input consumption figures are taken from one heat pump, just as a test. The only solar production figure is from panels app.

I believe, energy dashboard transforms somehow in the background by its logic grid export value before showing on the page.

Maybe it expects energy (Wh), but shows power (W) or vice versa.

Anyway, while I don’t have smart meeting device for the whole house, this energy dashboard is useless for me :slight_smile:

The graph does not show anything useful because the numbers for grid import, grid export and solar production that you are feeding don’t make sense together. If you feed it with numbers that are sensible, like I tried to describe above, the dashboard won’t need to be creative with power that seems to be going nowhere. My grid export shows exactly what I put in.

There’s a nice post about the needed calculations here.It is for Envoy, but it can be applies to other inverters too: