Open TD-er opened 4 years ago
This is a must-have. Currently, if we want to calculate the average we must to that by hand (like here: https://github.com/letscontrolit/ESPEasy/issues/2713#issuecomment-550049981) I think there should be a filter device (similar to a dummy device) that would allow us to process readings from a sensor and that would apply filter. This way we will be able to visually define filters. Use case: make 10 temperature readings, calculate the average using a specified filter, and send the result via MQTT.
It would be nice to have filter and statistics operations to be used in the formula field (and maybe in the rules also) This would then allow to perform some standard filtering on any task value. Currently the formula allows to use the last known value, but for filtering you may need to have some more stored values. So a filter instance should be able to refer to its internal data struct for filtering. In a formula it is easy to create an unique key based on task ID and task value, but for use in rules we must think of something to interact with it.
For example: