Tank Temp

For info on what software/hardware I’m using to gather and create these graphs, see the bottom of the page.

I’m posting this info not to display my code skillz, but rather despite it. I have no doubt that somebody who actually knows what they’re doing to probably combine all my individual steps into a single line of code. But in any case, if somebody is curious on how I’m doing it – this is it.

These charts are based on three different temperatures:
1) Tank temperature – sampled by an Aquacontroller III Pro, data gathered via wget/sed.
2) Air temperature/Sump temperature – sampled by DrDaQposted on http via DrAquarium, data gathered via w.get/sed.

** Note – I would NOT recommend either the DrDAQ system (multiple hardware failures within months of purchase, long expensive replacement process) or the DrAquarium software (long list of bugs make it basically unusable for it’s intended purpose), but since I made the mistake of buying both before I got the AquaController, I’m using them for simple current stat gathering. **

I created my rrdtool database with this command:

rrdtool create temp.rrd --start N --step 300 DS:airtemp:GAUGE:600:55:95 DS:sumptemp:GAUGE:600:55:95 DS:temp:GAUGE:600:55:95 RRA:MIN:0.5:12:1440 RRA:MAX:0.5:12:1440 RRA:AVERAGE:0.5:1:1440

I gather the webpages, and then parse the webpages for the number I need via a crude shell script that looks like this.

wget "http://ip.address.of.draquarium:port//plugins/DrDAQ/Report/DrDAQ.html"
wget "http://username:password@ip.address.of.aquacontroller:port/cgi-bin/status.cgi"
temp=`sed '3q;d' status.cgi | awk -F\> '{print $3}' | awk -F\ '{print $1}'`
airtemp=`sed '47q;d' index.html | awk -F\> '{print $2}' | awk -F\< '{print $1}' | awk '{print $2}'`
sumptemp=`sed '59q;d' index.html | awk -F\> '{print $2}' | awk -F\< '{print $1}' | awk '{print $2}'`

And then I update the rrdtool temperature database with this command.

rrdtool update temp.rrd N:$airtemp:$sumptemp:$temp

and to wrap it up, I graph the temperature with this command.

# temperature funky
rrdtool graph temp.png --title="Temperature" \
--vertical-label "Deg F" \
-w 600 -h 200 \
DEF:temp=temp.rrd:temp:AVERAGE \
DEF:airtemp=temp.rrd:airtemp:AVERAGE \
DEF:sumptemp=temp.rrd:sumptemp:AVERAGE \
AREA:airtemp#FF000044 \
LINE1:airtemp#FF0000:Sump_Room_Temperature \
AREA:sumptemp#00FF0044 \
LINE1:sumptemp#00FF00:Sump_Temperature \
AREA:temp#0000FF44 \
LINE:temp#0000FF:Main_Tank_Temperature \
'GPRINT:airtemp:LAST:Sump Room Last Temp\: %2.1lf F' \
'GPRINT:sumptemp:LAST:Sump Last Temp\: %2.1lf F' \
'GPRINT:temp:LAST:Tank Last Temp\: %2.1lf F' \
> /dev/null

Originally I just plotted the lines, but I think the area charts make it look better and easier to read. On the color indicator, it’s RR:GG:BB:TT with the codes matching to red/green/blue/transparent.

To make weekly/monthly/yearly/multi-year charts, I add the timeframe to the end of the graph string.

rrdtool graph tempweekly.png --title="Weekly Temperature" \
--vertical-label "Deg F" --start -1w \
-w 600 -h 200 \

Things to do:

Create database for lighting/heating/cooling, figure out visually appealing way to represent those items without making the graph too busy. Also, eventually migrate the entire ugly shell script to something like python or php, and look into using the google graph API instead of the rrdtool graph system.

Leave a Reply