If you have an Xbox One (or thinking about getting one), and you’re a fan of home automation (like me), then you probably love the infrared AV device control feature that is already built into the Xbox One.  This feature lets you tell your Xbox One what brand and model of TV, AV receiver, and cable box you have in your entertainment center so that the Xbox One can turn them on and off and control them using infrared (IR).  But, I wanted to take it quite a bit further.

I wanted to control more than just my entertainment center electronics with my Xbox One.  Those Xbox voice commands are so convenient, I wanted them to also turn my lights on and off.

Here is my integrated entertainment center home automation demo…

What I’ve already covered

I have some remote-controlled color-changing LED light strips around the edges of my TV, and in my previous article, I explained how to integrate them with my Z-Wave home automation system.  Now I have scenes setup on my Vera that tell the LED light strips to toggle on and off as well as scenes for different colors.

But how can I make the Xbox One send IR commands that trigger these Vera scenes?  Here’s how I did it…

Xbox One, Talk to the HTPC

Since I use a home theater PC (HTPC) running XBMC/Kodi instead of cable or satellite, I did not have any cable box configured in the Xbox One, so I told the Xbox that my cable box is a Windows Media Center PC.  This made the Xbox One send IR commands as if it were turning a Windows Media Center PC on and off.

HTPC, Listen to the Xbox One

The next step is to figure out how to get my HTPC to start listening to those IR commands.  I already have a USB IR receiver which I use for the Logitech Harmony remote so it’s technically receiving the IR commands, but I need to figure out which commands and what to do with them.

So, I installed EventGhost.  I highly recommend EventGhost to anyone that wants to implement any kind of automation on a Windows PC.

event-ghost

What I did was install the MceRemote plugin (which allows EventGhost to intercept incoming Media Center remote IR commands) and started making the Xbox One send commands by turning it on and off.  When I did that, EventGhost would pick up incoming IR commands and I would drag them from the left side over to the right side to configure them with actions.

HTPC, Trigger a Z-Wave Scene on the Vera

Now, what action can I create in EventGhost that would trigger a Z-Wave scene?  Well, a batch script, of course!

I did some research and found there is an HTTP interface to the Vera that allows you to do almost anything.  This is what various Z-Wave Remote mobile apps use.  So, I wrote a batch script.

Xbox One Z-Wave Batch Script

The first line has “@echo off” to allow the script to run invisibly (avoids the black command prompt window from popping up in front of my shows).

The second line is a “wget” command that basically does an HTTP call to the URL provided.  The URL is the IP address of my Vera with a bunch of variables that define many things including which scene number to run (ex. 46).

Note: Before saving the URL into the batch file, test it to make sure it will work by simply entering the URL in your browser.  It will return some info on the page that can tell you if it was successful or if it failed.

 Success!

I now have my lights toggling on and off along with the Xbox One!

If you like this, share it!

 

See also: