Rrdj4 more deteiled data

  • Platform information:
    • Hardware: Raspi 3
    • OS: Openhabian
    • openHAB version: stable

I’m playing around with some custom configuration on rrdj4.

I have a Item which represents energy consumption in watts. The device I’m looking at is a boiler which uses power every some hours for a short period of time.

Events.log

2019-09-01 12:49:03.845 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 0 to 1613
2019-09-01 12:49:09.886 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1613 to 1977
2019-09-01 12:49:15.985 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1977 to 1961
2019-09-01 12:49:21.978 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1961 to 1952
2019-09-01 12:49:28.017 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1952 to 1950
2019-09-01 12:49:34.111 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1950 to 1948
2019-09-01 12:49:40.100 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1948 to 1947
2019-09-01 12:49:46.145 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1947 to 1945
2019-09-01 12:49:52.188 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1945 to 1916
2019-09-01 12:49:58.275 [vent.ItemStateChangedEvent] - POWTester_WATTPOWTEST changed from 1916 to 0

I want to create a new data point every 15 seconds. When there are new values and wait for 60 seconds to get a value.

So I created a new entry in:

rrdj4.crg

genauer.def=GAUGE,60,U,U,15

genauer.archives=AVERAGE,0.5,1,1440:AVERAGE,0.5,2,1440:AVERAGE,0.5,4,2880:AVERAGE,0.5,12,2880:AVERAGE,0.5,24,2880:AVERAGE,0.5,48,3700:AVERAGE,0.5,200,3700

genauer.items=POWTester_WATTPOWTEST

The strategy to put new data in it:

rrdj4.persist

POWTester_WATTPOWTEST : strategy = everyMinute, everyUpdate

to get a new value at least every 60 secons which is 0 most of the times, and every new value when the power kicks in.

This configurations put this data in the rrd archive:

rest JSON:

{“time”:1567334940000,“state”:“0.0”},
{“time”:1567335000000,“state”:“1672.7499999999998”},
{“time”:1567335060000,“state”:“0.0”}

So new entry every 60 seconds. Looks like the default configuration.

Two possibilitys:

  1. My system uses the default configuration
  2. I don’t get the configuration right

I assume 2.

To maybe improve the documentaton I will picture my understanding of the configuration:

#defname.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],heartbeat,[min|U],[max|U],step

genauer.def=GAUGE,60,U,U,15

Gauge is a number which can be positive or negative value and will be stored as it is
heartbeat is the time in seconds in which a new value is accepted, if a value comes later it is marked as undefined.

The step value is a big question mark for me. I assume this is the time in seconds in which new entrys CAN be made when there is new data.

genauer.archives=AVERAGE,0.5,1,1440:AVERAGE,0.5,2,1440:AVERAGE,0.5,4,2880:AVERAGE,0.5,12,2880:AVERAGE,0.5,24,2880:AVERAGE,0.5,48,3700:AVERAGE,0.5,200,3700

Steps are the number averaged values saved in one row. So: AVERAGE,0.5,1,1440 = 1440 unique entrys and AVERAGE,0.5,2,1440 = every two unique values are one averaged enty.

I think this configuration must be right, because it has nothing to do with creating new entrys in the first place.

Maybe its not possible to create a new enrty every 15 OR 60 seconds in one rrd archive and I have to change the strategy in the persist file from 60 secons to 15 seconds.
But for what reason there is a step configurtion in #defname.def and this “everyChange” configuration in the documentation:

Items {
// persist items on every change and every minute
* : strategy = everyChange, everyMinute
}

Hope someone can see what I missed

I’m not sure if a 15 second rrd4j database would work, however IMHO a strategy every15seconds is needed to make it possible.
Anyhow,your custom archive looks odd to me, do you have a special reasoning?

Hey @opus thanks for your answer.

I try

every15Seconds : “0/15 * * * * ?”

since yesterday. But with no further investigation it is not working yet.

I don’t want the data to be averaged so tight after this short time.
Look at the last value.


Do you know a better way? :slight_smile:

Rrd4j is said to be needing a everyminute strategy, in this case it looks like it really does need exactly that.

Regarding the use of the consolidation function, with the custom setup you fix for which timeframe such a function is needed. Archive 1, with the step size of 1, is not consolidating ( the average/min/max of the value is the value).
You migth keep all data in an archive 1!
Aren’t the values of “0” your real problem?