Here’s a Python module that will allow you to turn on and off, and brighten/dim lamps or other devices that are plugged into X10-compatible modules, using the CM17A “Firecracker” serial interface. I set up my Christmas lights on them, so now they can be turned on and off via computer and Python! The firecracker is a serial dongle that looks like this:

Note the script requires the PySerial module. Tested and works in Mac OSX with Python2.7, using a USB-to-serial adapter, but it should run fine in Windows and Linux too.

Download

Source code repository on Bitbucket.

Updates

Edit 1/12/2013: Checked in new version 0.3 to fix a bug that somehow kept the firecracker from working under Mac Lion. Also tested on Raspberry Pi using USB-Serial adapter! Haven’t tried connecting it to the pi’s GPIO pins yet.

Edit 2/7/2013: Updated the script to support Rapsberry Pi GPIO pins. Full post is here.