mircsicz
(Mirco Schmidt)
March 13, 2018, 6:50pm
#1
Platform information:
Hardware: RPi 3
OS: OpenHABian
Java Runtime Environment: 1.8 u151
openHAB version: 2.2
I’ve created a group and have setup rrd4j persistence. The file’s are created but when I try to plot it all I see is an empty chart:
https://snag.gy/LXn6Hp.jpg
What am I missing?
n_c
(nc)
March 13, 2018, 6:55pm
#2
Post your item and your persist-configuration please.
Use RestAPI to check the stored data.
mircsicz
(Mirco Schmidt)
March 14, 2018, 10:25am
#3
Hi n_c,
THX for the reply… here’s the Item’s I want to plot:
openhab> items list
HG_Temperatur (Type=NumberItem, State=5, Label=Temperatur, Category=null)
HG_Luftdruck (Type=NumberItem, State=977.00, Label=Luftdruck, Category=null)
HG_Luftfeuchtigkeit (Type=NumberItem, State=85, Label=Luftfeuchtigkeit, Category=null)
Diesel_BN_JET (Type=NumberItem, State=NULL, Label=Diesel BN Jet, Category=null, Groups=[diesel_group])
Diesel_BN_AVIA (Type=NumberItem, State=NULL, Label=Diesel BN AVIA, Category=null, Groups=[diesel_group])
diesel_group (Type=GroupItem, Members=2, State=NULL, Label=Diesel, Category=car)
And this is the related rrd4j.persist file:
// persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}
Items {
HG_Luftdruck : strategy = everyMinute, restoreOnStartup
HG_Luftfeuchtigkeit : strategy = everyMinute, restoreOnStartup
HG_Temperatur : strategy = everyMinute, restoreOnStartup
Diesel_BN_JET : strate`Preformatted text`gy = everyHour, restoreOnStartup
Diesel_BN_AVIA : strategy = everyHour, restoreOnStartup
}
But how do I use the REST API to check the stored data?
EDIT: found this topic and from there tried to adopt the URL:
http://hab:8080/rest/persistence/items/ItemDiesel_BN_JET?serviceId=rrd4j&starttime=2018-13-03T12%3A00%3A00.000
n_c
(nc)
March 14, 2018, 10:31am
#4
Hi all,
to create a custom graph I try to query rrd4j with a given start time stamp (to be able to plot the last day, week, month … etc). When I try request using a starttime I always get exactly 24 data points. Strangely the time stamps (according to my calculations, which might be wrong) do not match the period I requested:
http://haus:8080/rest/persistence/items/ItemServerCpuLoad?serviceId=rrd4j&starttime=2017-02-05T12%3A00%3A00.000
Reponse:
{
"name": "ItemServerCpuLoad",
"datapoints"…
I dont understand following api behavior.
If i send a get request on which items are available from persistence service i get an empty result and
it makes no difference with or without url param serviceId set…
[image]
In case i request a specific item i get persisted data…
[image]
So that makes no sense for me. Or im missing some link here
mircsicz
(Mirco Schmidt)
March 14, 2018, 10:37am
#5
Seems the Diesel RRD file’s hold no data:
{"name":"Diesel_BN_AVIA","datapoints":"0","data":[]}
whilst the Yahoo Weather Data in HG_Temperatur seems to be fine:
http://hab:8080/rest/persistence/items/HG_Temperatur?serviceId=rrd4j
{"name":"HG_Temperatur","datapoints":"360","data":[{"time":1520937600000,"state":"8"},{"time":1520937840000,"state":"8"},{"time":1520938080000,"state":"8"},{"time":1520938320000,"state":"8"},{"time":1520938560000,"state":"8"},{"time":1520938800000,"state":"8"},{"time":1520939040000,"state":"8"},{"time":1520939280000,"state":"8"},{"time":1520939520000,"state":"8"},{"time":1520939760000,"state":"8"},
As I’ve configured MQTT persistence too I saw that “Diesel_BN_JET” & “Diesel_BN_AVIA” both have correct value’s:
n_c
(nc)
March 14, 2018, 10:39am
#6
https://docs.openhab.org/addons/persistence/rrd4j/readme.html#example
The strategy everyMinute must be used, otherwise no data will be persisted (stored).
There is a error in the syntax also.
mircsicz
(Mirco Schmidt)
March 14, 2018, 10:53am
#7
Thank you can’t find the syntax error but as I changed it to everyMinute it now plot’s data…
n_c
(nc)
March 14, 2018, 10:55am
#8
Maybe it’s only in the post.
mircsicz
(Mirco Schmidt)
March 14, 2018, 10:57am
#9
It seems that was just a copy & paste issue in my posting…
n_c
(nc)
March 14, 2018, 11:08am
#10
If it’s solved, you can mark so.
mircsicz
(Mirco Schmidt)
March 14, 2018, 11:15am
#11
Sure, THX for the reminder