Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Energy distribution graph is inaccurate without solar production #21939

Open
4 tasks done
EiNSTeiN- opened this issue Sep 10, 2024 · 2 comments
Open
4 tasks done

Energy distribution graph is inaccurate without solar production #21939

EiNSTeiN- opened this issue Sep 10, 2024 · 2 comments
Labels
Bug Current Bug in UI - Extra Attention panel: energy

Comments

@EiNSTeiN-
Copy link

EiNSTeiN- commented Sep 10, 2024

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

I have a cottage with no solar panel connected. I monitor the battery charge, discharge and the grid import energy which are all added to my energy dashboard. In my setup, the grid is only providing power for 2 hours at a time, during which the batteries are being charged, then the grid is disconnected until the next charge and the home is powered from the batteries during this time.

This produces a monthly energy distribution graph like this:
image

  1. the home and the batteries are both power consumers, for a total of 547.2 + 289.6 which equals 836.8
  2. the battery and the grid are both power providers, for a total of of 326.6 + 220.6 which equals 547.2

The graph plainly shows the issue: How can there be 836.8 kWh consumed when there was only 547.2 kWh produced in this closed system?

Describe the behavior you expected

The "Home" bubble in the graph is calculated incorrectly. The expected value for the home consumption is the energy produced by the grid, minus the energy stored in the battery, plus the energy discharged from the battery. In this case it should be 326.6 - 289.6 + 220.6 = 257.6

This is because the battery is both a producer and a consumer, but not at the same time. The battery is either charging or discharging at any given time, this seems to be the oversight which led to this bug.

When the battery is discharging, the home energy comes from the battery. In my case the grid is a generator so it is physically disconnected and not providing power. However this is irrelevant to the bug since the graph shows no export to the grid and the home is the only consumer to receive the energy discharged from the battery.

When the battery is charging, the home energy comes from the grid. There is no other producer than the grid and the battery, and obviously the battery produces no energy while it is charging. But the energy being stored into the batteries also come from the grid, which is why it must be deducted from the home consumption to fix the issue. The energy can't go both places.

Steps to reproduce the issue

  1. Set up the energy dashboard with a grid consumption sensor, battery charge and battery discharge sensors.
  2. Disconnect the grid for some period, so that the battery discharges to the home.
  3. Connect the battery again so that the battery is charged from the grid.
  4. Select a period in the energy dashboard which encompasses both the charge and the discharge periods.
  5. Observe the home consumption energy is inflated by an amount equal to the battery charge energy.

What version of Home Assistant Core has the issue?

2024.9.1

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Version 127.0.6533.119 (Official Build) (64-bit)

Which operating system are you using to run this browser?

Ubuntu 24.04.1 LTS

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@karwosts
Copy link
Contributor

I suggest you attach an energy csv download of the window that produced this graph to the bug report. It may be helpful.

@EiNSTeiN-
Copy link
Author

Here is the csv for the period I was looking at: energy.csv

@karwosts karwosts added panel: energy Bug Current Bug in UI - Extra Attention labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Current Bug in UI - Extra Attention panel: energy
Projects
None yet
Development

No branches or pull requests

2 participants