"Adjust a statistic" does not update the actual data

Hi,

After looking at my energy consumption, I found some outliers. I searching here on the forum, and found the great (!) “Adjust a statistic” option. I didn’t know that was a thing. What a great find!

I managed to find a few outliers:

However, no matter what I try (0,1 0,0 0 0.1 0,1 and so on):

I get the notification, but nothing are adjusted. The values are still visible in the outliers, and in the power statistics-view.

Do the recorder need to pick up the adjustment I made, before it becomes visible in the front-end? Or?

Personally I though it was updated just after I adjusted the values.

I tried it with top two outliers, but none of them updated, after I presset “Adjust”. There’s no errors or similar in the Console.

I’ve cleared the caching in mu browser, and tried from another session. But the numbers are still the same; the broken ones.

The most wierd part is, if I query the sensor-data in my InfluxDB instance, I cannot find the “broken” number, or anything close to it:

I’m on HA version 2024.7.2 right now.

You can not adjust power sensors, only energy total sensors.

This only adjusts the statistics that are kept forever. It does not adjust the state data that is purged after 10 day (default).

I’ve added one sensor as a consumption. That’s called sensor.energy_consumed_luxembourg.

If I understand you correctly, the helpers behind the “Electricity grid” logics does not update, once I’ve updated my sensor.energy_consumed_luxembourg, by removing/adjusting the outlisers.

Is that correct?

If so; How can I adjust the HA History, so I don’t have a view like this:

I’m not sure if I get what you’re saying. There must be a solution to this.

Also; I fixed the “outlier”, but the HA tool for editing the outlier, skill shows up. That makes no sense to me? But maybe I’m missing the point?

Opening the outlier I adjusted yesterday, still shows the same value in the outlier-tool:


(as it’s also rendered in the Energy usage-graph)

I’m sorry to ping you, but have I misunderstod something?

If it is visible in the adjust statistics, it is just another outlier you can edit. I think it is not the same one but another one you missed before.

What tom_l meant is that it is editing long term statistocs, not short term recorder data. Those short term recorder datapoints are less relevant, because they’ll disappear after 10 days when jsing default recorder settings.

It is likely just one 0 value, all other readings are correct. You should look at why it was 0 though. If it is a template sensor you defined, adding an a
availabilit template may be wise.

Hi

What sensor do you think I’ve missed? I only provide one source to the energy “solution”.

I’ve adjusted the specific outlier, as mentioned.

image

The source are from ESPHome, where I use the SlimmeLezer+.

It’s not a template sensor, however, I’d consider adding a custom template sensor for the source, just to prevent any negative numbers, or at least, crazy unrealistic numbers.

But I’m still unsure how I can change the current number (without just editing it in the raw database, of course).

I was talking about this. You said it was ‘back’ but I think it is one of two and you only edited the first one. Set that to 0, then check for more. The dialog only shows a very limited number of results.

Thanks for clarifying.

The one shown on the screen has been adjusted 5+ times. Thats my problem. It simply keeps staying in the statistics, and as a outlier. No matter what I do in the GUI.

HA confirms the changes, but they’re not reflected in the system hereafter.

I use a external data-source for some things. Could this be a bug in HA?

Just a follow-up:
It didn’t work, no matter what I did.

Yesterday I upgraded to 2024.8, and it changed the value right away :partying_face: ! (+ updated it in the Energy graph, ofc.)

Before, example in July, where I did the same operation as described previous in this thread:

image

After:

I’ll still consider making a template sensor, so I can filter out values like this (including negative values).

For other people finding this post; Remember to update the cost sensor, too.

:upside_down_face:

UPDATE: I just noticed that another sensor did report wrong data on the same date! That helped me think a bit…!

One device was Wifi-powered, and another ZigBee powered.

So, after looking back in my event logs, I noticed that I was facing a disk space-issue on the 16. of marts, and the 24. of july. So that’s what causing the issues.

I’m not sure if this should be submitted as a bug. I know, disk-space are my own problem, but I didn’t expect HA to record garbage data (high positive and negative numbers) in a situation like this.

Here’s another example with a “high” (anormal) postive number from another device.