Energy dashboard calculation looks wrong?

Hi

I have three ‘return to grid’ entities setup in for my energy dashboard. All are set up identically, at a static rate of 0.1725 NZD/kWh:

The kWh export values look correct, however the calculated dollar amount is incorrect… any ideas what to look at here?

The tariff will be active from the moment you set it, so older energy use will not have the right amount. Tomorrow things will look better.

It has been setup like this for the last 18 months (why did it take me so long to notice this!)… so unfortunately, I don’t think it will be correct tomorrow… (actually, when I first set this up, it may have been a different figure I used - so this may well help explain part of the issue - however, clearly my newer value has never populated through…).

Any ideas how to force this to happen?

Dit you fix statistics errors in export? There are cost sensors too, if you didn’t fix those at the same time, you’d get a difference too. Those sensors have similar entity ids, ending with _cost, maybe you should check them for outliers.

I have not ‘fixed any sensor error in export’… I am not quite sure what you mean by this?

I have just looked back over a few days, and the cost calculations are different each day (I have not made any config changes here at all)

image

There’s a statistics tab in developer tools where you can correct wrong values in the long term statistics that you see in the energy dashboard.

It seems odd that the unit is NZD in the price and NZ$ in the result, but that may have nothing to do with it. I’m Dutch, so the units are different.

I have not corrected any values in the statistics tab…

Maybe I should try a different currency, and see if it calculates correctly?

I don’t think that is it, I just noticed.

I think my firs change / test will be to create a fixed rate entity and change to use this value for the calculation - and see what happens tomorrow…

But really, it should be straightforward… so not sure how to debug this :slight_smile:

Seems like export has a name with Wh and price for kWh. That should lead to a factor 1000 difference. But is the unit of the export sensors maybe something else, leading it to use some conversion factor?

Sees like that should be ok
The grid sensor can be kWh or Wh…

image

But the static rate has fixed units (well, at least fixed here)…

image

the name shows Wh but that does not really say anything. You should look at the unit_of_measurement in the developer tools. I have no clue what happens if it is J.

Some other thought: is the export ever going up and down? It shouldn’t, if it does the cost might only count the part that moves in the right direction.

I think it looks ok in developer tools…

And it only increases (does not go up and down)

image

It does reset to 0. That is ok, as long as it has state_class total_increasing, and not total. If so, the drop might be considered as a negative instead of reset.

Do you think I should create a template sensor, and add state_class: total_increasing? Currently it is state_class: total

(from memory this comes from my IotaWatt directly, so am not sure if I can edit the state class…)

Hummm… after changing the set rates, then changing back, all now calculating correctly for a few hours today…

But now the calcs are again incorrect - very wierd!