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 dashboard does not show correct values in custom range #19850

Closed
4 tasks done
teodorch85 opened this issue Feb 21, 2024 · 2 comments
Closed
4 tasks done

Energy dashboard does not show correct values in custom range #19850

teodorch85 opened this issue Feb 21, 2024 · 2 comments

Comments

@teodorch85
Copy link

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

In energy dashboard using custom range the values are not correct.
Only the low carbon is changing when changing range.

image

image

@TillFleisch reproduced the problem

          @teodorch85, please open a separate issue for this (if there isn't already one), so that we can keep track of this issue. I too can replicate this on a (core 2024.2.2/front 20240207.1) instance. The reported values don't change, once enough days have been selected so that "months" are shown in the bar charts. Adding a day in this scenario does not change the values when it should. Note that the low-carbon circle does change.

Originally posted by @TillFleisch in #14337 (comment)

Describe the behavior you expected

Using the addon below the values are correct
https://github.com/flixlix/energy-period-selector-plus

image

Steps to reproduce the issue

  1. Energy dashboard
  2. Select custom range
  3. Change range and the values do not change
    ...

What version of Home Assistant Core has the issue?

2024.2.2

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

@karwosts
Copy link
Contributor

karwosts commented Mar 1, 2024

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
Copy link
Contributor

karwosts commented Mar 3, 2024

Realize this is a duplicate of older bug #18883, so close this as duplicate.

@karwosts karwosts closed this as not planned Won't fix, can't repro, duplicate, stale Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants