When you say the values are ‘wrong’ - how wrong are they? I believe RRD doesn’t (always) store ‘real’ values - the values can be slightly different as it uses the AVERAGE function. So if you store more than one value per time period, then the data will be the average of the two (a time period being 60 seconds).
Someone with better knowledge of RRD might correct me on this but if the values you get are ‘nearly correct but not what you expected’ this might explain it…
“wrong” means completely different values, not only slightly different. But mostly the values are all equal, especially after I changed something in my *.items file and it is being reloaded.
But my question is more related to what is the best way to figure out persistence handling (e.g. maximumSince(now.minusDays(2).withTimeAtStartOfDay).state) and so on.
How do I retreive historic data from rrd4j using OH methods?
I’m not completely sure I understand the question, however the persistence extensions, which are used to query data from the persistence stores are documented here. I suspect you already know that though since you’re using them, so I’ve probably not understood the question - sorry.
The other thing to do is to use HABmin to graph out the data to see what’s actually in the store - it looks like what you’re doing is correct, so this might mean that the RRD data is not being stored as you think it should be…