frontend icon indicating copy to clipboard operation
frontend copied to clipboard

energy dashboard showing incorrect costs for power consumed

Open siobhanellis opened this issue 3 years ago • 21 comments

Checklist

  • [X] I have updated to the latest available Home Assistant version.
  • [X] I have cleared the cache of my browser.
  • [X] I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

My Grid consumption shows 3.8kWh, I have set the cost to be 0.30GBP, yet the cost associated in the dashboard is -£40.32.

Describe the behavior you expected

I expect to see 3.8 x 0.3 = 1.14

Steps to reproduce the issue

1. 2. 3. ...

What version of Home Assistant Core has the issue?

2023.8.1

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Using Home Assist App (default Safari)

Which operating system are you using to run this browser?

macOS 13.4.1(c)

State of relevant entities

sensor.foxess_grid_consumption

FoxESS - Grid Consumption
3.80000000000018	

state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: FoxESS - Grid Consumption

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

Screenshot 2023-08-09 at 17 08 32 Screenshot 2023-08-09 at 17 09 01

siobhanellis avatar Aug 09 '23 16:08 siobhanellis

The cost is actually not calculated in the frontend with a simple multiplication, it comes from a separate sensor created by the energy integration, and it doesn't change retroactively.

If the cost is showing wrong, then you have some bad historical data in the _cost sensor that was created for your entity.

See if you can find that sensor and look at its history to see what's going on. Optionally you can fix a bad datapoint in developer-tools/statistics.

karwosts avatar Aug 09 '23 17:08 karwosts

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 07 '23 18:11 github-actions[bot]

This issue is related to #79638 Energy cost sensors reset during HA restart even though the energy sensor they track do not This issue is unresolved as at 2023.12.2 Cost sensor resets to zero on system restart.

ckglobalroaming avatar Nov 12 '23 03:11 ckglobalroaming

same issue

Tosko4 avatar Nov 13 '23 00:11 Tosko4

Again I will reiterate that the cost comes from the backend, the frontend just displays what the backend reports for statistics sensor.

Knowing that, if anyone suspects there is a frontend bug here, and you can provide supporting data/evidence, I can look at it, else I will close this issue.

karwosts avatar Nov 13 '23 13:11 karwosts

I am sure you are right. Fact is, that when I reset my HA instance, the counters are starting from 0, not picking up the state before restart and continue on it.

Also, tracking this: https://github.com/home-assistant/core/issues/79638#top you mentioned that it wasn’t fixed. You link to a PR which is closed, but I cant tell from the comments that it is solved. Paired with the comments here and other ticket, the assumption I made is that it is still not solved.

i can try to provide info later today or tomorrow.

Tosko4 avatar Nov 13 '23 16:11 Tosko4

You link to a PR which is closed, but I cant tell from the comments that it is solved.

I linked an issue which got closed, but that issue has a core PR which is still open/pending ( home-assistant/core#97031 )

It's unfortunate that #79638 got closed by stale bot, but if this issue is in the core code, this frontend ticket can't help unless there's something to be fixed in frontend. Maybe a new core issue needs to be opened, or get a moderator to reopen that issue.

karwosts avatar Nov 13 '23 18:11 karwosts

Gotcha. Indeed i dont think this is a frontend issue.

Tosko4 avatar Nov 13 '23 22:11 Tosko4

+1

n0b00nn0 avatar Jan 20 '24 14:01 n0b00nn0

You link to a PR which is closed, but I cant tell from the comments that it is solved.

I linked an issue which got closed, but that issue has a core PR which is still open/pending ( home-assistant/core#97031 )

It's unfortunate that #79638 got closed by stale bot, but if this issue is in the core code, this frontend ticket can't help unless there's something to be fixed in frontend. Maybe a new core issue needs to be opened, or get a moderator to reopen that issue.

The PR https://github.com/home-assistant/core/pull/97031 got merged in December but the issue is still hapenning, does anyone know if there is another issue to track this problem where the energy cost is initialized to 0 every time Home Assistant restarts?

heisenberg2980 avatar Jan 21 '24 02:01 heisenberg2980

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Apr 20 '24 04:04 github-actions[bot]

Please reopen. It is still the case

Tosko4 avatar Apr 20 '24 04:04 Tosko4

+1 to keep open as definitely still an issue

baxgit avatar Apr 20 '24 08:04 baxgit

Please open a new core issue at https://github.com/home-assistant/core to get this fixed or tracked. Keeping the issue open here won't help it as mentioned some months ago unless there's something to be fixed in frontend.

silamon avatar Apr 20 '24 12:04 silamon

@silamon funny how you guys keep pointing back and forth. There are 2 other issues closed as well

Tosko4 avatar Apr 20 '24 13:04 Tosko4

I'm not really trying to point back and forth. We're all saying that it's an issue in core, and you acknowledged that it's not a frontend issue. 😉 If the issue is about the frontend, and something that should be fixed in the frontend code, we're happy to have your issue here until it's solved. We're not going to track issues here if the issue is to be solved elsewhere. Because there's currently no issue for this at core, I suggest to open a new one.

silamon avatar Apr 20 '24 13:04 silamon

Cost sensor resets to zero on system restart.

Scoopien avatar Oct 11 '24 10:10 Scoopien

same problem here !!

Null-Mind avatar Oct 17 '24 17:10 Null-Mind

same problem already with energy sensors and individual energy usage in energy dashboard. The spikes to zero are the restarts of HA. Using the actual 2024.11.2 and all the other things are up-to-date.

image image

lullatscho avatar Nov 20 '24 09:11 lullatscho

I don't understand why this issue was closed. It's a definite problem and makes the energy cost tracking in HA pretty much pointless. Is this never going to be fixed? It's a great feature, but it needs to actually work correctly!

bdelima avatar Jul 23 '25 21:07 bdelima