hassio-addons/addon-influxdb

Feature request: retention policy per sensor

Closed this issue · 7 comments

Problem/Motivation

Feature request

Expected behavior

Multiple retention policies that can be assigned to sensors.

Actual behavior

Please enable the ability to assign a retention policy per sensor.

For example: An ADC sensor collecting voltages every 250uSec for a Node-Red power calculation function flow could be assigned a rentention policy of 90 days while a daily kWh power sensor or a water tank fill level sensor would received an infinite retention policy.

A sample InfluxDB retention policy architecture can be viewed in min 46:39 of the tutorial

Could you possibly add a bit more detail to your feature request, rather than just a YouTube link?

Perhaps a link to the configuration change you are requesting.

@sinclairpaul you're right, I've added to better articulate the desired change

The application that is writing the data would need to specify the retention policy, the addon itself provides InfluxDB.

You are able to create multiple policies from the GUI.

I'd love to get educated on how a sensor (e.g.: ESPHOME sensor) can specify a retention policy?

Look for InfluxDB retention policies and data downsampling.
For example https://hackernoon.com/influxdb-continuous-downsampling-optimize-your-tsdb-today-q3lm2fhg

We need the ability to specify/override which retention policy the HA influxdb component writes data to.
This is the proper way of defining how long we need to store each type of data.
CQ in influxdb always downsamples data and this might not be the desired action for data which doesn't need it.

Examples below:

component_config_domain:
  climate:
    override_measurement: climate
    override_retention_policy: rp_90days

component_config_glob:
  sensor.*thermostat*:
    override_measurement: thermostat
    override_retention_policy: longterm

OR (another form, which uses influxdb syntax <retention_policy>.<measurement>)

component_config_glob:
  sensor.*thermostat*:
    override_measurement: longterm.thermostat

@isorin That sounds like a feature request for Home Assistant and not part of this add-on.