I wanted to add an historic state for an item, that was newly created, but when using the blockly element for persist item state at a given time, this WARN pops up in the openhab.log:
[ WARN ] [nce.extensions.PersistenceExtensions] - There is no modifiable persistence service registered with the id ‘rrd4j’
what does that mean an how can I modify/create old states of items with blockly? Or is it only possible with other means?
I have a kWh meter item, so these are actual numbers. I just want to send 0 to a specific date in the past so that difference-last has something to compare to.
But why, is there no way? Ive read about some commands that are able to access past states in RRD4J and change them or even add new ones. Even though its round-robin, it should still have some sort of access?
I just want to use the standard-features of OH and one of them is using a graph that shows the difference to a past period, ie. a monthly and a yearly graph for example. But for that there must be a past value in the previous period. I just want to add this one value.
Ultimately it’s you can’t do that with rrd4j. You’ll have to use some other database for this use case.
I am pretty sure you can’t write new values except to the first bucket and even there new values have to be after the most recently written value.
Where have you read these? It’s more than just roud-robin. It’s also fixed size. An rrd4j database never grows. It accomplishes this by decimating older values. In order to do that decimation, it requires a fixed number of entries over a certain time period (that’s why everyMinute is required as a persistence strategy). If you are able to arbitrarily add or modify entries it bypasses and breaks the compression algorithm. Therefore it’s not supported.
But that doesn’t work for rrd4j. It needs one value every so often (depending on how old the data is, for recent data it’s one value every minute). To add that one value you would need to update the currently stored value at the time it was created plus everyX (where X is a different amount of time depending on which bucket the data is in give the age of the data) after that until it changed to something else.
If you need to just insert one value here or there, you need to use a different database.
Im aware of the fixed size and thats also the reason for me to write “modify”, because due to this fact, when you create a new item, you will have instantly a database that reaches back as far as the current setting goes (like 10years in default settings) but with NULL entries.
What I want to do is to access the affected buckets and change the NULL up to a certain point to an actual zero. Like formatting an harddrive. That should be super simple even for RRD4J.
But also adding other values shouldnt be an issue as the distribution of the values is always know, due to the fixed nature. So if you go back 1 year, than its clear that it has to be bucket 3 and that one value covers one hour. So the implementation for a random write persistence service shouldnt be more than 50 lines of code.
Could someone point me to a good starting point where the current RRD4J implemention in the code is? I would like to check wether or not its really that easy.