Skip to content

Recorder purge_entities does not delete statistics_short_term #160292

@Johanneke

Description

@Johanneke

The problem

Running recorder.purge_entities only removes data from the "states" table, but not from the "statistics_short_term" table.

This was previously in detail reported here, which was marked as stale and closed without resolution.

According to this comment, the short term statistics should be purged along with the states, so this seems to be a bug in the purge_entities action.

What version of Home Assistant Core has the issue?

core-2025.12.4

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

Recorder

Link to integration documentation on our website

https://www.home-assistant.io/integrations/recorder/

Diagnostics information

No response

Example YAML snippet

action: recorder.purge_entities
data:
  keep_days: 1
  entity_id:
    - sensor.power_produced

Anything in the logs that might be useful for us?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions