the internet's box_

log / Electrical & energy / Home automation

Part 4 of 8 in Home energy · series 1 (Dec 2026, ongoing)
earlier: Checking whether a home battery schedule fix actually workednext: Finding the real source of a high garage load: an EV charging in peak hours

· error log #home-automation #sensors #filtering

Filtering Outliers Before Taking a Minimum

What happened

A minimum statistic over a time window was wrong, because the underlying sensor occasionally reported bogus low readings. A minimum picks up every one of these, so a single bad sample can set the result for the whole window.

After I changed the configuration and restarted, the new sensors didn't appear right away. I wasn't sure whether the system was still loading or the config had failed, so I checked the logs. The system had just been slow to finish loading, and the change was fine.

The fix

Why it works

A real quantity like a battery level doesn't move by large amounts between samples. A large sudden jump is much more likely to be a bad reading than a real change. Filtering before taking the minimum keeps the glitches out of the statistic. Taking the minimum of raw data is especially sensitive to this, because one bad low sample determines the result.

Takeaway

When a statistic such as a minimum or maximum looks wrong, check the raw data for outliers. Filter them out before aggregating.