Introduction: Google Home XFINITY X1 Control

This project uses the ESP8266-HTTP-IR-Blaster project by Michael Higgins and adds the ability to control your Comcast XFINITY X1 DVR/STB with Google Home and IFTTT.

Step 1: Ingredients

Step 2: Build Your HTTP IR Blaster Hardware

I built the V1 hardware of Michael's IR Blaster, because it's easier and I didn't want to deal with resistors/transistors, etc. If you're electronically inclined, and understand Ohm's etc, feel free to follow his hardware schematic. Your ESP8266 and LED's will likely last a little longer than mine.

Step 3: Setup and Flash the Software to Your ESP8266

I used V2 of the software since it works with the V1 hardware setup, is more up-to-date and supports more remote brands. I was able to read my Samsung TV remote's Volume and Power buttons using the Arduino app's serial monitor. Read Michael's tutorial on his GitHub project on how to do this. Follow every part of the Drivers and Setup parts of his tutorial, up through Step 8. (Don't do Step 9 yet.)

Drivers: https://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx

Setup:

  1. Install Arduino IDE
  2. Install ESP8266 Arduino Core
  3. Install the following libraries from the Arduino IDE Library Manager: ESP8266WebServer,ESP8266WiFi,ArduinoJson
  4. Manually install the IRremoteESP8266 library
  5. Load the IRController.ino blueprint from Michael's repository in the Arduino IDE App
  6. Customize your WiFi settings, ports, IP address, and passcode at the top of the blueprint
  7. Upload blueprint to your ESP8266. Monitor via serial at 115200 baud rate
  8. Forward whichever port your ESP8266 web server is running on so that it can be accessed from outside your local network

Step 9 in his GitHub project is specific to the Amazon Echo (Alexa), so ignore that step, unless you're doing this for Google Home and an Amazon Echo. Also, his library is not equipped to read XMP-based IR signals from the Comcast XR11 remote, so we'll handle that part next...

Step 4: Putting Together URLs for IFTTT

The hard part was finding Comcast XFINITY remote codes. My remote is an XR11. This took a lot of digging and signal code converting, but I eventually ended up with the RAW IR codes for each button on the XFINITY XR11 remote.

The HTTP IR Blaster uses a URL format like this:

http://10.0.0.10:8081/json?pass=my_password&plain=[{"type":"raw","data":[100,200,300,etc.],"khz":38,"pulse":1}]

Except, the "data" part has many many more numbers. And, if you want to send a few numbers to send a channel code to your X1 box, you'll need more than one {} object in the string, separated by comma's. Here's an example of a 3-channel code, plus the OK button to tell the blaster to change to channel 810. The data in the brackets after &plain= is formatted like this:

[{code_for_number_8},{code_for_number_1},{code_for_number_0},{code_for_OK_button}]

Each button code needs the type (always "raw"), the data (different for each button), the frequency (always 38khz) and the pulse (always 1), so it looks like this:

{"type":"raw","data":[button_code],"khz":38,"pulse":1}

Now that you understand the format for sending channel codes to the X1, here are the button codes:

OK Button

[210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1848,210,760,210,760,210,1032,210,1440,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,760,210,1848,210,760,210,1032,210,1440,210,760,210,760,210,80400]

Exit Button

[210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1168,210,760,210,760,210,1032,210,2120,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2256,210,1848,210,760,210,1032,210,2120,210,760,210,760,210,80400]

1:[210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2664,210,760,210,760,210,760,210,896,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1576,210,1848,210,760,210,760,210,896,210,760,210,760,210,80400]

2:
[210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2528,210,760,210,760,210,760,210,1032,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1440,210,1848,210,760,210,760,210,1032,210,760,210,760,210,80400]

3: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2392,210,760,210,760,210,760,210,1168,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1304,210,1848,210,760,210,760,210,1168,210,760,210,760,210,80400]

4: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2256,210,760,210,760,210,760,210,1304,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1168,210,1848,210,760,210,760,210,1304,210,760,210,760,210,80400]

5: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2120,210,760,210,760,210,760,210,1440,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1032,210,1848,210,760,210,760,210,1440,210,760,210,760,210,80400]

6: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1984,210,760,210,760,210,760,210,1576,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,896,210,1848,210,760,210,760,210,1576,210,760,210,760,210,80400]

7: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1848,210,760,210,760,210,760,210,1712,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,760,210,1848,210,760,210,760,210,1712,210,760,210,760,210,80400]

8: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1712,210,760,210,760,210,760,210,1848,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2800,210,1848,210,760,210,760,210,1848,210,760,210,760,210,80400]

9: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1576,210,760,210,760,210,760,210,1984,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2664,210,1848,210,760,210,760,210,1984,210,760,210,760,210,80400]

0: [210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,2800,210,760,210,760,210,760,210,760,210,760,210,760,210,80400,210,896,210,1712,210,760,210,2800,210,1304,210,1304,210,1168,210,2664,210,13800,210,896,210,1712,210,1848,210,760,210,760,210,760,210,760,210,760,210,80400]

Now, let's create an IFTTT command to send a channel code to the ESP8266.

Step 5: IFTTT Channel Commands

Create a new Applet for the Command (Channel) you want to change to. Choose Google Assistant for the IF part of the applet. Give it a few ways you'd like to ask for the number, such as "Cartoon Network", "Change the TV to Cartoon Network" and "Change the TV to the Cartoon Network". In case you say it differently every now and then.

Use the Maker service for your THEN part of the applet and use your URL with all the codes from the previous step, choose GET for the Method, and text/plain for the Content Type.

You can leave the "Receive notifications when this applet runs" switch ON until you've tested and verified that it works. After that, you want to turn that off so your phone doesn't notify you every time someone uses the command.

Step 6: Two LEDs for TV and Set Top Box (optional)

You might have noticed on the photo of my board that I have an extra LED attached. This is because my DVR is inside of an entertainment center (cabinet). The ESP8266 is inside that cabinet, which means I can't also turn the TV on and of, since it's up on the wall. I have a longer jumper wire that sticks out the back of the cabinet and points up to the TV. In the photo, I have the long wired LED hanging down in front of the DVR and the other pointed at the TV's IR receiver, but I have since swapped that so the IR Blaster is hidden in the cabinet.

The great part is that it's powered by the USB port on the back of the DVR!