I just started using RRD4J for storing my power consumption via some Xiaomi plugs.
I get some very strange values, here are some from REST API:
{
"name": "intPlug_PC_Load",
"datapoints": "9",
"data": [
{
"time": 1515586200000,
"state": "14608731.0136054418981075286865234375"
},
{
"time": 1515586500000,
"state": "7.13999999999999968025576890795491635799407958984375"
},
{
"time": 1515588600000,
"state": "0"
},
{
"time": 1515597600000,
"state": "0"
},
{
"time": 1515597900000,
"state": "5.45999999999999996447286321199499070644378662109375"
},
{
"time": 1515598200000,
"state": "10.910000000000000142108547152020037174224853515625"
},
{
"time": 1515598500000,
"state": "14316542.96333333291113376617431640625"
},
{
"time": 1515598800000,
"state": "14316555.13333333469927310943603515625"
},
{
"time": 1515599100000,
"state": "14316556.813333332538604736328125"
}
]
}
first of all, Is there an easy way to interped the time stamp?
I can seem to reconize the state values, it don’t seem to reflect my item state at least. These should be in watt so my computer seems to use a lot of electricity sometimes.
There are my setup, I’m compleatly new to this so I might have some strange settings here (feel free to suggest other)
rrd4j.persist:
// Persistence strategies have a name and a definition and are referred to in the "Items" section
Strategies {
everyMinute : "0 * * * * ?"
// If no strategy is specified for an item entry below, the default list will be used.
default = everyMinute
}
/*
* 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 {
gPowerLoad* : strategy = everyMinute, everyUpdate, restoreOnStartup
}
rrd4j.cfg:
# please note that currently the first archive in each RRD defines the consolidation
# function (e.g. AVERAGE) used by OpenHAB, thus only one consolidation function is
# fully supported
#
# default_numeric and default_other are internally defined defnames and are used as
# defaults when no other defname applies
#<defname>.def=[ABSOLUTE|COUNTER|DERIVE|GAUGE],<heartbeat>,[<min>|U],[<max>|U],<step>
#<defname>.archives=[AVERAGE|MIN|MAX|LAST|FIRST|TOTAL],<xff>,<steps>,<rows>
#<defname>.items=<list of items for this defname>
#ctr5min.def=COUNTER,900,0,U,300
#ctr5min.archives=AVERAGE,0.5,1,365:AVERAGE,0.5,7,300
#ctr5min.items=Item1,Item2
ctr5min.def=COUNTER,900,0,U,300
ctr5min.archives=AVERAGE,0.5,1,365:AVERAGE,0.5,7,300
ctr5min.items=intKitchen_Media_Load,intPlug_Stue_Anleag_Load,intPlug_PC_Load,intPlug_Stue_LAMPE_Load