Well that's a smite for Perl straight off...

The next tool to look at is sqlite manager on firefox. That will allow you to start to learn how to extract information at the SQL level.
https://addons.mozilla.org/en-US/firefox/addon/5817That will demonstrate you how these questions are phrased.
http://docs.python.org/library/sqlite3.html#module-sqlite3 is one way of getting at the data from python, hopefully someone perlish well sling up the equvalent, and Java anyone?
That shows how you might interconnect the data with any other form of craziness you might have.
For instance think about how you would now construct the pump control code. ( don't worry about how you might operate a pump, just print Pump ON and probably more important PUMP OFF.)
You might discover you want one or several tables to define some parameters. The sort of thing that is essential would be the difference in temperatures at which you would pump ad how long to wait between readings.
settings = read_settings_from_database()
while 1:
sensor = read_sensors_and_database()
if sensor.roof > (sensor.coil + settings.temperature_diff ):
print 'pump On'
else:
print 'pump Off'
sleep (settings.wait_between_reads )
The good thing here is that rather than me having to go into the programme code and change these values I can change them in the database with some other chunk of code, running a nice flashy front end on a webpage for instance and the pump programme never need worry itself about that bit of data. It only needs to complain when read_settings_from_database() can't find anything and that's not the pump programmes concern anyway.
The calculation of how much Energy type questions is really one of display.
Quite how do you want to present the data?
Graphs ? Pie charts,? 3D surfaces, Flashing LED's, scrolling messages on all the music system displays around the house?, broadcast to the Internet? World War Three claxon ?!? all require default ranges values and some parameters, What colour is that graph? , how loud is that claxon? to be stored to describe your particular requirements. The important thing is whilst your designing your display requirements, the database is chugging away making readings.
http://documentation.openoffice.org/HOW_TO/data_source/SQLite.pdf Is one way of hooking openOffice into the sqlite3 database, which should let you do a bit of data using Open Office calc. once you have it as a datasource.
I have to say it's a bit crashy as I've tried it here, but that might just be my lack of experience with Officey type programmes.
I've certainly got the database end of OpenDoc hooked up.
But the question is one for yourself. How do you intend to present the data, and to whom?