Skip to content

Power Sources on Energy Dashboard missing if selected date is beyond short term statistics limit #28737

@TCWORLD

Description

@TCWORLD

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:

Image

However there is data is present in long term statistics:

Image

If a range of >9 days is selected, the power sources data is properly populated:

Image

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

  1. Go to energy dashboard summary tab
  2. Select a day that is beyond the limit of short term statistics,
  3. 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:

frontend/src/data/energy.ts

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions