Thursday, January 29, 2009

Log rotation

The heating system of my house creates a log file per week, per zone ( currently 3 zones: living room, kitchen and sleeping room). Every week, and on the same day of the week as the first day of the year, it starts a new log file. So to see the nice little graphs plotting temperature - actual and desired - and valve state, once a week, I have to ssh onto the server, manually adapt a little script and run it.
Until today!
I finally beat my laziness, and wrote a php script, took about 5 minutes to write. It is a brute force script just to get the job done. This to prove that a lot of time is wasted in activities that can very easily be automated and are of no interest to be kept manual.
So here is my script.
All, or almost all of my home automation run on php scripts being executed by a crontab.
Now, once a year I'll have to adapt the crontab file...maybe I should think about automating that also..

$comand = "rm kitchen.log livingRoom.log sleepRoom.log";
exec($comand);
$comand = "ln -s kitchen-";
$comand = $comand . date("Y-W");
$comand = $comand . ".log kitchen.log";
exec($comand);
$comand = "ln -s livingRoom-";
$comand = $comand . date("Y-W");
$comand = $comand . ".log livingRoom.log";
exec($comand);
$comand = "ln -s sleepRoom-";
$comand = $comand . date("Y-W");
$comand = $comand . ".log sleepRoom.log";
exec($comand);

and the crontab line

#once per week, for 2009 on thursday, first thing in the day, rotate the logs
15 0 * * thu /usr/bin/php /tmp/automate_log_change.php

Wednesday, January 28, 2009

New developments!

I decided that all the effort in measuring electricity and gas shouldn't go unnoticed in the house, so I decided to make a light indicating the status of the house. Furthermore, when arriving home, the only way to know if someone had rang he door was to check my intranet (on the iPod Touch), although, at work I can see it in twitter anyway.

So, I bought an RGB led, one with 6 legs - strange - the pinout is in the image. Some simple connections to the Arduino and a small fading program later, and I had an initial prototype.


My idea is to have a small switch connected to it to reset the doorbell indicator.

So on to the enclosure.
I had laying around a ball from some promotional thing, which splits in 2 halves. The ball is rather big - about 7cm in diameter - which makes it look good, and has a rough finish which is also good to difuse the light...although not good enough. So I tried roughing it further with sandpaper and some other mechanical tools, but no good result. The solution appears to be paint! - A light cover of white paint from a can.



I made all these experiments in one of the halves, now i have the other half to do the real thing. Hopefully soon!

Tuesday, January 20, 2009

3 years of gas consumption logging

For the last 3 years, since we have been in our current house, I have been taking very regular readings of the gas and electricity meter, usually daily, sometimes, skipping a day or 2. Recently, I have automated that process with the help of an Arduino and some additional electronics. That has removed the burden of collecting the data, and allows to see the evolution of the consumption to the minute! (note to self, explain the circuit to collect gas data!)
But all this accumulated data also has a good purpose, besides making nice graphics. It allows me to evaluate the measures I put in place to reduce the overall energy consumption.
In the first year, we only had an old Honeywell thermostat, manually operated. That was replaced in the second year by a fully automated system (see post regarding the uptime of the server). In the 3rd year nothing changed, but now that the 4th year is about to start, I am about to finish the roof insulation. All the accumulated data allows me to compare the increase in performance.
So here is a graphic of the monthly gas consumption for the last 3 years, along with the average temperature for that month as reported by the KNMI (dutch meteorologic institute) for Holland.

It is funny to see the relation to the temperature. In fact, from the data of the first year, I have managed to calculate a second order curve which relates temperature to gas consumption, so for a given monthly average, I can calculate how much the consumption would be. It is using this curve that I calculate my savings. I'll elaborate more on that soon.

Worth noticing is also the fact that December 2008 was much colder than December 2007, yet the gas consumption remained similar. I attribute that to the roof insulation, which I did mostly during November (not yet 100% finished).

Saturday, January 17, 2009

More tablet news


Continuing, or better resuming, my activities with the tablet, I installed the bundled ArtRage, and I must admit I really like it...it is just a pity that I can't draw...But I'll use it for the future sketches of circuits.
I used it to make an icon for my twitter feed. I think it came out pretty good!

Hopefully more posts this weekend about the insulation and temperature controls!

Tuesday, January 13, 2009

4 months non-stop temperature control


As I mentioned briefly before, the heating in my house is controlled by a server, running linux, obviously.
I use the devices from elv.de to control the temperature in the rooms, but, when I started the system there was no way to turn the boiler on and off according to the need for heat in the house, so I developed a script myself, in php, using the FHZ1000 linux server available from here (I haven't upgraded to the FHEM yet, still in the previous version), which reads all data from the system and decides if we need to turn the boiler on or off. I then use an FS20 Switch to control it. But I'll elaborate on that one of these days.
The system has been setup for more than 2 years now, with no major glitches or problems, and heating consistently and comfortably. Furthermore, according to my calculations, the system already payed for itself.
Of course, I turn the server down every once in a while for maintenance or upgrades, but it is now 122 days, or 4 months since it was last turned on! that means that the whole heating seasons it has been on! I'll try to go up until April when I usually turn the boiler off, without rebooting the server!

For the technically minded, the server is a Jetway MiniITX board, with 512Mb of RAM, a TinyPSU and a 2.5" hard disk, running OpenSuse 10.3. It consumes only 25W of power, in an enclosure made by myself.

I'll keep you posted!