Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
msinn opened this issue Jan 30, 2022 · 2 comments
Open

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

msinn opened this issue Jan 30, 2022 · 2 comments

Comments

@msinn
Copy link
Member

msinn commented Jan 30, 2022

This issue is moved over from the core repo. The complete issue can be read over there: smarthomeNG/smarthome#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.

@Morg42
Copy link
Member

Morg42 commented Dec 8, 2024

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.

@bmxp
Copy link
Member

bmxp commented Dec 8, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants