Provide the ability to reset stats for an individual sensor + sensor spike filters

Whilst developing a new sensor, trialling a new one and creating the YAML, or if there is a fault that creates statistics that are way out from a standard baseline the statistics graphs can autoscale to end up being a bit pointless. Using static min/max isn’t always the answer to this either. Quite regularly whilst building out my system I have wanted to just clean wipe some of the sensor data, which requires logging in to SSH, using the SQL backend and writing the relevant query to remove the data. It would be really good if it were possible to reset the main data for a sensor on the sensor’s GUI page or for a whole device even (basically a pre-written clean-up query behind a button, based on the sensor/device which the user can click to zero the date for the particular sensor/device etc.). could either remove granular data or long term statics. Suggestions would be a “Remove historical data” button that then prompted with a box to select either or both of the statistic types, followed by an “are you sure” with the implications listed.

This could be combined with a spike filter for normal use (flame me if this is already there…) that could be “ignore values above/ignore values below” and even include “less than x period” or “less than x sample” to help filter out erroneous values which the user could choose to ignore (but by default would not be set). The idea being if the expected range is 0-100 but maybe the sensor erroneously reads 300, for 2 samples (interference, unresolvable custom build electrical error, actual system behaviour that can be ignored) then one could set "ignore values over “200” for “less than 3 samples” etc.

Examples of not being able to delete data being a problem have been where I have seen faults with pressure sensors that go bad and erroneously report higher voltages than expected for 1 sample, or when setting up or resetting calibration on calculated sensors (had this while working out the settings for pressure sensors), working out the scaling values - one mistake in YAML with a template and you have a ridiculous value you can’t get rid of and quite a faff to reset it or delete and re-add.)

Might even be that a sensor is replaced AFTER having had a fault and having give bad readings for a few days - being able to just remove the data and start again but without having to set-up the device all over again.

Many thanks

Swampy…