oh my lord
if one saves to rrd container as watts or any base metric unit ( litre, metre, joules, or gram) use this a to generate your graph
the kw listed ie ( DEF:kw=wind.rrd:kw:AVERAGE ) is just the name of the data container within the larger RRD file , you can put multiple data containers with in single RRD file . if using units other then watts just change the watts to match your unit ie grams GPRINT:kw:AVERAGE:"%6.4lf%swatts" to GPRINT:kw:AVERAGE:"%6.4lf%sgrams"
#!/bin/bash
now=$(date +%s)
now_formatted=$(date +%s | awk '{printf "%s\n", strftime("%c",$1)}' | sed -e 's/:/\\:/g')
/usr/bin/rrdtool graph /var/www/html/24hrsw.png \
-w 650 -h 120 -a PNG \
--slope-mode \
--start -86200 --end now \
--title "Wind: For the Last 24 Hours" \
--vertical-label "WATTS (W)" \
--color CANVAS#2a2a2a \
--color BACK#2a2a2a \
--color FONT#FFFFFF \
DEF:kw=wind.rrd:kw:AVERAGE \
VDEF:Last=kw,LAST \
VDEF:First=kw,FIRST \
VDEF:Min=kw,MINIMUM \
VDEF:Peak=kw,MAXIMUM \
VDEF:Average=kw,AVERAGE \
CDEF:kWh=kw,10,/,168,* \
CDEF:Cost=kwh,.0665,* \
LINE1:kw#0e9110:"Wind" \
AREA:kw#ffc015:"" \
HRULE:Average#9595FF:"Avg" \
GPRINT:kw:AVERAGE:"%6.4lf%sw"
HRULE:Peak#ff0000:"Peak" \
GPRINT:kw:MAX:"%6.3lf%sw" \
HRULE:Min#58FAF4:"Min" \
GPRINT:kw:MIN:"%6.4lf%sw" \
GPRINT:kWh:AVERAGE:" total %6.2lfw\\n" \
if one saves data as kW in the RRD container ( but it will still display incorrectly on the vertical display as any listed data below 1kW will still be listed as m) as you have no control of that…
#!/bin/bash
now=$(date +%s)
now_formatted=$(date +%s | awk '{printf "%s\n", strftime("%c",$1)}' | sed -e 's/:/\\:/g')
/usr/bin/rrdtool graph /var/www/html/24hrsw.png \
-w 650 -h 120 -a PNG \
--slope-mode \
--start -86200 --end now \
--title "Wind: For the Last 24 Hours" \
--vertical-label "KILOWATTS (KW)" \
--color CANVAS#2a2a2a \
--color BACK#2a2a2a \
--color FONT#FFFFFF \
DEF:kw=wind.rrd:kw:AVERAGE \
VDEF:Last=kw,LAST \
VDEF:First=kw,FIRST \
VDEF:Min=kw,MINIMUM \
VDEF:Peak=kw,MAXIMUM \
VDEF:Average=kw,AVERAGE \
CDEF:kWh=kw,10,/,168,* \
CDEF:Cost=kwh,.0665,* \
LINE1:kw#0e9110:"Wind" \
AREA:kw#ffc015:"" \
HRULE:Average#9595FF:"Avg" \
GPRINT:kw:AVERAGE:"%6.4lfkW" \
HRULE:Peak#ff0000:"Peak" \
GPRINT:kw:MAX:"%6.3lfkw" \
HRULE:Min#58FAF4:"Min" \
GPRINT:kw:MIN:"%6.4lfkW" \
GPRINT:kWh:AVERAGE:" total %6.2lfkW\n" \