Statistics sensor slows down HA to become unusable

I think I’ve blundered…

I created an ‘average linear’ statistics sensor to calculate the average power consumption of the last 7 days. The power consumption is updated every 2nd second, so over a week, that’s 302 400 values. If I understand the code correctly, that average calculation is then repeated every time a new value comes in. After a week that’s a lot of calculations every 2nd second…

Should have thought of that…

In effect, the user interface becomes totally unresponsive and I can’t - through the user interface - access the yaml file and remove the statistics sensor.

Is there a way to access the config and yaml files other than through the user interface. Can I connect to the host directly and stop HA (while keeping the OS running) so that I can remove the sensor? I could reinstall HA, but the only backup available is the one in the cloud - and it has the statistics sensor - so I’m not sure that will help.

I’m fishing for good ideas… Thanks :wink:

Can you physically disable the power sensor?

1 Like

That’s a great idea! Should have thought of that myself :flushed:

Didn’t try it though, because after a restart, and acting at once, I was able to remove the statistics sensors before the system had operated long enough to overload the system.

But thanks anyway - that should have solved the system - perhaps disconnecting first and then restarting.