Allow users to adjust data from any long-term statistic (such as 'measurement') rather than just totals

As described here, adjusting statistics via the dev tool is not possible for statistics of type “measurement.” The exact same concerns apply for statistics of type “measurement” as apply for total/total_increasing, in terms of trying to display meaningful data in a graph and sometimes needing to correct historical data.

For instance, I record my cat’s weight using a catbox sensor and I turned that into a long-term statistic of type “measurement”. Sometimes, when emptying the catbox, it records a very low weight, and that’s collected with all the normal “good” data. Since the catbox may only be used once a day, it directly affects a daily graph regardless of the type of statistic I use.

It’s also confusing to the user to have only some sensors show the “adjust” icon and others (most) not, not to mention that the dialog makes no mention of the distinction:

To be clear about the icon I’m talking about, it’s this one on Dev Tools->Statistics:

Please remove the restriction on which long-term statistics can be adjusted and allow for (at least) historical measurements to be changed.

There is still no possibility to change or delete sensor values from statistics. Sensors often report a way too high/low value what crashes every statistic.
There should be a way to delete/manipulate wrong values easily. Even better would be the additional possibility to make this available in automations via templating to enable the user creating rules (automations, scripts) to delete erroneous values automaticaly.

Developer Tools → Statistics

I have used it to correct negative sensor values.

1 Like

With Spook you might be able to do it programmatically.

1 Like

Nope. This is not possible for every sensor. At least not in my installation :man_shrugging:

How could I do?

It’s possible for sensors whose history is recorded in long-term statistics.

What did you mean when you used the word “statistics”?

1 Like

The tab in the dev. tools.

Then what I wrote previously remains true; if an entity meets the requirements for inclusion in long-term statistics, it will appear in Developer Tools → Statistics.

If you have sensors that do not have unit_of_measurement, device_class, and state_class attributes, their values are not recorded in long-term statistics and will not appear in Developer Tools → Statistics.


Or are you saying that some of the entities that appear in Developer Tools → Statistics do not have an “Adjust sum” icon?

image

Actually, this is the problem. For instance: I have some temperature sensors with weird values sometimes and right now there is no easy way to correct.

OK, I already figured out that this is a real mighty integration but to be honest, I didn‘t find a way how it helps me to remove automatically values from a ststistic.

@123 do you have a solution for that?

Here’s what I recently learned:

  • Currently, only sensors whose state_class is total or total_increasing can have their recorded values adjusted. If it’s measurement then it cannot be adjusted.

  • total and total_increasing indicate the sensor’s values are used to compute a cumulative value. There’s no computed value for measurement sensors. My guess is that is why their values aren’t adjustable.

It would be nice to have the ability to adjust the recorded values of measurement sensors so I have voted for your FR.

1 Like

There is a Feature request for this

1 Like

Is there a means of merging this FR into the other one?

The other one’s description is more detailed and pinpoints the current limitations.