energy-flow-card-plus icon indicating copy to clipboard operation
energy-flow-card-plus copied to clipboard

[BUG] Home consumption incorrect calculation with battery exports

Open purcell-lab opened this issue 1 year ago • 5 comments

Describe the bug I have noticed there is an error in the calculations for Home consumption when battery exports > home consumption.

Take 1 July 2023 for example:

Home Consumption = Solar Total + Battery Total + Grid Total 13.2 kWh = 50.6 + 8.2 - 45.6

But the default energy dashboard shows Home as 43.1 kWh (which is also Battery Export Value, whenever battery export to grid > actual home consumption I get these errors).

The flixix energy-flow-card-plus shows 46 kWh, which is also incorrect but also different to values in the default energy card.

Screenshot 2023-08-08 17 32 24

To Reproduce

Locate a day with battery export to the grid > actual home consumption:

Display that day.

Expected behavior Expect that the Home consumption total is correctly displayed.

Screenshots I have noticed some days where the Home consumption is different between the default energy card:

image

image

The bulk of days the both cards calculate the same values:

image

image

Desktop (please complete the following information):

  • OS: ChromeOS
  • Browser Chrome
  • Version 115.0.5790.160 (Official Build) (64-bit)

Smartphone (please complete the following information):

  • Device: Android
  • Browser Chrome

Additional context This issues with the default card Home Consumption calculations are being discussed here: https://github.com/home-assistant/frontend/issues/13701#issuecomment-1669041508

Please make sure all of this applies and check the checkboxes, by writing "X" inside of them.

  • [X] I understand that this is a channel for reporting bugs, not a support forum (If you need help configuring the card, go to: Discussions).

  • [X] I have the latest version of the card installed.

  • [X] I have cleared my browser cache after installing, updating and configuring the card.

purcell-lab avatar Aug 08 '23 07:08 purcell-lab

Hey,

I just started tonise the plugin, I habe exactly the same issue.

The value shown as home consumption is just wrong when I compare it to the integrated version or directly on my E3DC.

I am using Energy Period Selector Plus.

Phoenix-DH avatar Sep 24 '23 16:09 Phoenix-DH

Happy to assist by unpacking the calculations if I can be pointed into the relevant location in the code.

purcell-lab avatar Jan 13 '24 15:01 purcell-lab

Happy to assist by unpacking the calculations if I can be pointed into the relevant location in the code.

You can find the relevant part if you look for the value totalHomeConsumption and check the calculations on the previous lines of code.

I have the same problem when battery imports from grid.

midadami avatar Jan 21 '24 18:01 midadami

Love generating energy from thin air: image Correct values are: image

midadami avatar Feb 12 '24 07:02 midadami

Same issue here, perhaps in a easier to understand scenario:

I have an off-grid setup with a generator and no solar. I charge my batteries once a week with the generator and run off them the rest of the time. The home calculation looks like this for today:

image

This is incorrect, the 3 kWh consumed by the batteries all came from the "grid" (actually the generator) and only 2 kWh produced by the battery went to the home.

EiNSTeiN- avatar May 28 '24 12:05 EiNSTeiN-