In the second of our new “My Automated Home” series, Richard Farthing takes us on a tour of his green open source House. On a budget of less than £600 the Linux setup looks after property whilst keeping an eye on the carbon footprint too. read on for the free software recommendations, the Joggler photos, tips, the what he’d do differently next time and the what’s coming next.
The green open source house – submission By Richard Farthing CEng MIET. This is the story of how I built a functional, reliable, low cost, and reasonably low power, automated home solely with open source software.
Let’s set the parameters. The house is quite small with just 2 bedrooms, the aim was to provide automation functions, music and reliable SD TV services, as HDTV is a fast-moving area, it was specified as a “nice to have” if straightforward solutions permitted. This puts it at the opposite end of the spectrum to those houses that need a 42U high full rack or two to hold the kit, with an air conditioned room to house it all. As an engineer running a small company by day, often working from home, my aim was to do what engineers do according to the duke of Wellington …the art of doing for 10 shillings what any fool can do for a pound. The total cost of everything described here is less than £600 – excluding the wiring and the valuable time of course! keeping to the green/recycling theme, some stuff like the dimmers, came from eBay.
Doing a “start-again” renovation of a very dilapidated house, I had a free range of options, so started by writing a spec for the functionality I wanted, which drove the need for a PC server based control system in node 0 and a large amount of CAT5e wiring – a minimum of 2 outlets per room, up to 8 in places like the living room and home office – total 32. By writing a spec that contained some future aspirations I haven’t so far been significantly short of capacity in the building infrastructure. For example I started from the aspiration/assumption that it would be possible to stream live TV over a LAN, which actually wasn’t that easy when I started writing a spec in 2003. and just in case it didn’t become cost-effective in a reasonable timeframe, aerial cables were installed to most rooms, as well as node 0. Today, I would only put the aerial/satellite cables in node 0 and the living room.
CLICK FOR big version – Diagram showing the main system components and their configuration.
CLICK FOR big version – The modest node 0, aka under the stairs – server, low power
24 port 10/100 switch, patch panels for data and voice (VOIP/POTS via Speedtouch 780 currently
commoned to all house & office phones. also under floor heating manifold and controls. Wooden
wall panels removable, covering cable trays and plumbing.
The spec also meant home-run cabling for all the lighting circuits, to allow for central control, as well as home-run switch wiring, simply so that a fairly conventional system could work by patching low voltage switches to dimmer inputs in node 0 as necessary, before the automation system was commissioned (I used grid switches to allow swapping momentary and conventional types easily). This hardwiring may be implemented again in future if I rent or sell the house, because I recognise that the system I have developed is quite custom, and as this segment of the housing market isn’t used to this type of thing – a potential renter, buyer or estate agent might think it as “overcomplicated”. Of course, lack of “big brand” hardware isn’t going to help either, so you might like to consider these factors when choosing your kit and how you implement it. My thinking around potential sale is “with planning permission to automate” – i.e. the difficult stuff like flood wiring is there – a future occupier can choose their own automation system, e.g. a Homevision box etc, or leave it (almost) conventional.
The one thing I didn’t complete is whole house audio, though the speaker wiring exists to support it in several places as it was an initial spec item. The reason is that with so many digital devices around today, there are a plethora of low cost boxes you can network with wire or wirelessly to access your server-based media, so there seems less incentive than there was when the spec was written, and wiring installed.
A MediaMVP on the back of a TV. IR receiver faces down
control signals easily picked up by reflection from the floor.
What this system shows is that relatively low powered PC hardware can be made to run a plethora of applications with uptimes measured in months – or if you are prepared to forego the disk upgrade treadmill – years. OK, so running a server 24 x 7 isn’t very green, but if you want a functional automated home, with a few bells and whistles, media server etc, you’re going to need at least one box running 24 x 7, so my view if that you might as well pile as much functionality (and disks with your media) into one power-efficient box, make it as reliable as possible (e.g. by spending extra on a better PSU), and have an adequately robust backup strategy. as well as helping initially, electrically hardwired backup carries your essential systems through server downtime, and is easy to implement if considered from the start. fortunately this thinking often ties in well with more cost-effective kit, like those old-fashioned analogue dimmers on eBay.
Here’s a list of the main applications running on the PC, based on a “Mobile on Desktop” (MODT) motherboard from MSI that was a fashion in 2006-7. The server has 2G RAM, and uses a Seasonic 80%+ efficient power supply built into a recycled Elonex desktop case – see photo.
Software component
Function
Hardware/ Peripherals used
SuSe linuxV10.3
Apache web server
MySQL used by zoneminder and xxv for VDR
PHP, Perl
Samba windows file / media server and primary domain Controller for unified user management & Windows client logins
Laptop-mode to spin down media disks when not used, saving power
–
VDRV1.6.0.2
Freeview digital TV recording, playback and live TV streaming over LAN.Can also receive satellite or cable DTV with appropriate tuner cards.Plugins:
Streamdev (HTTP streaming TV/audio)
vompserver – see below
Epgsearch
2 x TV tuners: USB or DTV1000 PCI card, (or others)NB The machine was unreliable with 2 x DTV1000 for some reason.
VOMPV0.3.0 serverV0.3.0.10 custom client
VDR client / server plugin to allow thick client access to VDR.Live and recorded Freeview TV streaming, media player and management of recordings and timers at each TV.
3 x Hauppauge Media MVP’s. High quality SD via RGB SCART.
VDRadmin-AMV3.6.7
Perl based program providing web interface to VDR timers, recordings and live/recorded streaming, using epgsearch to automate timer creation based on complex epg search criteria.
–
XMLTV2VDR
Extracts full epg data & film reviews from XMLTV feeds and insert into VDR epg. adds episode names (so you can weed out repeats and identify series) and allows films to be searched / recorded based on actor, director, review score etc.
–
XXVV1.6
Web interface to manage VDR, providing web preview of VDR recordings, search and timer management. Partial alternative to VDRadmin.
–
Misterhouse (mh)V2.104
Object Oriented Perl based home automation system. Interfaces to many different types of hardware. Provides:
Web interface
Lighting scene / channel control via conventional switches, speech, time of day, random (security) and web interface
Adaptive under floor heating control based on temperature & weather forecasts (a separate article in itself…)
Security interface (interfaces to standard commercial alarm system I/O via K8000)
Music media playback on server
(poss. whole house audio)
Aggregation of other occupancy related functions.
No specific hardwareSee software interfaces below
xPLk8000
In-house developed xPL I/O daemon for 2 x Velleman K8000 interface cards and custom analogue output card for 24 dimmers. Samples/debounces low voltage switches, partially implements xPL lighting schema, does smooth lighting fades, and samples temp sensors / converts to real temps, drives heating zone controls.Relies on native xPL support in mh.Uses xPL_Hub – based on xpllib.
Uses libk8000 to interface to K8000 with additions to support custom hardware.
K8000 on parallel port (I2C “bit banged”)- switches, alarm I/O, 4 x Analogue temp sensors, drives heating zones & UFH pump.In-house developed 24 ch. analogue output card to drive 0-5V dimmers.
K8000 provides full opto-isolation of switches and PC
Festival
Text to speech engine driven by mh.Uses mbrola voices – acceptable quality once you’re used to it (i.e. a bit better than Stephen Hawking’s voice).
Motherboard Sound
Zoneminder(zm)V1.24.2
CCTV application. live video streaming, recording, motion detection, event database management, automatic offsite archiving via FTP and event notification via email and/or SMS. Interfaces to mh.In-house developed maintenance scripts.
Retired WinTV PCI card used purely for analogue video capture. (many other suitable cards)
WebminV1.510
Web based management of linux serverSecure remote https web access to most server functions.
–
ZimbraV5.0.23
Open source edition. enterprise mail server complete with secure https Ajax web interface for remote mail access. also secure SSL IMAP remote access and local IMAP or POP3 for Outlook or Thunderbird clients etc.
–
Ubuntu Netbook Remix V9.1
Access to all of the above, including wireless TV streaming from VDR server using streamdev plugin
O2 JogglerSee photos
CLICK FOR big version – interface cabinet with 2 x K8000 and custom analogue output card to
drive 24 dimmers, interfaces to low voltage switches via mains rated cables.
Performance – As far as server CPU load is concerned, key measured figures are:
10-12% Misterhouse (about half of this is due to complex lighting scene control and relating logic)
5% xPLk8000 due to 25Hz sampling of all inputs and outputs via “bit-banged” I2C to provide switch debounce and smooth lighting fades.
4% Zoneminder (1 camera)
2% VDR + 1 – 2% per recording or playback channel
1-2% for Zimbra
The total is around 25% doing everything required, peaking up to 75% during housekeeping tasks. The CPU mostly stays in LFM (800MHz idling) except during these peaks with all applications running, so minimising CPU power. You can however log in remotely and securely with a couple of NoMachine NX clients and the server is very usable with a large HD screen (1920 x 1200 res) graphical interface – there isn’t a noticeable detriment caused by the server load.
Power – The CPU is a mobile Pentium M 740 (1.7GHz) giving a total measured idle PC consumption of about 39W with a 500G disk spinning. add a further 3 disks in an “icy dock” (total 2TB), and a couple of TV tuners and an old WinTV capture card re-cycled for CCTV use, and the idle power rises to around 55W with the 3 media disks spun down. You’ll be wanting to keep power down due to the cost/CO2 and heat produced in node 0 – as has been discussed recently on the ukha list. Disk life is greatly increased with low temps – at an ambient 20C, these are reported by smartd as between 33C and 37C on the server described. putting my commercial hat on, I use an approx rule of thumb: £1/W/year with 3yr payback as the benchmark to decide if it’s better to invest in lower power hardware. (that explains the recycled WinTV card for CCTV). Today one can no doubt improve a bit on server power by breaking this rule, as I discuss later.
Server internals – off-the shelf parts – nothing special.
At the top an “Icydock” for 3 x SATA media disks – replaces CD-ROM + spare bay
While discussing power, it’s worth reviewing other system components from a green perspective. I found that D-link had a range of very power efficient and small Ethernet switches which use remarkably little power (measured just 4W for a 24 port basic switch), but ADSL routers remain a problem, typically consuming, as mine does, 10W. scope for the future there.
Availability – To date, downtime has been about 2 half-days per year, equating to 99.9% availability. The downtime has been caused by me messing around with server config to try one thing or another out, or moving disks around. The longest uptime so far has been 6 months over last summer. There was an infant mortality disk failure of a 500G server grade disk, sadly a media disk with limited backup. hence the aspiration to at least move the OS to SSD. Be careful how you configure laptop-mode so as to limit the spin ups of the media disks – 3.5in disks are typ. rated for just 50k spin ups, I’ve done less than 5k on my 3yr (oldest) disk according to smartd, so even half the spin up count won’t be reached before obsolescence. Exclude your OS disk of course!
Application choices – It’s clearly possible to build a system with these functions out of many different components. Did I use the first ones I tried – hell no! Each of these applications was chosen out of a large range of possibilities based on the following criteria:
Open source. Simple, in my experience this is almost always a better choice – more flexible, often more functional, and authors/maintainers are quicker to improve and fix bugs – yes, even the ones I report. sometimes the same day (e.g. VDRadmin), sometimes the next week (e.g. Zimbra). If it takes more than a month, you might be barking up the wrong tree. Is it cheaper? Not if you value your time, but equally I’ve had to invest time helping debug several commercial applications over the years, so I’m under no illusion that parting with a pile of cash is a guarantee of quality and support.
Software should show good promise of worki