[SOLVED] Rrd4j no charts. mapdb yes charts

Hello
sitemap chart line:

	Chart item=item_camara_int_temp_77 label="Temperatura"	period=h service="rrd4j"

If I select mapdb service, I do get a chart. A horizontal line, obviously. Below is my REST querry.
.rrd files DO get updated. but it would seem they only have 1 point.
I’m very confused, help!

#### Curl

curl -X GET --header "Accept: application/json" "https://192.168.12.44:8443/rest/persistence/items/item_camara_int_temp_77"

#### Request URL

https://192.168.12.44:8443/rest/persistence/items/item_camara_int_temp_77

#### Response Body

{
“name”: “item_camara_int_temp_77”,
“datapoints”: “1”,
“data”: [
{
“time”: 1574107069112,
“state”: “16.3”
}
]
}


#### Response Code

200

#### Response Headers

{
"content-length": "98",
"content-type": "application/json",
"server": "Jetty(9.4.11.v20180605)"
}

Please show your rrd4j.cfg file

it’s the default one

# configure specific rrd properties for given items in this file.
# please refer to the documentation available at
# https://www.openhab.org/addons/persistence/rrd4j/
#
# 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=<comma separated list of items for this defname>

Sorry I meant you rrd4j.persist file.

That COULD be due to your REST query with the default 24 houre timeframe. If you use that before more then one value has been saved to the archive 2 ( the one that covers 24 houres with one value every 4 minutes) you will get only one point.

However, as @vzorglub posted, show us your rrd4j.persist file. You might be missing the MANDATORY everyMinute strategy.

@vzorglub: Common failure, I always mix up .cfg and .persist file​:rofl::rofl:

Strategies {
 everyMinute : "0 * * * * ?"
 everyHour : "0 0 * * * ?"
 everyDay : "0 0 0 * * ?"
 every15min : "*/15 * * * * ?"
 default = everyChange
}

Items {
genv* : strategy = restoreOnStartup, everyChange
item_camara_int_temp_77* : strategy = restoreOnStartup, everyChange

and from default.items:

Number item_camara_int_temp_77      "Temperatura interioara camara [%.1f °C]"   <temperature>   (genv, gtemp)  { channel="mqtt:topic:NodeMCU-V3-8266-camara:temp-int-77", expire="10m" }

hmmm…am I misssing everyMinute? in strategy?

Yes. You must have everyMinute in your strategy.

2 Likes

Yes you are.
To use rrd4j persistence in openHAB you MUST use the everyMinute parameter
As per the docs… https://www.openhab.org/addons/persistence/rrd4j/

it should have worked even with everyChange, not?

I added everyMinute, waited a few minutes and I get the same result

"name": "item_camara_int_temp_77",
  "datapoints": "1",
  "data": [
    {
      "time": 1574154779733,
      "state": "16.3"

ok so it’s working now. also graphs start to populate.

{
  "name": "item_camara_ext_temp_76",
  "datapoints": "2",
  "data": [
    {
      "time": 1574155680000,
      "state": "12.475000000000001"
    },
    {
      "time": 1574155920000,
      "state": "13.0"
    }
  ]
}

what got me confused was that the previous queries were without service specified, and it defaulted to mapdb, that’s why I always got 1 datapoint, and indeed that was being updated on every change

so, for anyone reading this: if rrd4j is NOT the default service, you have to manually add it to REST query using serviceid parameter

Thanks!

Cool, please tick the solution post
I have changed the topic to persistence

I just found this. I don’t think the docs say that the everyMinute parameter is obligatory :thinking:

This is correct. It was in the last paragraph of the 2.5 docs. It has been omitted in the latest docs. :thinking: