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

Max value does not update in December if set to "this Year" and this year is Leap year #132156

Closed
peteh opened this issue Dec 3, 2024 · 1 comment · Fixed by #132167
Closed

Comments

@peteh
Copy link
Contributor

peteh commented Dec 3, 2024

The problem

I track some measurements in homeassistant and show the max value as well.
I use the statistic card to show the max value for the current year.

However it seems like theses don't update anymore during December - the last update was in November

core-2024.11.3 and core-2024.11.4 both seem to be at least affected

What version of Home Assistant Core has the issue?

core-2024.11.4

What was the last working version of Home Assistant Core?

Based on further analysis, this might have never worked

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Not sure if it's an integration
I'm using the statistics card to show the max value
image

However it does not update anymore since about a month and it's current value is higher:
image

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

When I set to "this month" it works - the current value is shown.
Is December not counted into "this year" maybe? Could be some < and <= issue somewhere

I also found a workaround for the yaml config of the statistic card:

type: statistic
period:
  fixed_period:
    start: 2024-01-01
    end: 2024-12-31
stat_type: max
name: Depot Gains ATH
entity: sensor.xxx
layout_options:
  grid_columns: 4
  grid_rows: 2

This counts from 1st of Jan to end of December and gives the correct value. So I'm relatively certain that the calculation for "this year" does not include December. I haven't found the right place in the code to double check though.

Additional information

No response

@peteh peteh changed the title Max value does not update anymore Max value does not update anymore if set to "this Year" Dec 3, 2024
@peteh peteh changed the title Max value does not update anymore if set to "this Year" Max value does not update in December if set to "this Year" Dec 3, 2024
@peteh peteh changed the title Max value does not update in December if set to "this Year" Max value does not update in December if set to "this Year" and this year is Leap year Dec 3, 2024
@peteh
Copy link
Contributor Author

peteh commented Dec 3, 2024

Went down the rabbit hole and fixed it. The PR is attached to this issue.

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

Successfully merging a pull request may close this issue.

1 participant