How to activate Z-Wave scenes from your HTPC IR remote control

11. May 2012 23:30 by Ralf in InControl Tips, z-wave  //  Tags: , , ,   //   Comments (0)

About twelve months ago, I added Z-Wave lighting control to my home theatre. It was a geeky experiment and I had low expectations, but it turned out to be the most enjoyable and satisfying tech project I’d undertaken in ages. I started out small with just a couple of in-wall dimmer modules and a basic controller. I’ve since become obsessed with all things Z-Wave and have started adding more and more automation throughout house, with InControl at the heart of it all (of course!).

For the home theatre, I researched a number of different options to control both Z-Wave and IR devices from a single universal remote. What I found was that the majority of solutions available are either very expensive or somewhat limited in functionality. Since I was satisfied with my current Logitech Harmony remote for controlling all my AV gear, including the HTPC, I really wanted to find a way to use this to also control my Z-Wave light modules. Doesn’t make sense? Keep reading…

Most HTPC enthusiasts will be familiar with the concept of using software to map IR remote control key presses to custom tasks or actions. So, what if there was a way of triggering Z-Wave scenes from the command line or a script? This would mean you could use your remote software to map IR requests to Z-Wave scene changes! As it turns out, InControl provides a simple way for you to achieve this very thing and I’ll explain how to get it all working in the following steps.

Step 1: First, consider the scenes you want to control and create these via the InControl console. For example, when watching movies in my home theatre, I wanted two very specific actions to trigger when I hit PLAY or STOP on my remote control:-

  • PLAY: start movie playback and dim the lights to 10% (Scene 1)
  • STOP: end movie playback and raise light levels to 60% (Scene2)

I will be using these two actions as the basis of this tutorial. Here’s how I’ve configured the relevant scenes inside InControl:-

Scene 1

 

 

Scene 2

 

 

Step 2: Next, follow Ryan’s excellent guide: “Activate a scene from the command line”. This will provide you with the cURL commands needed to activate your selected scenes.

Step 3: You’ll want to save these cURL commands to separate command files. This will make it easier to call the scenes from your IR software. I’ve chosen to use simple .bat files named HTLightsUP.bat and HTLightsDOWN.bat. For example:-

Contents of HTLightsUP.bat (Scene1)

@ECHO OFF

curl -X PUT -H "Content-Type:application/json;charset=utf-8" - d "{""password"":""1234"",""sceneId"":""7839c489-5f77-47cf-a05d- e55840778b77"",""activate"":""1""}" http://192.168.1.100:1178/zwave/activateSceneByGuid

Contents of HTLightsDOWN.bat (Scene2)

@ECHO OFF

curl -X PUT -H "Content-Type:application/json;charset=utf-8" - d "{""password"":""1234"",""sceneId"":""8351ef73-d25c-468f-b260- 7833f1b92593"",""activate"":""1""}" http://192.168.1.100:1178/zwave/activateSceneByGuid

Step 4: Now it’s time to map the two .bat files to the PLAY and STOP buttons on your remote control. There are many different remote controls and IR software solutions available which makes this step a little complicated to describe. Regardless of this though, the process of mapping key presses to actions is going to be more-or-less the same. So, I’ve demonstrated the way to set this up using a standard MCE remote with JRiver Media Center. JRiver’s Theater View is the best Media Centre front-end available and provides built-in support for most IR remotes:-

a) Open JRiver and navigate to Options > Remote Control:-

 

Note: I have disabled “Microsoft MCE” and chosen “Remote, keyboard, gamepad or other HID” as the Selected input device under Drives & Options. This allows me to use the standard Arrow, Enter and Play controls (which work natively under Windows 7) but also allows me to trigger custom commands as required.

b) Click the Commands link and select Play/Pause:-

 

c) Click “Start Learning” and press the PLAY button on your remote:-

Note: Ignore any prompts recommending not to learn the IR key press. As I mentioned above, PLAY will work out-of-the-box without needing to learn the command when using the MCE controller. However, we want to retain this behaviour and trigger an action (next step below). This is the way you achieve both! Again, this process will be the same regardless of the IR software you use when you use a MCE remote under  Windows.

d) With Play/Pause still selected, click the Edit button and delete the default command action “MCC: Play/Pause”. Next, click the Add Run button.

e) Browse and select the HTLightsDOWN.bat file you created in step 3 and enable the Run Invisible check box (to prevent the DOS window from showing when the scene is triggered):-

 

 

 

 

f) Click OK and repeat from step 4 for the STOP/HTLightsUP.bat association.

 

You’re done! Sit back and enjoy a fully automated home theatre experience

Editor's Notes:

If you are new to z-wave, be sure to check out the quick-start guide to learn the basics. InControl Home Automation software can be purchased in package deals for great savings and includes most things needed to get started (USB stick & software) with your home theatre experience.

Pingbacks and trackbacks (2)+