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

Empty Energy Data at Start of Period forces Data to be All Time #115

Open
dcd-projectrose opened this issue Apr 6, 2024 · 1 comment
Open

Comments

@dcd-projectrose
Copy link

Code in Energy Statistics has a check to see if there is no data for Start of Period, and if so set a data point of 0 for start of period. This means if there is no data for any energy entity for any start period, e.g. system offline, device offline; the data will sum for all time.

Example after a system outage that spanned midnight. This is from a custom Energy Dashboard with Energy Flow Plus card on right.

4-6th April with Data at Start of Period
Screenshot 2024-04-06 at 11 06 39 AM

5-6th April with no Data at Start of Period
Screenshot 2024-04-06 at 11 06 53 AM

This matches other reports of strange Day data, which is what I saw for 5th April. Note: System has only been on for about a week hence the lowish All Time data

// if the start of the first value is after the requested period, we have the first data point, and should add a zero point
if (stat.length && new Date(stat[0].start) > startMinHour) {
stat.unshift({
...stat[0],
start: startMinHour.toISOString(),
end: startMinHour.toISOString(),
sum: 0,
state: 0,
});
}
});

@BoGnY
Copy link

BoGnY commented Jun 11, 2024

same problem for me, but seems only "today" is bugged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants