Introduction: How to Control X10 Devices With Amazon Echo or Google Home
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!

Participated in the
IoT Builders Contest
32 Comments
1 year ago
I just finished setting this up. Make sure you get the latest version of the ha bridge here: https://github.com/bwssytems/ha-bridge Click on "releases" on the right hand side. It's 5.4.1 as of writing this comment. Also make sure you set the option for 9 octet to "true" in the bridge configuration, or else Alexa will never discover your devices. I have two dozen X10 light switches and they're not going anywhere!
2 years ago
I know this is a few years old, and wonder if any of you still using all of this.
Question... only vaguely related....
The TIP10RF
Anyone know if it has a webgui or command line interface ... know how to drive it WITHOUT the phone app
Question 5 years ago on Introduction
Do you have to keep the computer on once everything is setup?
Answer 2 years ago
Yes,
Use a headless raspberry pi
Question 5 years ago on Introduction
I have a linux/CM11a setup using Heyu. Any ideas, is this do-able?
Answer 2 years ago
Yes it is
HEYU HA-BRIDGE and CM11 all working well enough for 2-3 years
Question 4 years ago on Step 5
I am using my x10 lamp modules and still enjoy them, There has to be a simple way to interface and control these with my alexa DOT as to just say 'alexa cut on my x10 lamps, and there has to be a way to control this from my iphone just like i do now using the tp kasa smart plugs to control my lights from my iphone from anywhere ''with out going through my home computer being on all the time.......please help as i have been loosing sleep over this and need so much to fix this issue.................Rick Ryan in NC
Answer 2 years ago
You could try a TIP10RF on the iPhone ... if you can find a way to install the TIP10RF app to your iPhone
I have the ipa file for it and have to manually install it each time
I have stuck to an old iPhone Se /5 for this very reason
Dreading the day it dies
The app no longer on the App Store.
Still available for Android I believe
6 years ago
Just wanted to leave a little note about shorthand:
br --port /dev/ttyS0 --house=B --on 4
can be simplified to:
br --port /dev/ttyS0 b4 on
Also, I am using a USB-to-serial adapter with my Raspberry Pi and I am having no issues. I used the "TRENDnet USB to Serial Converter, USB 1.1 to RS-232 Male DB9 Serial Cable". I highly recommend this one, since it has been around for a while and is known to work reliably.
Reply 6 years ago
A few notes:
-To find the tty address, run "dmesg | grep tty". My address was /dev/ttyUSB0 since I was using the adapter.
-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
If you have any questions, comment
Reply 4 years ago
elison, i have terrible problems running Java 8 JDK, any ideas?
I am getting this:
Oct 27 09:12:19 raspberrypi systemd[1]: Started HA Bridge.
Oct 27 09:12:19 raspberrypi systemd[4637]: habridge.service: Failed to execute command: No such file or directory
Oct 27 09:12:19 raspberrypi systemd[4637]: habridge.service: Failed at step EXEC spawning /usr/bin/java: No such file or directory
Oct 27 09:12:19 raspberrypi systemd[1]: habridge.service: Main process exited, code=exited, status=203/EXEC
Oct 27 09:12:19 raspberrypi systemd[1]: habridge.service: Failed with result ‘exit-code’.
I am loosing my mind
Reply 4 years ago
Did you verify that Java 1.8 is installed first?
I'm not in front of a Linux computer right now, but it should be something like:
sudo apt-get install default-jre
and for the SDK (unsure if this is a dependency or not):
sudo apt-get install default-jdk
Reply 4 years ago
Thank you! i got it working.
Reply 4 years ago
yes, after researching everything, this is exactly what it is, however i am not just too good into programming to do it myself. I was following instructions to get Java JDK 8 but apparently download link has changed.
Java 8 is required for the ha-bridge to run. To check your Java version type $ java -version if it is not JAVA 8, then enter the following command $ sudo apt-get install oracle-java8-jdk. If you are getting “Unsupported major.minor version” error messages, then enter $ sudo update-alternatives --config javac and $ sudo update-alternatives --config java. This will set your RPi to use Java 8 globally.
This is however not working.
Any ideas? Or help? much appreciated
PETER
4 years ago
Would it not be possible to create an instruction Wiki for utilization of the wm100 interface for X10 devices to accomplish integration with Amazon and/or with Google home?
5 years ago
Warning. This info is 2 years old and has the HA Bridge s/w and user interface has changed quite a bit.
But in the end I was able to muddle through the clunky interface.
To turn on the URL text boxes, you need to change the Device Type to Execute script/program and then go to the top and click the Change Edit Mode button.
For Script execution (you can run arbitrary local hosts scripts, mine were heyu/CM11a wired RS232 X10 home control, but I could run other scripts to change my VLC audio station)
The script URL is no longer a simple string, it has to be like this:
[{"item":"/path/to/script",""type":"cmdDevice"}]
More info here: https://github.com/bwssytems/ha-bridge
5 years ago on Step 5
I have it working with a TM751, but have one problem. I have a bunch of lights controlled by wall switches. Wherever I plug in the TM751 one light is missing. If I move the TM751 its a different light that gets missed. All lights on with a standard x10 control box gets them all, not the TM751 whether I use all lights on with BR, or the specific unit number. If I could use two TM751's I would be ok, but apparently the unit number is hardwired. I can hack the br software, but not the TM751 hardware.
My wiring is old (2 wires) which is the real culprit, but not practical to replace.
Any ideas?
Question 5 years ago on Step 5
I use a cm-19a. Compatible or not. Also have the Trane 850 thermostat. What's my best route to go? Thank you
5 years ago
Please help, I am stuck.
I get this error:
java -jar ha-bridge-5.1.0.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/bwssystems/HABridge/HABridge : Unsupported major.minor version 52.0
And when I go to http://ipofserver:8080 I get:
This site can’t be reachedipofserver’s server DNS address could not be found.
6 years ago
I was able to get this working as of September 2017 using the normal google home app on my phone and a physical Google Home appliance. It found the ha-bridge just fine and connected to my x10 devices without issue.
The new ha-bridge (v 4.5.6) has a slightly different interface than what is shown in this instructable. In the interface you add items for on, dim, and off. In each of those sections (on, dim, off) you can have multiple items / commands. In each item / command you set the TYPE to 'execute command script/program' and the TARGET ITEM to the command you want to execute (probably some bottlerocket command).
I also got dim working. The bottlerocket documentation is a little thin in this area but I eventually figured it out. So the basic command to dim or brighten is
br --port /dev/ttyUSB0 -n A4 -d 1
Obviously you replace the port with whatever port are using (I'm on an Orange Pi One using a USB to Serial adapter hence ttyUSB0). The -n is to turn on a module (so substitute A4 with whatever module you are using). Since dim / bright in X10 works on the most recently addressed module, you need to turn on the module first. The -d sets the number of steps up or down (positive numbers brighten, negative numbers dim). In my setup the max number of steps is 7 (from full on to all the way off).
The unfortunate thing about dim/bright is that the ha-bridge only gives you a new target value, it doesn't remember where you were or give you a delta. Also, the Google Home just adjusts from where you are to a lower or higher value when you say dim or brighten without an explicit target (so 'dim the lights' vs. 'dim the lights to 50%'). The X10 expects you to dim or brighten a number of steps from where you are, not go to an explicit value. Therefore, you need to know where you are currently before you can know which way to move or by how much.
To (mostly) solve this problem, I created a script that tracks the current brightness value for all my modules in a file. When you ask it to dim or brighten, it moves from where it (thinks it) was to the new value. Obviously if you externally adjust the lights without using the script, it will be confused and not work correctly. I see no way to fix this using the Firecracker as it is a one way interface (set only, not read).
Below is the script I created:
Hopefully that helps someone else get their working.