changeset 9:139e267c9965

Use DERIVE instead of counter. Add graph example
author Daniel O'Connor <darius@dons.net.au>
date Thu, 21 Nov 2013 00:01:28 +1030
parents 08b192a6e189
children c1892bd1460a
files README
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/README	Wed Nov 20 23:44:55 2013 +1030
+++ b/README	Thu Nov 21 00:01:28 2013 +1030
@@ -1,16 +1,23 @@
 An RRD can be created like so..
 
-rrdtool create ~/meter.rrd		\
-	DS:import:COUNTER:600:U:U	\
-	DS:export:COUNTER:600:U:U	\
-	RRA:AVERAGE:0.5:1:105120	\
-	RRA:AVERAGE:0.5:12:105120	\
-	RRA:MAX:0.5:1:105120		\
-	RRA:MAX:0.5:12:105120		\
-	RRA:MIN:0.5:1:105120		\
+rrdtool create ~/meter.rrd \
+	DS:import:DERIVE:600:U:U \
+	DS:export:DERIVE:600:U:U \
+	RRA:AVERAGE:0.5:1:105120 \
+	RRA:AVERAGE:0.5:12:105120 \
+	RRA:MAX:0.5:1:105120 \
+	RRA:MAX:0.5:12:105120 \
+	RRA:MIN:0.5:1:10512 \
 	RRA:MIN:0.5:12:105120
 
 Then data added with..
 rrdtool update ~/meter.rrd `ssh -ay -i ~/.ssh/id_rpi pi@raspberrypi python iec1107/iec1107.py -r /dev/ttyUSB0`
 
+Graph with..
+rrdtool graph ~/html/power-day.png --start -86400 -t "Power import/export (last 24 hours)"\
+            DEF:import=$HOME/meter.rrd:import:AVERAGE \
+            DEF:export=$HOME/meter.rrd:export:AVERAGE \
+            AREA:import\#00FF00:"Imported (Wh)" \
+            LINE1:export\#0000FF:"Exported (Wh)"
+