Strategies {
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
// if no strategy is specified for an Item entry below, the default list will be used
default = everyChange
}
/*
* Each line in this section defines for which Item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* Item (excl. the group Item itself).
*/
Items {
* : strategy = everyChange, restoreOnStartup
}
Has been so for years, and I have logs for other items.
The tibber-items file is fairly new (about 10 days), so I should have enough days. However looking at the UI on the items, I can “Analize” other items, but not this tibber-item, no data is shown in the graph.
Is it something with a new item-file, does OH need to restart to “fetch” new items?
I’m not sure you can expect sensible charting from an rrd4j database with default configuration, when you don’t have a regular time-based persist strategy.
I’m surprised that has ever worked. rrd4j requires a once a minute strategy or else it can’t generate charts and most of the persistence calls will fail too.
I can’t explain why you’re other items work and this one does not but I can say that that config for rrd4j shouldn’t work for any items. Maybe the items that are working change often enough that this misconfiguration is hidden.
Do you have a suggestion for the setup of persistence. I think I setup persistence at some point to have the restore of item status after restarting OH.
I see that my file is more or less a copy of the example from docs.
I haven’t used historical data so far
My understanding is rrd4j is a time-based storage format for charting. It requires that each data point is recorded at a uniform (equal) interval e.g. every X seconds. Furthermore, because it is a “fixed size” database, it would remove and summarise older data so that they would have less “density”. The older it gets the less dense. It was originally meant to store charting data for rrdtool. See RRDtool - rrd-beginners
In contrast, influxdb is a more traditional storage, what you put in it will stay in there. It does have a retention policy that you can configure, e.g. keep everything or delete anything older than 1 year, etc.
For what you seem to need, influxdb is far more appropriate, imo.
Thank you @rlkoshak , @rossko57 and @JimT .
(I think) I understand the rrd4j better now. I am fine with archiving older data with less granularity, since I don’t use the older data, not yet anyway.
Item TibberAPICurrentTotal updates once every hour (the binding fetch data from API) while other data updates more often (modbus-binding polling local data consistently)
Probably I have had so many changes per time unit for the other values I randomly checked so I haven’t noticed the lack of data.
If I understand this correct I need to store data I want to use the statistic functionality on at least every minute.
I try this setup now, and I now get the average for TibberAPICurrentTotal, so that works!
I want to restore all items on startup.
If I in the future need other data to chart or calculate on I add those items to the everyMinute-strategy.
Strategies {
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
// if no strategy is specified for an Item entry below, the default list will be used
default = everyChange
}
/*
* Each line in this section defines for which Item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* Item (excl. the group Item itself).
*/
Items {
* : strategy = restoreOnStartup
TibberAPICurrentTotal : strategy = everyMinute
}
Have I understood the persist-settings would you say?
As @rossko57 said, Mapdb is a better choice fore restoreOnStartup. It can save all data types whereas rrd4j can only save numerical data.
You can have more than one persistence installed at a time and I believe that MapDB, by default, will restoreOnStartup all your Items. So I’d remove the restoreOnStartup strategy from rrd4j and configure rrd4j to store all your Items once per minute and on every change for your charting.
To have a seamless integration with MainUI, configure rrd4j as the default persistence under Settings.