loading

In this instructable I’ll show you how to use your Amazon Echo or Google Home device to control X10 hardware. Why X10? Well, a lot of us jumped on the home-automation bandwagon early (since X10 is over 40 years old it’s possible that you’ve been using this hardware for a really, really long time), and don’t care to go out and spend a bundle on Philips Hue or WeMo lights to replace what already works for us. Also, the vast number of options with X10 allows, in my opinion, for a more flexible implementation of lighting control for the casual enthusiast, or the person who wants to install X10 compatible outlets, lamp or fan modules. In the end, X10 does what the newer lamp control modules do: It turns your lights on and off.

Step 1: First, You Need a Computer.

In order to make this work, you’ll need a computer with a serial port. I’m using a small form factor PC that happens to have a serial port, so I’m using the CM17A firecracker module that can be found on eBay for less than $10.00. For the receivers, I use the TM751 modules, which listen for radio signals (such as those from the firecracker module) and inject those signals onto the electrical circuits running through the house. I also have various X10 in-wall switches, inline appliance modules and lamp modules throughout my house.

This how-to varies slightly whether you’re running Microsoft Windows or some flavor of Linux. I happen to run Linux, but have had this running on a previous iteration of my home server, which ran Windows 7. I will proceed with this tutorial showing how this is done with Linux, because in my opinion things tend to work more reliably under that OS.

Step 2: Bottlerockets and Firecrackers

The CM17A ‘Firecracker’ module can be operated via command line with a linux application called Bottlerocket. Commands are passed to the module and are turned into wireless signals which are then picked up by the transceiver modules. Here’s what a command looks like:

br --port /dev/ttyS0 --house=B --on 4

br: This is the executable Bottlerocket application --port /dev/ttyS0: This tells Bottlerocket which serial port to use --house=B: This tells Bottlerocket which house code you’re on --on 4: This tells Bottlerocket to send the ‘on’ command for unit code 4

Let’s say that the previous command turns your living room light on. Save the command as a file called “LivingRoomLightON”. Then in a terminal session, run this command: Chmod +x LivingRoomLightON This command makes the script file you just created executable. Check to make sure it works by (while still in a terminal session) running: ./LivingRoomLightON

Your living room light should turn on, assuming that /dev/ttyS0 is the serial port that the firecracker is installed on. (And that it’s plugged into the serial port). At this point you can create and test scripts for each device in your home.

So, if you are successful at this point, give yourself a hand. You’re not too far from being able to use your Amazon Echo to control your lighting.

**The purpose of this instructable is to show how to use the Amazon Echo with X10, but even at this point you have a pretty powerful setup using just a Linux server and the Bottlerocket software. With little more than what you’ve already done, you can set up cron jobs to automatically turn lights on and off. Cron even allows you to set a job per month so that you can set the lights to come on around sunset and sunrise, with a new job for each new month. Pretty cool!

Step 3: Where's That Confounded Bridge?

Now we need to download the truly magical piece to this whole setup. BWS Systems (http://bwssystems.com) has released an excellent conduit software that sits between your humble home automation server and your Amazon Echo. It’s called the HA Bridge, and can be downloaded from http://bwssystems.com/#/habridge.

Download HA Bridge

Use wget to obtain the lateset version of the HA Bridge. First, go to http://bwssystems.com/#/habridge, then copy the download link (in chrome, right click the download link, then click copy link address). In a terminal session, type “wget downloadlink”. At the time of this writing, the command would look like this:

wget https://github.com/bwssytems/ha-bridge/releases/d...

This command downloads the HA Bridge java file to the local directory. Once you have the .jar file downloaded, run the command “java -jar nameofjarfile.jar” At the time of this writing, that command looks like this:

java -jar ha-bridge-3.2.2.jar

Open a browser window either on the Linux server or on another network PC, and go to http://ipofserver:8080. You should see the HA Bridge configuration screen. This screenshot is my configuration, yours will be empty at first.

Click on “Manual Add”. This will take you to the new device entry screen. First, name the device. You can see from the screenshot of my completed configuration what I’ve named my lights, but you’ll want to choose something that makes sense for your application.

Under Device Type, drop down the list and choose “Execute Script/Program”.

“On URL” is the script that will run to turn this light on. An example of one of my working scripts is /home/myself/LivingRoomLightsOn

“Off URL” is the script that will run to turn this light off. An example of one of my working scripts is /home/myself/LivingRoomLightsOff

Click “Add Bridge Device” to add this to the list of devices. You should now see this when you click “Bridge Devices”. Click “Bridge Devices” and click “Test On” or “Test Off”. If all is configured correctly, the HA Bridge should be executing the scripts for On and Off when you click the corresponding button.

Step 4: Now for the Alexa Part!

Once everything is tested, you should be able to have your Echo scan for new devices. You can do that by saying, “Alexa, scan for devices”, or go to http://alexa.amazon.com and use the webUI to scan.

A word on Google Home - I don’t have a Google Home device, but the BWS Systems’ website says that the HA Bridge is confirmed to work with Google Home. If anyone would like to send me one to test, I’d be happy to report back :)

