ariela
(Andrea Riela)
January 12, 2019, 4:43pm
1
Hi folks,
I’ve a strange issue with rrd4j. I see only the last value, via REST API I see datapoints “1” with the latest value. Any time the value of the item changes, it changes also there, but I can see always the latest one.
What should be the problem?
here my persist:
// Configuration file for "rrd4j" persistence module
Strategies {
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}
/*
* Each line in this section defines for which item(s) which strategy(ies) should be applied.
* You can list single items, use "*" for all items or "groupitem*" for all members of a group
* item (excl. the group item itself).
*/
Items {
gChart* : strategy = everyMinute
}
thanks for the support
Andrea
vzorglub
(Vincent Regaud)
January 12, 2019, 4:53pm
2
Sorry, Andrea but your question is not very clear.
Can you post your REST query and reply?
1 Like
ariela
(Andrea Riela)
January 12, 2019, 5:01pm
3
curl -X GET --header "Accept: application/json" "http://192.168.10.1:8080/rest/persistence/items/Netatmo_Outdoor_Temperature"
REPLY
{
"name": "Netatmo_Outdoor_Temperature",
"datapoints": "1",
"data": [
{
"time": 1547312151239,
"state": "6.900000095367431640625"
}
]
}
what I mean is: the value in state is changing, the number of datapoints is always 1, and I see in my charts a beautiful horizontal line with just one value
ariela
(Andrea Riela)
January 12, 2019, 5:07pm
4
Now the REPLY is
{
"name": "Netatmo_Outdoor_Temperature",
"datapoints": "1",
"data": [
{
"time": 1547312758792,
"state": "6.19999980926513671875"
}
]
}
state and time are changed … but …
opus
(Jürgen Baginski)
January 12, 2019, 5:57pm
5
Do you have a custom rrd4j.cfg? If yes, please post.
Did you do any changes on your rrd4j setup without restarting?
BTW: You are living in a hot surrounding!
ariela
(Andrea Riela)
January 12, 2019, 6:04pm
6
eheheh, now is 4 C but yes, Italy is not so cold these days.
Just restarted, but nothing happened. My rrd4j.cfg is default (all commented out)
edit: my persist strategy now is:
gChart* : strategy = everyChange, everyMinute
opus
(Jürgen Baginski)
January 12, 2019, 6:09pm
7
You are persisting a Group (gChart), does the “Netatmo_Outdoor_Temperature” belong to that group?
Do all members of that group show the same behaviour?
… and I’m hoping that it is getting a bit warmer from tuesday to thursday. Going to stay near Catania then.
ariela
(Andrea Riela)
January 12, 2019, 6:11pm
8
Good for you, Catania is beautiful. Unfortunately, Milan here
“Netatmo_Outdoor_Temperature” is part of gChart.
And all member of that group (in facts, all items I would like to see in my rrd4j graphs, not only temps … but all numbers of course) have same issue
ariela
(Andrea Riela)
January 12, 2019, 6:21pm
9
just to give you all details:
Number Netatmo_Outdoor_Temperature "Temperature [%.1f °C]" (gOutdoor, gWeather, gChart, gHistory)
gHistory is the group managed by another persistence (influxdb), working perfectly
by default, I use mapdb (restoreonstartup)
opus
(Jürgen Baginski)
January 12, 2019, 6:21pm
10
That really sounds strange!
As a wild guess, you could try this request in the browser:
http://192.168.10.1:8080/rest/persistence/items/Netatmo_Outdoor_Temperature?serviceId=rrd4j&starttime=2019-01-09T00%3A00%3A00.000Z&endtime=2019-01-10T00%3A00%3A00.000Z
That would look for older values and definitly for the rrd4j database.
While writing it ocured to me that you might have mapdb as the default persistence service. Omitting the persistence service in a REST call and in the chart setup will always call the default persistence service!
2 Likes
ariela
(Andrea Riela)
January 12, 2019, 6:23pm
11
REPLY:
|name|"Netatmo_Outdoor_Temperature"|
|---|---|
|datapoints|"32"|
|data||
|0||
|time|1547309760000|
|state|"15.533333460489908"|
|1||
|time|1547310000000|
|state|"12.399999618530273"|
|2||
|time|1547310240000|
|state|"12.399999618530273"|
|3||
|time|1547310480000|
|state|"12.399999618530273"|
|4||
|time|1547310720000|
|state|"12.399999618530273"|
|5||
|time|1547310960000|
|state|"11.499999761581421"|
|6||
|time|1547311200000|
|state|"8.800000190734863"|
|7||
|time|1547311440000|
|state|"8.800000190734863"|
|8||
|time|1547311680000|
|state|"8.050000190734863"|
|9||
|time|1547311920000|
|state|"7.800000190734863"|
|10||
|time|1547312160000|
|state|"7.575000166893005"|
|11||
|time|1547312400000|
|state|"6.900000095367432"|
|12||
|time|1547312640000|
|state|"6.900000095367432"|
|13||
|time|1547312880000|
|state|"6.3749998807907104"|
|14||
|time|1547313120000|
|state|"6.199999809265137"|
|15||
|time|1547313360000|
|state|"6.0249998569488525"|
|16||
|time|1547313600000|
|state|"5.5"|
|17||
|time|1547313840000|
|state|"5.5"|
|18||
|time|1547314080000|
|state|"5.299999952316284"|
|19||
|time|1547314320000|
|state|"5.099999904632568"|
|20||
|time|1547314560000|
|state|"5.099999904632568"|
|21||
|time|1547314800000|
|state|"4.8750001192092896"|
|22||
|time|1547315040000|
|state|"4.800000190734863"|
|23||
|time|1547315280000|
|state|"4.650000095367432"|
|24||
|time|1547315520000|
|state|"4.5"|
|25||
|time|1547315760000|
|state|"4.5"|
|26||
|time|1547316000000|
|state|"4.199999809265137"|
|27||
|time|1547316240000|
|state|"4.199999809265137"|
|28||
|time|1547316480000|
|state|"4.1499998569488525"|
|29||
|time|1547316720000|
|state|"4.099999904632568"|
|30||
|time|1547316960000|
|state|"4.099999904632568"|
|31||
|time|1547317200000|
|state|"4.0"|
opus
(Jürgen Baginski)
January 12, 2019, 6:26pm
13
That’s it!
To change either set rrd4j as the default persistence service or set rrd4j explicitly in each chart line.
2 Likes
vzorglub
(Vincent Regaud)
January 12, 2019, 6:31pm
16
You can also specify which persistence service to use in the chart elements in the sitemap:https://www.openhab.org/docs/configuration/sitemaps.html#element-type-chart
ariela
(Andrea Riela)
January 12, 2019, 6:31pm
17
exactly what I did … and it works
thanks
vzorglub
(Vincent Regaud)
January 12, 2019, 6:34pm
19