-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
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
When selecting a historic date on the summary tab of the energy dashboard, the power sources chart is empty if the selected date range exceeds the available short term statistics:
However there is data is present in long term statistics:
If a range of >9 days is selected, the power sources data is properly populated:
Describe the behavior you expected
The power sources data should show long-term statistics data if short-term statistics are not available. Similar to the history charge.
Steps to reproduce the issue
- Go to energy dashboard summary tab
- Select a day that is beyond the limit of short term statistics,
- No data is shown even though present in long term statistics
...
What version of Home Assistant Core has the issue?
2025.12.1
What was the last working version of Home Assistant Core?
N/A
In which browser are you experiencing the issue?
N/A
Which operating system are you using to run this browser?
N/A
State of relevant entities
Problem-relevant frontend configuration
JavaScript errors shown in your browser console/inspector
Additional information
This appears to be due to the way the statistics data is requested here:
Lines 451 to 461 in 6efe444
| const dayDifference = differenceInDays(end || new Date(), start); | |
| const period = | |
| isFirstDayOfMonth(start) && | |
| (!end || isLastDayOfMonth(end)) && | |
| dayDifference > 35 | |
| ? "month" | |
| : dayDifference > 2 | |
| ? "day" | |
| : "hour"; | |
| const finePeriod = | |
| dayDifference > 64 ? "day" : dayDifference > 8 ? "hour" : "5minute"; |
For longer time periods, the hourly data is requested which is fetched from long term statistics, however for short time periods only 5 minute data is requested regardless of whether the data is available in short term statistics or not.