esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
407 stars 26 forks source link

Sensor filter: Relative delta #1575

Open Oderik opened 2 years ago

Oderik commented 2 years ago

Describe the problem you have/What new integration you would like I need a sensor filter similar to delta but with a relative delta instead of an absolute one.

My suggestion would be a filter that passes the current value if:

Please describe your use case for this integration and alternatives you've tried: I want a power meter to respond to meaningful changes. A washing machine for example might draw 2kW when heating up. 50W more or less wouldn't make a difference. But when trying to distinguish states like power off, idle and delay start, that would all be way below 10W. This is just an example of a device with a wide value range and of course to detect those states, the particular filter of this feature request would not be necessary but useful.

Another use case would be a power meter that adapts to any measured device.

In general, I like to configure sensors to report on change rather than periodically. With the current delta filter, I have to decide wether I want to miss minor changes or accept noise.

Additional context

deejaybeam commented 2 years ago

I would like this feature too! This is also implemented in Tasmota as powerdelta. Makes it possible to instantly send values on change, but does not flood HA when using a short update_interval.