For my date related items I’ve been using the MySQL/MariaDb persistence for a while now. It all depends on what you want to do next with the information. I still haven’t decided what I’m going to do with the data. I also track both mine and my wife’s car location, by storing the GPS details. My intention with this data is check traffic against the location the car has been to each day. So in the morning I can announce the expected journey time to the said destination on a given day.
You seem to missunderstand how the persistence service of openHAB is working ( for any implemented database). This service stores the data always WITH the time of storage.
I’d say you simply need a numerical item (temperature) persisted. All values will have a time with it.
If you want to keep the EXACT data over the whole time ( and no data consolidation) rrd4j is not your candidate. However are you really interested in the exact values from “long ago”? If not I’d suggest rrd4j!
You can interrogate persistence about when a sensor last changed, without storing datetime. It’ll use the built in record time stamping.
You can ask what state the sensor was last Tuesday.
More difficult is asking what the last change before last Tuesday was - the information is there, but there are no integrated methods to query it.
The “last update” item for a sensor reading was just one example. I have other date-time values that I need to be able to see the history of, for example the last time an alert was issued, a date-time stamp sent from the PC indicating when it was last used, or a date-time set for a particular state to end.
I think there was an update that allows rrd4j to support dates. At it’s lowest level a date time is just the number of milliseconds since epoch (1970-01-01T00:00:00.000Z) which rrd4j can easily handle. However, rrd4j’s decimation/compression process might not be the right choice for date time data itself.
I migth not get it correctly but how are you going to handle/store all those on a single openHAB item. IMHO such diverse events are commonly stored in log-files.
Under many circumstances, rrd4j will give you a single ‘average’ of what was stored as two different datetimes, This is how the data compression gives the fixed table size.
I switched to influxDB since one year.
Works like a charm.
I can fully check & analyse the heating system parameters for instance.
And in openhab 3 this is great. Just put the field, define it in your persistence strategy and clicking on the field gives you automatically the graphs.
Peter
Hi David,
There are mechanisms to accomplish a retention period limit, not a size limit I think.
But that gives less or more the same result.
You can define retention policies though I have not yet done/tried it ( my pi 3B+ SD card has still plenty of room).
Here’s a link to the topic: Setting influx retention policy
Greetz
Peter