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

Feature Request: threshold for database plugin #339

Closed
onkelandy opened this issue Jan 4, 2020 · 3 comments
Closed

Feature Request: threshold for database plugin #339

onkelandy opened this issue Jan 4, 2020 · 3 comments

Comments

@onkelandy
Copy link
Member

I have some float items that constantly change their value (based on a sensor) very marginally, eg. 20.34, 20.38, 20.12, 19.99 etc.

It is not very useful to write every small change into the database. So I propose an additional database_threshold keyword that specifies the necessary minimum change of an item to write it in the database. Example:
Last entry in database for specific item is 20.00 (maybe on init it should always write the current value, not regarding the threshold)

Item has database_threshold of 1.50
Item changes to 20.50, 21.20, 19.00, 21.25 and does not get written to the database as the value change in comparison to the last database entry (not the last item value!) is less than 1.50

After the last change to 21.25 the item value changes to 21.50 and now gets written to the database.

I'm aware that the problem could be solved by using extra items and/or logics but it might be a nice feature for the plugin itself.

@smaiLee
Copy link
Contributor

smaiLee commented Jan 4, 2020

I implemented exactly this behaviour for another plugin. I will check if the code could be easely adapted for database plugin.

@ohinckel
Copy link
Member

ohinckel commented Jan 5, 2020

I think is was already requested in #285 and we should track this in the old issue instead of creating a new one.

@onkelandy
Copy link
Member Author

Yep its the same. Too old I could remember/find it ;)

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

No branches or pull requests

3 participants