I am running OH2 on a raspi and have problems running rrd4j.
I copied my functional rrd4j.persistence into /etc/openhab2/persistence and changed the addon.cfg accordingly:
# A comma-separated list of persistence services to install (e.g. "rrd4j,jpa")
persistence = rrd4j
In Paper UI rrd4j is selected in configuration / system, but I get in openhab.log:
There is no queryable persistence service registered with the id 'rrd4j'
And Habmin: Configuration -> Persistence shows all the items, but the error message:
That looks like no persistence service is loaded. Did you check if rrd4j is listed under bundle: list on karaf?
Do you have a rrd4j.cfg under ./ conf/services?
I wonder if it’s case sensitive? rrd4j in addons.cfg is .ne. RRD4j (karaf) !?
the rrd4j.cfg is in /etc/openhab2 but I recognized that it just contains the default settings.
I thought it’s done with placing the rrd4j.persistence in my persitence folder!?
So how to configure the rrd4j.cfg?
# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies
#<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#<defname>.items=<list of items for this defname>
The strange thing is, that my items defined in the rrd4j.persist file are shown if I go to habmin -> Configuration -> persistence and select service -> my.openhab persistence.
When I switch the service to rrd4j the items are gone and I get
@sihui Thanks for stepping in. It looks like I was on a wrong track.
As for the .cfg file. Definitly yes, when the default setting is OK, the is no need to change the .cfg file. However if the amount of data that is saved and how it is saved needs to be customised you can do that in there.
[edit]
The default setting will save data like
-every minute for last 4 houres
-one sample for each 4 minute step for the last 24 houres
-one sample for each 14 minute step for the last 150 houres (i.e 6,xx days)
-one sample for each 60 minute step for the last 720 houres (i.e. 30 days)
-one sample for each 720 minute step (i.e. 12 houres) for the last 365 days
-one sample for each 10080 minute step (i.e. 7 days) for the last 3640 days (10 years!)
That’s my guess as well, but I did not specify it the same way:
rrd4j:
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
// for rrd charts, we need a cron strategy
everyMinute : "0 * * * * ?"
}
Items {
// which data to be stored
G_Harmony*, G_Lights*, G_WLAN*, G_Mobiles*, G_Fritz*, G_Strega*, G_Irrigation*, G_Wetter*, G_Netatmo*, G_Abus*, G_Windows*, G_Melder*, G_Sonne*, G_Wecker*, G_Location_Enzio*, G_Location_Dona*, G_Loc_mqtt_Dona*, G_Loc_mqtt_Enzio*, G_Mobiles*, G_Presence*, G_Homecoming*, G_System*, G_Netzwerk*, G_All_OFF* : strategy = everyMinute, everyChange, restoreOnStartup
}
my.openhab
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
// for rrd charts, we need a cron strategy
everyMinute : "0 * * * * ?"
}
Items {
// which data to be stored
}
Looking at the differences of your rrd4j and myopenhab persist setup. Only for rrd4j you are persisting any items? All of them are groups. Rrd4j can only persist numerical data!
thanks, that’s correct. I just put in the Groups because I am lazy
HOwever I got persistence for ON/OFF items (switches9 as well.
But this might be the case because it’s logged in the graphs as 0/1 so numbers as well.
Anyway - I found out, that removing myopenhab from the addon.cfg helped to run rrd4j. All rrd4 files are generated now.
So now I got:
# A comma-separated list of persistence services to install (e.g. "rrd4j,jpa")
persistence = rrd4j
and not rrd4j,myopenhab
What’s weird though is, that I had this yesterday the same way (see above).