At this point you should be able to ask Alexa to turn your lights on and off! One more thing, though. You will need to launch the .jar file each time you boot the server. Here’s the easiest way to do that. Open a text editor and paste the following into a new document:

cd /home/myself/Lighting /usr/bin/nohup /usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -jar ha-bridge-3.2.2.jar

Save this new document as “starthabridge.sh”. Make this new script executable by issuing this command in a terminal session: chmod +x starthabridge.sh

Now that we have a script, we need to tell the system to launch it at each boot. Issue this command (again in a terminal session):

sudo crontab -e

This is the Cron editor. From here you can schedule tasks to run automatically, or, in this case, tell the system to run a command at boot. Here’s what you should add to the end of your cron to get the Home Automation Bridge to launch at startup:

@reboot /home/myself/Lighting/starthabridge.sh

Step 5: Drumroll Please....

...And that should be it! You can get this same thing going with Microsoft Windows using the same .jar file from bwssystems and a command line utility for Windows called cm17a.exe. The syntax is different (check the github page for usage), and in my experience, it is slower to issue the commands. For instance, if I ask Alexa to turn on the Living Room lights under Windows, there's a good 2-second delay between Alexa saying, "Okay" and the lights coming on. Under Linux, the lights come on before she even has a chance to say "Okay".

I hope you enjoyed this instructable, if you have any issues getting it to work, please comment and I'll try to answer.

Have fun!

<p>Can you give an example of a command to do a dim?</p>
<p>I couldn't get dimming to work. If you find out, post!</p>
<p>Can you use a CM11A in place of firecracker. Because I have a CM11A serial with a serial to usb convert.</p>
<p>Just wanted to leave a little note about shorthand:</p><p><br>br --port /dev/ttyS0 --house=B --on 4<br>can be simplified to:<br>br --port /dev/ttyS0 b4 on<br><br>Also, I am using a USB-to-serial adapter with my Raspberry Pi and I am having no issues. I used the <em>&quot;</em>TRENDnet USB to Serial Converter, USB 1.1 to RS-232 Male DB9 Serial Cable&quot;. I highly recommend this one, since it has been around for a while and is known to work reliably.</p>
<p>A few notes: <br>-To find the tty address, run &quot;dmesg | grep tty&quot;. My address was /dev/ttyUSB0 since I was using the adapter.<br>-You can just use commands directly in the HA Bridge. So instead of running the script you would do br --port /dev/ttyS0 a1 on <br><br>If you have any questions, comment</p>
<p>Does the computer i use have to be wireless ?</p>
<p>Surely not. Alexa connects to the physical network via wireless, <br>where your computer hosting HA Bridge is connected. It then sends the wireless signal (radio wireless, not computer network wireless) through the firecracker module to the X10 receiver, which is plugged into the wall. The X10 receiver then relays the signal to the house wiring to control the X10 lamp/appliance modules. The X10 modules<br> themselves are not wireless.<br><br>So as long as all of the components<br> are on the same physical and logical network, it should not matter. In<br> fact, I would prefer wired anyway just to rule out possible <br>connectivity issues that can occur with wireless connections that cannot happen with wired.</p>
Hi i try to use the fircracker CM 17A in my older computer that ran my voice control house by voice with all my x10 devices it's still running on widows 95 it wouldn't let me download the program for cm17a are they a nothing way to get to work with Alexa for all my x10 because i'm prailze from the neck down i'm trying to get all x10 stuff working i can use a hand held to work all my x10 so i know its working here's a picture of my home management system
Thanks for the help i'll let you know how it goes
<p>Hi I'm using Linux Mint and I was able to get all this to work!</p><p>A few notes: 1. Make sure you don't have Apache2 Web Server running while you set this up because the HA Bridge also runs on port 80. If you had a Web Server and you stopped it, you will need to go to your History and Clear the Recent History before you can see the Configuration Page of the HA Bridge. 2. I simply typed &quot;localhost&quot; into my browser to bring up the HA Bridge. 3. I needed to mess around with the Firewall before Alexa could see the HA Bridge.</p><p>All in all, it took a couple of hours but was I was ecstatic to be able to use all my old X-10 stuff with voice commands from Alexa! </p>

About This Instructable

11,311views

29favorites

License:

More by stuffman:How to Control X10 Devices With Amazon Echo or Google Home Build a Home Theater PC from a Broken Laptop and a Tivo Easily sync music and podcasts to your Blackberry Storm with Ubuntu 
Add instructable to: