Purge automation not working for Influx DB

Hi

First of all I am not sure if this is a real issue or a misconception on my configuration. let me explain:

I am starting to add some automations to keep my DB size under control.

I have created some automations to purge entities on different periods.

My automations are like this:

alias: DATA - Purge - S (3Months)
description: ""
trigger:
  - platform: time
    at: "00:30:00"
condition: []
action:
  - service: recorder.purge_entities
    data:
      keep_days: 90
    target:
      entity_id:
        - person.l0bit0
        - update.home_assistant_supervisor_update
        - update.home_assistant_core_update

Automation was executed last night with no error, but data older than 3 months fare still visible on Influx DB (Grafana):
i.e.

  • I am comparing two entities (AEMET Temperature and Netatmo EXT Temperature)
  • AEMET temperature is purged fro 3 months, and Netatmo EXT is not purged, so i should have all data.
  • history info looks good, as AEMET temp. is only showed till May 19th:
  • Data is still available on Grafana:

I assume data purged should be also deleted from Grafana

Any Idea? There is a different way to clean data on InfluxDB data?

thanks

recorder is the internal database, SQLite by Default, some have it configured for mysql/mariadb
you can forward data to influxdb, but housekeeping on the influxdb is not covered by Home Assistant ( as far as I know … )

For influxdb you have to configure retention polices in the influx database
This is a link to influxdb documentation for version 2.x Data retention in InfluxDB | InfluxDB OSS 2.1 Documentation (influxdata.com), it is similar in 1.x, but I do not have link

Armin

2 Likes

It is not.

1 Like

Thanks! it make sense, I will take a look to influx DB then.

thanks!

One more thing, as I checked and find retention policy on InfluxDB, but there is an easy way to set different retention policies for different objects?

I read some documentation but are general (never an specific example from home Assistant). and looks complex to me (I have no knowledge on influx DB, just some SQL knowledge…)

If you have any dummy guide handy would be great :slight_smile:

Thanks in advance

No you set the retention policy at the database level. You can downsample to another database, see: Homeassistant + Influxdb: is it possible to select a different Retention policy for a couple of sensors? - #8 by JohannCR