
32
Part I: Home Automation
correctly, press the “House/On” button on one of your motion detectors.
You should see output that resembles the following:
Porch motion detected. Received: C9CJ.
Turning on: B1
Turning on: B3
Of course, the output will vary depending on the time of day. Also, now that
you’ve triggered the motion detector, the script thinks that it’s dusk because
you configured the motion detector to send signals only when it’s dark.
If things don’t work as expected, try moving your X10 computer interface and the
wireless transceiver to different electrical outlets. You could even try connecting
them to outlets right next to each other.
Take a look and see if the porch light turned on. If it did, congrats! Press
Ctrl+C
to stop the script running so you can schedule it to run automati-
cally in the background.
WARNING
Note that you can run only one such script at a time, because only one script can
control the serial port on your computer.
7. Schedule the script
For your script to run, your computer must be running. At some point,
however, you're going to need to turn off or at least reboot your system. You
don't want to have to restart the script each time the computer restarts, so
you should configure your script to run automatically at startup. To do this,
execute the following commands in a terminal window:
su
echo perl /usr/<username>/homehacks/x10-controls.pl >> ...