X10 is the OG of the Smart Home universe. The protocol was developed in 1975 in Scotland and modules started showing up in Sears, Radio Shack, and mail order magazines a couple of years later. Its amazing the range of X10 devices you can still find in use in both residential and industrial environments.
A couple of months ago, I wrote THIS post on installing an X10 signal boosting phase coupler for my home automation system. The device bridges the two phases of the home’s electrical service, as well as increasing the signal strength – very useful since all kinds of devices plugged into your home put out lots of interference.
True story – in 2008, I was installing X10 modules in my house (at that time) in Leland, NC. I wanted to grab a meter to verify that I’d turned off the correct breaker for the switch I wanted to swap out. In my garage, I had the big toolbox that my father used at his work, so i wanted to get one of his meters. I always enjoy using Dad’s tools when I work on a project.
What I actually pulled out of his box was a Leviton X10 tester. I’d never discussed home automation with Dad before he passed and didn’t know much about the controllers he programmed for his employer. It took me a minute to realize what the device I held was – what the addresses on the front meant – and to then further realize that at least 10 years or so before I started my home automation project, he was using X10 to automate equipment at his day job.
So, even though there are devices we didn’t dare hope for in home automation ten years ago, I’m always going to include X10 devices in my home automation ecosystem because of the link it gives me with Dad.
Now that you know the background of WHY I include X10, I want to give you an example of HOW to do it.
You don’t need the XTB-IIR (it REALLY helps if you do), but you do need a controller – think hub in terms of modern smart home products. I use the CM15A combined with the ActiveHome SDK (available for download HERE). You need to install the SDK to access the CM15A. Make sure the CM15A is plugged in so that Windows properly installs drivers.
In Visual Studio, select New, then Project. In the left section, under “Installed,” select Visual Basic, then Windows Desktop. Enter a name for your project (what you want to call the app) and select a new “Location” folder if you don’t want to install in the default.
VB creates a new blank form. In the Toolbox menu, double click Textbox to add it to the form. Click the arrow selector and choose Multiline, then size it to use most of the form’s available space, as pictured. In the properties for the textbox, find “Name” in the “Design” section and enter.
Next, in Solution Explorer, right-click References, then select “Add Reference,” and then click the “Browse” button. Navigate to C:\Program Files (x86)\AHSDK\bin (this is the default install location – modify as needed based on your install of ActiveHome SDK). Select ahscript.dllm, click ADD – this should add and select ahscript.dll in Reference Manager. Click OK.
In form1.vb, right click the background of the form and select “View Code.”
Enter this code:
Save your project and then click Start to launch your Sensor Viewer. I used an M16A motion detector to test my viewer, but you can use any X10 remote or switch to do the same. Make sure your CM15A is plugged in and connected before running. This is hardly even worth calling an example, but you now know how to add a reference to the SDK and display signals received via RF or PLC. Once we’ve verified that the CM15A works, the sensor or remote works, and that the connection to the SDK works, we can start adding useful functionality!
Note – I make a habit of typing everything in – I feel that it helps me connect to my code more closely. If you’d rather just copy and paste, here’s a link to the source code. Open it in any text editor, copy, then overwrite all existing code in your form1.vb with this:
SmarterHome.club is the website for our Facebook community, The Smarter Home Club – which is an umbrella for all kinds of smart home technologies – home automation, security, custom electronics, weather stations, alternative energy, you name it. DIY focused.
If you’re interested in joining the Smarter Home Club’s Facebook group, please follow this link: