home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.17k stars 29.85k forks source link

average_step Statistics Sensor Fails to Retain Last Value Beyond Max Age #124941

Open RubenKelevra opened 2 weeks ago

RubenKelevra commented 2 weeks ago

The problem

I'm experiencing an issue with the average_step statistics sensor in Home Assistant, which I'm using to monitor data from a brightness sensor. This brightness sensor only updates when there's a significant change in brightness.

Given that, if there's no change in brightness, the last value recorded by the brightness sensor might be older but still accurate.

According to my understanding, the "Keep last sample" option in the statistics sensor should retain and display this last sample value. However, this doesn't seem to be working as expected.

If the last recorded value from the brightness sensor is older than the configured "Max age" setting, the statistics sensor shows "Unknown" instead of retaining the last known value.

What version of Home Assistant Core has the issue?

2024.9.0b1

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

statistics

Link to integration documentation on our website

https://rc.home-assistant.io/integrations/statistics

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 2 weeks ago

Hey there @thomdietrich, mind taking a look at this issue as it has been labeled with an integration (statistics) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `statistics` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign statistics` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


statistics documentation statistics source (message by IssueLinks)