| Home Toys Article - June99 - [HTI Home Page] |
Information Services Order Free Catalogs and Product Info [Click Message To Learn More] |
MisterHouse is the name of the open source program I wrote to do Home Automation (HA) chores at our house. It runs on Windows 95,98, NT, or any POSIX enabled Unix, like Linux. It can interact with a variety of serial port devices, including the X10 CM11 interface. |
Bruce lives in Rochester, Minnesota, with his wife and twin 13-year-old boys in a passive solar, earth bermed home. By day he is a mild-mannered engineer who helps design integrated circuits at IBM. At night, he turns into a Dilbert-like gadget guru, who will not be content until his house gets a PH.d. degree at MIT. |
MisterHouse is the name of the open source program I wrote to do Home Automation (HA) chores at our house. It runs on Windows 95,98, NT, or any POSIX enabled Unix, like Linux. It can interact with a variety of serial port devices, including the X10 CM11 interface. It can be controlled or queried via command line calls, tcpip sockets, a web menu, or a gui interface. On the MS Windows platform it also supports Voice Recognition (VR). It supports Text To Speech (TTS) on windows and linux, using freely downloadable TTS engines.
This article will give an overview of MisterHouse and give you pointers on how to download it and give it a test drive.
By now I suspect the term 'open source' is pretty well understood,
as so many of today's popular programs fall into this category. A definition can be found
at http://www.opensource.org/osd.html The
idea is that instead of making just the binary of a program available, the source code for
the program is included as well.
So why would a person spend a year or 2 writing a program, and then just give it away, along with all the source code, on the Internet? Authors do it for a variety of reasons. Mine include:
People are more confortable with open source because not only is it free, but its future is not dependent on any one person.
If money is a goal, I think a better HA business model might be not in selling the various programs, but in selling the service of installation and customization that is required to make it work in each home.
MisterHouse (mh) is based on a programming language called perl. Perl is a powerful, open source, multi-platform, semi-interpreted language that was first released in 1987. It quickly evolved into a key engine for many internet related tasks, so even if you have never seen it, you have probably used it.
With version 5 of perl, we can easily extend the language by building our own HA related objects and methods. For example, the following will create an object for a light and turn it on 15 minutes after sunset:
$backyard_light = new X10_Item "C4";
if (time_now "$Time_Sunset + 0:15") {
speak "I just turned the backyard light on at
$Time_Now";
set $backyard_light ON;
}
X10_Item, time_now, speak, $Time_xxx, and set are all HA related objects, methods, functions, and variables defined in mh. The rest is regular perl code.
Perl is a rich language. If there is not a built in function to do what you want, chances are pretty good there is one available via the perl CPAN repository ( http://www.perl.com/CPAN ). But for its use with mh, you don't need to know anything more that what you can learn simply by reviewing the example events that come in the mh distribution. In fact, several mh users have commented that running mh was a great way for them to learn perl!
If you want to dig into perl a bit more, a good starting point is at http://www.perl.com . THE reference book is Programming Perl, 2nd edition by Larry Wall, Tom Christiansen & Randal Schwartz, ISBN 1-56592-149-6. If you are looking for how to do something in particular, an excellent book is the Perl Cookbook, by Tom Christiansen & Nathan Torkington, ISBN 1-56592-243-3 Both of these books are available from http://www.oreilly.com or http://www.amazon.com .
If you are like me, you may be on the fence on trying to decide what operating system to run your home control programs on. The Windows platforms offer the widest range of applications, but the unix platforms offer the best reliability. For example, today I'm running on Windows, because that's where the best Voice Recognition (VR) engine is. But running Windows for more than a week between reboots is a challenge. Linux, on the other hand, can go months between reboots.
With mh you can switch between the two environments without having to re-write anything! Perl runs the same way on both platforms. The Tk and web interfaces look the the same. The low level serial and TTS calls are different, but the high level calls that the mh user sees are the same, so no change in user event code is needed.
Here is what the web interface looks like:
Here is a picture of the Tk interface
Both of the web and the Tk interfaces are customizable and can be turned on or off as needed.
All of the defined voice commands show up on the Tk menu, the web menu, and the 'What can I say' voice interface
If you want to see a live web interface, try http://misterhouse.net:8080 , which, if our cable modem is up, will link you to mh running at my house. You will not be able to control anything without the password, but you can click on the various links and get a better feel for how mh works.
I have uploaded all the mh perl code used to control our house to:
http://members.home.net/winters/house/programs/code/Bruce
Here is a short discription of a few of the members in that directory:
An optional rule allows the sometimes unpronounceable phone book names to be translated to a pronounceable name or to play a pre-recorded wave file. The name of the city and/or state is also added, if the call is from an out-of-town area code. Using a Weeder DTMF kit, this code will also monitor and log outgoing calls. The display_callers script will display a list of all calls, incoming and outgoing, for any specified day.
Installation and documentation
You can find the mh installation instructions at:
http://members.home.net/winters/house/programs/README.html
The rest of the mh documentation is at:
http://members.home.net/winters/house/programs/mh.html
We also have a mailing list (about 60 members as of 4/99) you can
join at:
http://www.onelist.com/subscribe.cgi/misterhouse
You can also review past messages at:
http://www.onelist.com/archives.cgi/misterhouse
.
© 1996 - 2008, Home Toys Inc. - All Rights Reserved
Powered by LJB Management Inc.