View rrd4j persistence data

I need to export the data in my rrd4j files to some readable format like CSV, XLS (or anything at all). I have tried REST API, rrdtool but still no luck. Any help would be useful.

Sincerely
Max

Look into the REST API, using that it should be possible to retrieve the data. I have used it to display the data, using the posted commands on the console should be possible as well.
What did you try with the REST API that made you say it isn’t working for you?

I just used the Request URL that gets displayed when doing a request on the GET /persistence/items/itemname page.
That request gave back the json for all values matching the item name requested for the requested timeframe You just need to get the values out of that json string!

Sounds great. Could you provide some information how to do this? I am kind of new to many thing, not only databases.

Sincerely
Max

Getting the values readable I showed above. What are you trying to do with those values? Are you familiar with the way rrd4j keeps the data? Serveral archives, all starting now and going back different timeframes.

@christoph_wempe wrote a tool that extracts values from persistence through the REST API and inserts them into InfluxDB. You could change the InfluxDB part to instead write out to CSV.

Although if you just want to see the values, the first part shows the REST commands to get the DB values in JSON format.

I installed REST API and made a Request URL (http://openhabianpi:8080/rest/persistence) that gave me a Response Body that indicated that I have rrd4j. That is nice. When I try http://openhabianpi:8080/rest/persistence/items?serviceId=rrd4j I get an empty Response Body []. I thought I get a list of all the items that is logged. Any ideas?

Sincerely,
Max

Hmmmmm. I’m seeing the same behavior. I wonder if that call has not been implemented yet or if there is a bug.

You should get a list of all the Items that are persisted. I’m not sure what is going on.

Ok, I tried to use get /persistence/items/{itemname} with the following settings:
serviceId: rrd4j
itemname: FoobotTemp1 (I am not sure that this is a valid item name but I got it from the chart in HabPanel)
starttime: 2017-10-01T00:00:00
endtime: 2017-10-02T00:00:100
The problem is that I get the following answer
{
“error”: {
“http-code”: 500,
“exception”: {
“class”: “java.lang.NullPointerException”
}
}
}
Any ideas, is the item name wrong and if that is the case, how to I find them?

Sincerely Max

Item name is one of your Items so you should be able to see it in your .items files or PaperUI. You should also have the Items listed in your .persist files unless you are using Groups to define your persistence.

1 Like

Thanks a lot. I have the data!
/Max

2 Likes