frontend icon indicating copy to clipboard operation
frontend copied to clipboard

Energy dashboard counts full month of data when selecting only a partial month

Open studiowena opened this issue 1 year ago • 3 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

When selecting a non-standard date range in the energy panel covering 2 months, e.g. September 2 to November 2, it provides data from September 1 to November 1.

Describe the behavior you expected

It should show data on the amount of energy consumed also from a non-standard date range. Unfortunately, it only works within one month, but it should work throughout the year.

Steps to reproduce the issue

  1. choose 2 sep 2023 to 2 nov
  2. then change 2 sep 2023 to 4 nov 2023

nothing change on energy kwh

What version of Home Assistant Core has the issue?

2023.11.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

No response

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

studiowena avatar Dec 04 '23 11:12 studiowena

I can confirm that issue. If you choose a period longer than one month, then the entire previous month may be selected. I first thougth my energy meter is defect but it is the query for home assistant i guess.

stestr avatar Dec 20 '23 07:12 stestr

Copied from (#19850)

Seems that the backend just does not handle statistics requests where the start time is not aligned with the period in the way that is expected.

If you say you want monthly statistics, than it always returns the full month's summary, regardless to if you set the starttime of the request for the 1st, or the 30th, or anywhere in between.

I guess our options for dealing with this would be:

  • Backend change to behavior (unlikely?)
  • Always request full hourly resolution and summarize in the frontend (seems inefficient, but this is probably what period-selector-plus does)
  • Somehow change the picker to reflect that this is an invalid selection when using monthly resolution.

Curious if we would ever want to support user chosen resolution as well, instead of hardcoding monthly resolution at >35 days, the answer to this might be tied up with the answer to that.

karwosts avatar Mar 03 '24 14:03 karwosts

I have the same issus: If I select over 60 days, like January 21th to march 29th, January show the energy of the complet month (1928 kW) image But if I select only the 11 days of January, I have only 671 kW. image

djiesr avatar Apr 19 '24 22:04 djiesr

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 Jul 18 '24 23:07 github-actions[bot]

In trying to track exactly hoe many kWh I'm using between two dates and this limitation is very annoying. Did you ever find a fix?

tophermetcalfe avatar Jul 20 '24 19:07 tophermetcalfe

IMHO the dashboard should not allow picking individual dates where the range is > 35 days, alternatively it should show a warning that the numbers are way off!

@tophermetcalfe I also export the data to victoriametrics and use grafana to get the values.

rburgst avatar Sep 15 '24 05:09 rburgst