Automogator - Advanced Home Automation using the Perl Object Environment

by Sean Adams

Download | Browse SVN

Automogator is a collection of free software for home automation. While many software packages already exist for lighting control and scheduling purposes, I found that there were few good solutions for controlling devices with infrared and serial interfaces. Such products include home theater equipment, pool and spa controls, thermostats, alarm systems, energy monitors, and weather stations. In addition, there is a wide variety of simple transducers and I/O devices which may have applications in home automation.

The intended audience for this project is the perl-speaking automation enthusiast. At the moment, Automogator is presented as a collection of examples and software modules for devices which I am using myself. Although it is not yet ready for "point and click" use, it is a suitable starting point for anyone with scripting experience to solve some of the more interesting problems that often arise in home automation.

It's Event Driven

My overriding requirement for this software was that it had to be FAST, because some of the tasks I wanted to implement included turning on lights when doors were opened, controlling various things in response to IR commands, and handling frequent updates from things like utility meters. After kicking around a few ideas of my own, I came across POE, the Perl Object Environment, which turned out to be an excellent framework for what I wanted to do. Besides being a robust platform for implementing any sort of "reactive" behavior, POE includes several components especially suited for home automation, including web servers/clients and protocol parsing tools. Most importantly, it abstracts all the tedium of multitasking, network IO, and buffering that you just shouldn't have to reinvent before being able to implement your automation logic.

If you are new to event-driven programming or perl, you may find that POE is a tough nut to crack. It has a steep learning curve, but once you get the hang of it, it is very rewarding. The modules I have already developed touch on most of the common home automation problems you might encounter, and should serve as helpful templates for any new device you might want to add. You don't need to know what POE is doing under the hood to get started, but once you become comfortable with it you will be amazed by how quickly you can get stuff done.

Components

Each supported device or protocol is a separate module, or "component" in POE parlance. A component implements general support for a particular hardware or software product with which Automogator might communicate. Any custom home automation logic needed by a particular user is implemented in their main perl script, which is where each component is instantiated. More on that later... without further ado here are the components that exist so far:

  • Pentair pool/spa controls
  • The Pentair IntelliTouch system uses an RS485 bus for communication between the "personality module", the indoor control, the spa-side remote, and the IntelliFlow pump(s). There is also an adaptor called "iLink" which is a bridge between this protocol and an ASCII command set. You can do anything that is possible from the indoor controller, including reading the temperature and controlling heat setpoints, lights, variable speed jets, and accessories. Automogator can be used to bridge these functions to Indigo, allowing you to control everything from an iPhone control page.
  • CAT 2000 pool chemistry controller
  • This device is used to automatically control pool/spa chemistry by feeding the correct amounts of acid and chlorine, based on continuous feedback from pH and ORP sensors. The controller features an RS232 port which periodically outputs the pH and ORP measurements and the status of the feeders. This information can then be used for monitoring and graphing purposes, and to trigger a text message alert when the reading go outside an allowed range.

    This is an example of a minimal component that only receives incoming data.