Expandable-6-Channel-ESP32-Energy-Meter icon indicating copy to clipboard operation
Expandable-6-Channel-ESP32-Energy-Meter copied to clipboard

Feature Request: Add throttle_average

Open hanley-development opened this issue 1 year ago • 0 comments

Instead of having a continuous stream and so that there aren't 5000 points of data per day can throttle average be added to the sensor?

Another workaround would be to create a way to optionally only send through template rather than sensor directly. throttle_average could be applied to template sensor.

throttle_average An average over the specified time period, potentially throttling incoming values. When this filter gets incoming values, it sums up all values and pushes out the average after the specified time period passed. There are two edge cases to consider within the specified time period:

no value(s) received: NaN is returned - add the heartbeat filter if periodical pushes are required and/or filter_out: nan if required

one value received: the value is pushed out after the specified time period passed, without calculating an average

For example a throttle_average: 60s will push out a value every 60 seconds, in case at least one sensor value is received within these 60 seconds.

# Take a measurement every 10s but only report the average 
# every 300s. This is to overcome the noisy ADC on the ESP32.
   update_interval: 10s
   filters:
     - throttle_average: 300s

hanley-development avatar Feb 21 '23 02:02 hanley-development