Thursday, December 28, 2017

Controlling X10 with Alexa

 I thought it would be fun to control the X10 modules in my house with an Echo Dot .

I am unapologetic about using this 1980's technology for much of my HA.  It's cheap and it works for me.

A quick search revealed that there is an Arduino library written by  Tinkerman that interfaces an ESP8266 to Alexa. (It mimics Belkin WeMo switches.)

Once you have the ESP8266 responding to Alexa, the world is your oyster!

Since I have already written the code to control the CM17A X10 module in Arduino, it was just a matter of combining the two functionalities.

In use, the chain of events is as follows ...
I tell Alexa, "turn tree on". Alexa sees a WeMo switch device named "tree". The Arduino sketch receives that event and calls the corresponding house and unit command for the CM17A. The CM17A transmits the code wirelessly to a TM751 transceiver (or the like) which puts the signal on the powerline. The signal is picked up by an X10 module which turns on the device.

Hardware-wise you need some kind of ESP8266 dev board, an optional I2C OLED display, a CM17A module (AKA X10 Firecracker),  an X10 wireless receiver, a lamp or appliance module. You also need a level shifter.



The level shifter is needed because the ESP8266 is a 3.3V device and the CM17A requires ~5V to operate. Also, since the CM17A is powered by the difference between RTS and DTR,  strong pullup resistors (330Ω) must also be used on the high side of these signals. Here's a rough diagram ...


I have the source code pretty much finalized for this project. If you are interested, you can download what I currently have here,

Enjoy!


6 comments:

  1. Very nice. I control many items in my house with X10 and would need very interested in the code. I'm currently using heyu running on an RPi with a mobile website interface.

    ReplyDelete
    Replies
    1. Robert,
      You can download the current sw using the link at the end of the now modified post.

      Delete
  2. I also have many X10 devices and have an echo dot. Had a CP290 back in the day that failed. For many years now have been using 4 wireless remotes (HR12A) talking to two receivers. Would love to implement your project,but 74.7 trips around the sun has eliminated all hope of me building such a device because of the hand shakiness of age. With that in mind, I would gladly pay for a turn-key solution. Please contact me via gmail.com as mig29e if you are interested in providing a solution to my challenge. We live in central Illinois.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete

  4. I built something very similar that listens to an MQTT server so that it can be used with more than just Alexa. Also, since the FireCracker has a PIC 12C508A chip, it will work fine at 3.3V, so you could simplify your circuit.

    ReplyDelete
    Replies
    1. Humph! Good to know. I thought it needed 5V for better transmit power, but that could be wrong. Thanks for the info!

      Delete