- 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:
- My system uses the default configuration
- 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