esphome / esphome/feature-requests

Filter to get mean value between sliding window min and max

Open
#2,818 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

I have a sensor measuring the level in a water tank. Without changing the amount of water in the tank, the value fluctuates between a min value and a max value approximately every 30s but unfortunately this is not stable (neither min/max nor frequency but when max goes higher than min also gets lower)
To flatten the curve I would like to use a filter like:
- collect data points in sliding window (like with min, max or median filter)
- return (max - min)/2

**Please describe your use case for this integration and alternatives you've tried:**

I have tried to use min or max filter but the interval between them is not constant.
I have also tried sliding_window_moving_average and median but the duration to go from min to max and back is also not constant.
Unfortunately I don’t have an image of the sensor signal. It looks like kind of a sin wave with changing amplitude and frequency.

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

The request names existing min, max, median, and sliding_window_moving_average filters but does not identify implementation files or tests. Start by locating those filters in the ESPHome codebase and compare their window behavior; done should include a documented filter behavior and coverage for the requested sliding-window result.

Written by the indexing model from the issue text.

Assessment

Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.