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

Outdated values get recorded shortly after HA restart #138915

Open
joel-bourquard opened this issue Feb 20, 2025 · 0 comments
Open

Outdated values get recorded shortly after HA restart #138915

joel-bourquard opened this issue Feb 20, 2025 · 0 comments

Comments

@joel-bourquard
Copy link

joel-bourquard commented Feb 20, 2025

The problem

I'm running the official HA 2025.2.4 Docker container on Linux x86-64.
After restarting HA twice in a row (docker compose down + up) within a few minutes, I observed that some monotonically increasing sensors suddenly had an outlier value in the recorder DB shortly after the 2nd restart. The server and database itself (MariaDB 10.11.11) were not restarted.

This issue seems independent of the integration that supplies the values (eg: Webhook, ModBus).

Among the symptoms: any statistics sensors with state_characteristic "sum_differences_nonnegative" will go crazy (and that's how I noticed the issue).

What version of Home Assistant Core has the issue?

core-2025.2.4

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Recorder

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

Anything in the logs that might be useful for us?

Additional information

SQL query that I used to retrieve the values:
SELECT state, state_id, last_updated_ts, last_reported_ts FROM home_assistant.states WHERE metadata_id = (SELECT metadata_id FROM home_assistant.states_meta WHERE entity_id = 'sensor.THE_SENSOR_ID') AND last_updated_ts > 1739992700 AND last_updated_ts < 1739993300 ORDER BY last_updated_ts;

Example 1 (Webhook platform sensor, interval ~ 20s):

Image
Data: webhook-meter-main.txt

Example 2 (Modbus sensor):

Image
Data: modbus-meter-hp.txt

Exemple 3 (Modbus sensor):

Image
Data: modbus-meter-wh.txt

@joel-bourquard joel-bourquard changed the title Recorder regurgitates an outdated value shortly after HA restart Outdated values are recorded shortly after HA restart Feb 20, 2025
@joel-bourquard joel-bourquard changed the title Outdated values are recorded shortly after HA restart Outdated values get recorded shortly after HA restart Feb 20, 2025
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

1 participant