How to delete history from specific sensor/entity?

Hi,
I read out optically my watermeter using OCR.
Now the water company was here and changed the meter to a new one.
The new meter starts at 0.
The history is so much higher and this looks crazy on graphs.

Can I somehow delete the history for a specific sensor/entity?

Thanks,
Ase

Would this help?

recorder#service-purge_entities

1 Like

Thanks for the tip pedolsky,

Added a line to purge the entity, lets see after the nighty run how it works.

//Ase

Hello,
are there any actual news how to correct/delete historical sensor data user friendly? (I just started working with Hass and until now not really deep in the processes)
Thanks, Michael

1 Like

very useful. Thanks

1 Like

I run HA on a RaspPi (latest version of OS and HA).
I read the recommended article recorder#service-purge_entities twice… and tried the recorder purge service, but I must make something wrong as the log tells me: running_script: false.

Do you have any idea/hint. Would be much appreciated :slight_smile:

Executed: August 21, 2023 at 16:38:53
Result:
params:
  domain: recorder
  service: purge_entities
  service_data:
    keep_days: 7
    entity_id:
      - sensor.fritz_box_7530_ax_gb_received
  target:
    entity_id:
      - sensor.fritz_box_7530_ax_gb_received
running_script: false

This is, how my automation looks like, exactly as described above:

alias: Purge -7
description: ""
trigger:
  - platform: time
    at: "15:00:00"
condition: []
action:
  - service: recorder.purge_entities
    data:
      keep_days: 7
    target:
      entity_id: sensor.fritz_box_7530_ax_gb_received
mode: single