OH2 and rrd4j

All,

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:

error while getting persistence data

Anything I might have missed?

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?

Hi @opus

it looks like it’s loaded normally:
openhab.log:

2016-09-26 13:26:21.707 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rrd4j.persist'

and the karaf console lists:

205 | Active | 80 | 1.9.0.201609250111 | openHAB RRD4j Persistence Bundle

So it should be ok…

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?

Correct.

You can leave it the way it is (if you are satisfied with the default settings).

Thanks @sihui,

so you mean the following doesn’t need to change.

# 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>

At least it has nothing to do with your mentioned problem, it only needs to be changed if you want to configure rrd4j in a more deeper way:

Thanks - so it looks like it should be running…
hmmm

Maybe I found your problem:
The file has to be named rrd4j.persist, not rrd4j.persistence!

You are right.
But actually this was already in OH the case and I did not change it.
Sorry for the confusion.

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

error while getting persistence data

so it seems the assignment seems to be wrong!?

Then you have mixed up the content in your *.persist files.

@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 is a lot of data, which migth NOT be needed!

:smiley:
No, I double checked that - but thanks for the hint

Then you likely persist the same data with rr4dj and my.openhab …:sunglasses:

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
}

Last idea: after changing any *.cfg files did you restart openHAB?

Thanks for not giving up on me :wink:
Yes I did restart in between.

So, to be on the safe side I did:

  1. Installation of openhabian including OH2
  2. Installation of all needed Bindings incl. rrd4j persistence (using Paper UI)
  3. kept standard rrd4j.cfg
  4. transferred rdd4j.persist file from /etc/openhab/configurations/persistence to
    /etc/openhab2//persistence
  5. set rrd4j as default in Paper UI (Config / System)
  6. added rrd4j in addons.cfg (persistence = rrd4j)

So does this ring a bell? something wrong / missing?

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!

Hi @opus,

thanks, that’s correct. I just put in the Groups because I am lazy :wink:
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).

Weird things do happen.