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!


2 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