Right now I have rrd4j for numeric values, and MapDB for dates, but I’d like historical values for dates too. I’m not clear which of the persistence options will do this, and what difficulty is involved in setting them up. Some of the docs I’ve found date back quite a few years.
I’d say any other supported database would be fine ( for example influxDB). MapDB doesn’t work since it keeps the last setting only, rrd4j doesn’t work since it’s special and can handle numericals only.
What makes you think documentation is outdated, did you look here? Use the lefthand sidebar and look for Data Persistence.
What are you trying to persist with “historical dates”? The persistence service of openHAB would persist a date with the date it was persisted, is that what you are looking for?
You might clarify that a bit - I’m reading as you want to store data values that just happen to represent some datetime but are unrelated to the recorded timestamp.
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