MacDevCenter    
 Published on MacDevCenter (http://www.macdevcenter.com/)
 See this if you're having trouble printing code examples


Home Automation with Mac OS X, Part 1

by Alan Graham
02/13/2004

When some people hear the words "home automation," they think about the Jetsons or multi-million-dollar concept homes of the future. Others think home automation is just a geek fantasy that wouldn't add any real value to their lives.

They would be wrong.

Home automation is actually relatively affordable to set up. Anyone with very basic Mac OS X skills can design and program their own system. In this series I'll discuss why to use home automation, what you'll need to set it up, and advanced topics such as home video surveillance and remote administration. And if you happen to be a fan of the Homemade Dot Mac series, we'll tie that in, as well.

Why Home Automation?

Have you ever been interested in:

All of this (and much more) is possible, but to get a better "real world" idea of the value of home automation, let's take a look at how it is used in my house.

My Setup

First Floor:
I have light controllers on the front porch lights, the stair lights, and in the living room. There is a motion detector on the stairs going up to the second floor. I have an appliance controller on the fountain in the back yard. There are also two security cameras on the first floor.

Second Floor:
There are light controllers on all of the lights in the nursery, on the landing light, and in my office. I have an appliance controller on my color laser printer. There is a motion detector on the landing and in the nursery. There are three security cameras on the second floor.

Basement:
The basement has a light controller on the switch. There is also a motion detector on the stairs going down to the basement.

How Do We Use It?

Coming Home:
When my wife and I get home from shopping, for example, we use a keychain remote to turn on the front porch lights. This sets off series of events that:

Related Reading

Switching to the Mac: The Missing Manual, Tiger Edition
By David Pogue, Adam Goldstein

Why? Often we get home at night and the baby is asleep in her car seat. This allows us to go upstairs with our hands full and not have to worry about flipping on lights or dimming them. We can put her straight to bed.

After ten minutes the nursery lights dim to off (except the night light), the landing and stair lights turn off, as do the outside porch lights. This ten-minute delay also gives us time to unload the car.

Watching a Movie:
We have one floor lamp and two table lamps in the living room. When we want to watch a movie, we press one button on the TV remote control. One light turns off, and two dim to about 25%. Another push of the button and the lights are restored to full. Additional settings include romance/fireplace (as if we still use that -- we have a baby), away from home, and going to bed.

"Going to bed" is one of my favorite settings. When you press the wall switch, the upstairs lights turn on, and the downstairs lights dim. After five minutes, the downstairs lights turn off one by one.

Going Upstairs/Downstairs:
How often do you go up or down a flight of stairs with your hands full of laundry or a baby (and baby-related gear)? Who hasn't struggled with trying to flip the lights on with the back of their hand or arm? In our home (at night), when someone goes up or down the stairs, the motion detector automatically turns the stair lights up, and later turns them off automatically. This is especially helpful in our basement, where the light switch is at the bottom of the stairs. (What genius thought that up?) This way, the moment you open the basement door, all of the lights in the basement turn on, and later off, by themselves.

Middle of the Night:
When the baby is crying, or you need to make that late night trip to the bathroom, who enjoys fumbling for light switches or having bright lights in your face? I always have a number of obstacles (dogs) to walk over, as well, so I hate stumbling in the dark. When we get up, a motion detector automatically sets the upstairs landing light to 35%. After ten minutes, it turns itself off.

Nursery:
I wanted more control over the lighting in the baby's room, so I installed a number of lighting controls to work with a motion detector. Now, when I stumble into the nursery in the middle of the night, I don't have to fumble for light switches. The lights automatically come up to 35%.

Vacation:
I have a vacation setting for the home that has a series of random lights going on and off at different times of the night. This works better than a single predictable timer on one lamp, giving the house the effect that people are living there. I also turn the outside motion detector on so that people who might approach the house from the back get a dose of "activity" when they get near.

Fountain:
I prefer to cut the power to the fountain on the back patio when I have to clean the filter. However, the wiring for the plug is in the basement. I use to have to go down a flight of stairs, unplug it, go back upstairs, clean the filter, and repeat. Now I use an appliance controller to turn the fountain off from upstairs on the patio.

Printer:
Our color laser printer sometimes requires you to power it off and on to reset the cache (which sometimes gets buggy). Well, if you are downstairs, it can be a real pain to drop everything and head upstairs to shut it off. Now we just hit a switch on the TV remote and the printer resets.

Planning You Solution

Part of planning your own solution is knowing what can be done and then deciding what will work for you. Look through some of the following components that make up my solution. I use a combination of devices from X10 and SmartHome. Keep in mind that there are many more controllers than just the basics featured here.

Modules:

X10 Transceiver Module
This is the backbone of any X10 home automation solution. A transceiver module receives X10 RF signals (from remotes). It then translates those signals into X10 commands that are sent over your home wiring to the devices you wish to control. It also allows you to communicate with your home automation software through the use of a RF device. I have two of these devices, one upstairs and one down.

PowerLinc USB Interface
This device allows your USB-equipped Mac to communicate with X10 transceivers and receivers (lamp modules, appliance modules, etc.). You simply plug it into any outlet, and then connect the USB cable to your computer. You'll need this device to run the home automation software. This device is plugged into my home server.

Perceptive Automation's Indigo
Indigo is the best home automation software I've used on any platform. It certainly is the only real choice on the Mac OS X platform, as it is the only software that currently works with the PowerLinc USB device.

Appliance Module
The appliance module is a simple on/off switch. This is useful for simple appliances or for lighting that cannot be dimmed, such as halogen lighting on a transformer. I use this on my Ikea halogen lighting, which I wired without a switch. I also use it on my daughter's night light, and my fountain.

Super Socket Module
This works like an Appliance Module (on/off), but replaces your regular outlets so you can control appliances or lights. Rated up to 15 amps, this unit is connected to my color laser printer. You need basic wiring skills to install this.

Lamp Module
The basic lamp module allows you to turn lamps on and off, or dim and brighten. A good module but not my favorite, as it turns on to "full bright" before dimming to your desired setting.

Two-Way Lamp Module
A little more expensive, but gives you more control over your lamps, since it has a "soft-start" feature. This means it will fade the lamp up from the off setting. It has a very smooth dimming function. This controls one of my living room lights and two of the lights in the nursery.

Wall Switch/Three-Way Wall Switch
This replaces your typical wall switch so that you can control ceiling lights, porch lights, etc. It can dim lights through X10 controllers and Indigo software. I have these on the lights going upstairs, the upstairs landing light, the front porch, and the basement. Basic wiring knowledge is required for this. This is not to be used in conjunction with a ceiling fan.

Socket Rocket
This small module screws into just about any light fixture. It can be used indoors or out (for outside, it must be upside down or weatherproofed). Very easy to program. However, it cannot be dimmed, only turned on/off. I have one of these in a lamp in my office and one in the living room.

Screw-In Lamp Module
Not pretty, small, or elegant, this monstrous module works best with large lamps (with large lamp shades), but can also be used with light fixtures. Just keep in mind that the bulb will protrude a bit from this unit. On the plus side, it can be dimmed. I have one of these in the living room and one in the nursery.

Controllers:

Keychain Remote
Small form factor, fits nicely on any keychain. This gives you control of devices from the car or outside of the home. Nice for when you get home at night. I have two of these.

Super Remote Control
I use this remote to control my TV, VCR, DVD, lights, and appliances.

Palm Pad Controller
This remote controls up to 16 devices. I use this upstairs.

Slimline Switch
Although technically a "switch," I consider this a remote, since it uses RF signals. You simply stick it to any wall, with self-adhesive tape. A nice unit, because it takes zero time to install, and you can put lighting controls in areas that "make sense." In addition, it gives you control over multiple devices in a single room on one compact switch plate. It can also dim lights. I have one of these downstairs in the entryway, and the other in the nursery.

Motion Detector
This detects motion and sends an X10 RF signal to control any device. It can be set to operate at 24-hour intervals or just at night, is excellent for use with lighting or cameras, and can be used to help control power costs. I have the upstairs detectors set for night-time operation only. The basement detector is on at all times.

Optional Gear:

SignaLinc™ Plug-In Phase Coupler
Many homes have power that splits into two separate 110V legs (two-phase 220V), so sometimes X10 signals can't make the transition from one leg to the other. This device solves that problem. Simply plug it into once of your 220 receptacles (like your dryer) and it will bridge the X10 signals to either leg of your home wiring.

I had this problem in my home. I'd have no trouble turning on the lights on one side of my living room, but couldn't control the other side. I simply plugged this device in and it fixed the problem.

Next Week We'll Build Our System

Now that I've discussed why to use home automation and looked at the basic components, I'll build my home solution from the ground up in next week's installment.

Alan Graham is the creator of the Best of Blogs book series and is a frequent writer on the O'Reilly Network.


Return to Mac DevCenter

Copyright © 2009 O'Reilly Media, Inc.