MisterHouse is an open source home automation program. It's fun, it's free, and it's entirely geeky. Written in Perl, it fires events based on time, web, socket, voice, and serial data. It currently runs on Windows 95/98/NT/2k/XP and on most Unix platforms, including Linux.
Perl subroutines and objects are used to give a powerful programming interface. Here is some example code:
$fountain = new X10_Item 'B1';
set $fountain ON if time_now '6:00 PM';
$movement_sensor = new Serial_Item 'XA2', 'stair';
play(file =gt 'stairs_creek*.wav') if state_now $movement_sensor eq 'stair';
$v_bedroom_curtain = new Voice_Cmd '[open,close] the bedroom curtains';
curtain('bedroom', $state) if $state = said $v_bedroom_curtain;