Persistence strategy respecting a threshold

as usual, Rich is head on nail! :wink:
one thing you to keep in mind, if you want to persist only with a threshold is how to avoid not persisting anything at all. Let’s just assume, that your temperature is inertial and just stays under the threshold, but over the day, this cold then add up to a significant change, so you have to add that behaviour to your rule also. Since you don’t want to use persistence, you can’t use the cool ā€œaverageSinceā€ with an item, so you must find other persistences to check, if an item changed since more than one interval.

I would go with a ā€œcompactingā€ function within the persistence - or just delete old values, if you won’t need them. I for myself also persist all my sensors (>150, if I count them correctly) within MySQL in my case. As my MySQL grew also big, I just added a stored procedure as described here: "Garbage Collection" on MySQL persistence: deleting old Item states. If i had some more time (and ran out of space with my DB), I’d like to come up either with a migration to InfluxDB or some stored procedure which would compact my data in junks of some hourlong intervals or something - I don’t know… But for the time being, I have around 500 items in my MySQL-Database running for approx. a year now and the size is 216,12 MB right now.

1 Like