Possibility to "write" historic data into persistence db?

Hello!
is it possible to edit the (rrd4j) persistence data of an item?

Given how rrd4j works, the answer is probably no unless you really know what you are doing. The problem is it saves a value every minute (or three or what ever the current settings are). Then once the data gets old enough, it replaces ten of those entries with the average of those entries. When those entries get old enough again ten entries get replaces with the average.

So you have to take all that into account . If the entries are recent enough you’ll have to replace many entries, not just one and you’ll have to figure out which ones. If they are old enough, you’ll have to recalculate the averages, but even then you might no longer have the values to calculate the averages with.

hi Rich!
the are no entries to replace, there are no values at all.
but i have historic values that i’d like to write into the db.
would be enough if i can only enter one value per month (takes a while before rrd4j compresses that range, right?).

It depends. You have to have a really good understanding of how rrd4j is set up and when it does the compressions. If you enter values that are three days old or less, you need to enter a value every minute. But if it’s a week old to three days old you need to enter a value every ten minutes. If it’s a month old to every week old you have to enter a value every 100 minutes. An entry has to be there whether or not it’s different from the previous entry in the database. It depends on there being a fixed number of entries over a given period of time.

But those time ranges and the number of entries required above I just made up. You’ll have to research what the real time periods and how many entries are required (as well as how to structure the entries and timestamps and such).

You’ll also need some external tools to open and modify the database because I don’t know that the OH REST API is going to work for this.

1 Like

i just a general idea on how rrd4j works and the data i’m talking about would be nice to have and is absolutely not essential, so i guess i will live with the data from now on.
thanks for the clarification though!