plugins icon indicating copy to clipboard operation
plugins copied to clipboard

database: Feature request: Only write to DB on minimal change

Open msinn opened this issue 4 years ago • 2 comments

This issue is moved over from the core repo. The complete issue can be read over there: https://github.com/smarthomeNG/smarthome/issues/285

To reduce superfluous data it would be nice if logging of values to the database could be prevented if not a minimal difference to the last logged value is reached.

Use cases:

Values sent by physical sensors (like temperature, brightness, distance or flow sensor) often wobble in short intervals between two values (e.g. 24.1°C and 24.2°C and back again). Unfortunately not every sending device allows to prevent this. Sometimes an exact value is needed for live operations but for logging less precission would be sufficient.

msinn avatar Jan 30 '22 13:01 msinn

If needed immediately, this could be remedied by using eval/logic works.

If no further comments are made, I'll close this after the next release.

Morg42 avatar Dec 08 '24 10:12 Morg42

I do not think we should implement this. If one is needing a kind of wobbling prevention we can introduce a helper Item that saves values dewobbled to a database. Have a main item that receives a measurement and the helper item that is triggered by the measurement item and that has an eval that calculates the difference between last set value and the new current value to be set in measurement item. Maybe someone has a usecase and is able to produce an example to put it docu?

bmxp avatar Dec 08 '24 17:12 bmxp