Sometimes it's beneficial to activate a scene when motion is detected. This tutorial will step through how to setup this quick rule using InControl Home Automation.
The first step of the process is to create a new scene. I won't cover the details of scene creation here though. This scene will be the one that turns on a light when motion is detected.
Now create a new rule. I named mine "Light on with Motion." Select the trigger of "On Device change State/Level" and leave the default script of "ActivateScene.cs."
The trigger we picked will watch a device -- in this case, our motion sensor -- and then activate a scene when that device is tripped.
Go ahead and click the Rule Data button and choose the NodeIds option. Find your motion sensor and check it.
The next data item we want is "Off to On." We'll pick that one because we want the motion sensor to trigger the scene when it detects motion. If we wanted to trigger a scene when motion is done, we'd choose "On to Off."
As the final step, choose the Scene data option and find the scene you'd like to activate.
Getting the sensor value or the level of a device from the command line is fairly straight-forward with InControl. In this tutorial, I'll describe how to accomplish this with a device that reports multiple sensor values. The same concept will work even with a standard light.
First of all, ensure that you are at least running version 2.80 of InControl on your PC.
This tutorial will assume you are doing this from a Windows computer. It should still work in a similar fashion on other OSes though.
Step 1: You need to get a copy of CURL. Some OSes such as Linux might already have this. If not, visit the CURL web page to download the appropriate version for your operating system.
Once you have that downloaded, extract the curl.exe to your hard drive. To make this easier, put your CURL.EXE file in your C:\WINDOWS\SYSTEM32 folder. This isn't required, but makes it easier for the sake of this tutorial and helps prevent the "COMMAND IS NOT RECOGNIZED" errors that are common.
Step 2: Find out what your computer's IP address is. This is the computer where you have InControl installed. The quickest way to find this is to open up a CMD window (by clicking Start/Run and typing CMD). Once the window is open, type in ipconfig and hit enter. You should get output similar to this:

The important information is found on the line that says IPv4 address. In my case, it's 10.4.3.178 - make a note of this number because you'll need it later on. Note: if you see many of these listed like I do, the most likely bet is that it's the only one with a value for Default Gateway.
Step 3:Create a "Sensor" device. This step is optional and is only required if your device includes sensor readings. My thermostat is just such a device - you can recognize these types of devices because they'll have a table of additional values. Take a look at my thermostat device:
Notice in the above screen shot that there is a line that reads "Temperature" and shows a value of 69. That's a sensor reading. If you want to get that value, you'll need to create a sensor device based on it. Notice the blue button to the left of "Temperature?" Click that to create this new virtual device. Give it a name - I named mine "Main Temperature."
Step 4:Find out the device Id of your device. This will be the virtual sensor device you just created in step 3 or any other device you want to get a level on. For this step, we'll use a browser such as Google Chrome (note, this works in all browsers, but is easiest to do in Chrome). From your PC running Incontrol, open up a browser and type in this url: http://localhost:1178/zwave/devices?password=123. Be sure to substitute "123" for your password if you have one set. You should get a window full of something that looks like this:
Search for your device by hitting CTRL+F and typing in the device's name. Near your device, you should see a deviceId. I've highlighted mine in the screen shot above. You need to make note of that Id - it's everything in between the quotes. In my case, the id is 15647143-5913-486d-a932-76879000011d.
Step 5:Retrieve the level of the device. It's time to use CURL to get the device along with the level. Type in the following command into a CMD window: http://10.4.3.178:1178/zwave/device/15647143-5913-486d-a932-76879000011d&password=123. Be sure to substitute "10.4.3.178" with your IP address that you located earlier. You'll also need to substitute your device id and password. Here's how my curl output looks - you'll also notice that my main temperature is at 69 degrees ("level":69):
Microsoft has a new product out called On{X}, which lets you add even more brains to your Android device. On{X} is basically an engine that let's you check your phone's many sensors (like GPS) and then perform special tasks when something important happens.
For me, I wanted to setup On{X} to watch my GPS and when I got near my home, it would tell InControl to activate my z-wave enabled garage lights (New to Z-Wave?) Here's how I set it up.
Step 1: Setup a scene inside InControl that activates the lights that should turn on when On{X} detects the phone arriving near the house.
a) Create a new scene. I named mine "Garage On." 
b) Click Add Device, choose the Garage Lights, then adjust the slider to the "On" position. 
c) Click Activate Scene to verify that the garage lights turn on properly
d) For this to work, you'll need to make sure you've taken a few steps to access InControl over your 3g phone network.
Step 2: Setup an account on On{X}. It's free and relatively painless since it uses Facebook.
Step 3: Click the Create button to start a new script. You'll end up with a screen that looks like this:

Step 4: Delete all the code you see in your script, then copy & paste the following into the window:
// Initializing variables
// This requires InControl Home Automation (http://www.incontrolzwave.com)
var location = { name : "Home",latitude : "28.482657",longitude : "141.935347" } ;
var inControlServer = "http://208.15.221.12"; // Enter your external IP
var inControlPort = "1178";
var inControlPassword = "";
var sceneName = "Garage On"; // Enter the name of your scene
// End of variables initializing
console.log('Started script: Turn on Garage Lights when arriving home');
// create a geo region for the trigger to take place at
var region = device.regions.createRegion({
latitude: parseFloat(location.latitude, 10),
longitude: parseFloat(location.longitude, 10),
name: location.name,
radius: 500
});
// Assign the callback when entering the region
region.on('enter', function () {
console.log('Entered target location!');
// Create a notification that the timer has been started
var notification = device.notifications.createNotification('Welcome to ' + location.name + '.');
notification.content = "Your lights have been turned on.";
notification.show();
device.ajax({
url: inControlServer + ":" + inControlPort + '/zwave/activateScenePost',
type: 'POST',
data: JSON.stringify({
password:inControlPassword,
sceneName:sceneName,
activate:"1"
}),
headers: {
'Content-Type': 'application/json;charset=utf-8'
}
},
function onSuccess(body, textStatus, response){
console.log("Sucess:" + textStatus + ":" + body);
},
function onError(textStatus, response){
console.log("onError:" + textStatus + ":");
});
});
// start monitoring the region
device.regions.startMonitoring(region);
console.log('Completed script: Turn on/off garage lights.');
Step 5: Customize the script to work with your home
a) Change your lat and long to match where your house is. To find mine, I used Google Maps. Just right click on your house and choose "What's here?" to have it show you the Latitude and Longitude (you'll need to hover your mouse over the green arrow that shows up).

b) Change your IP address to match what your own external IP is. Just go to www.whatsmyip.com and copy the IP address shown.

c) Change the scene name to match the one you created earlier in InControl.

Now just save your rule and send it to your phone. Next time you come back to your home, your garage lights should activate automatically for you.
This requires InControl version 2.0 or higher.
This page will describe the steps required to setup a thermostat to turn up the heat at 7 AM and turn it down again at 10 PM, Monday through Friday.
Step 1: Create Scene to turn thermostat heat to 72 degrees.
a) Click the New Scene button and enter a name describing the scene.

b) With your new scene selected, click Add Device... and check the box next to your thermostat. After the your thermostat has been added to the scene, you can click on it and enter a Cool and Heat point. I set my cool point to something high and my heat point to 72.
Step 2: Create Scene to turn thermostat heat to 60 degrees.
Repeat step 1 again, this time creating a scene named "Thermostat Heat Off" which tells your thermostat to go to a low heat point, such as 60.
Step 3: Create rule to activate heat on scene at 7 AM
a) Click New Rule and name it "Heat on: Morning"

b) Select the rule Heat On: Morning in your list and verify that Trigger and Script to Execute are set to "On a Specific Date (repeatable)" and "ActivateScene.cs", respectively and that the rule is marked as Enabled.

c) Click the Rule Data... button. Enter today for the Target Date, and 7:00 AM for when you want the heat to turn on. NOTE: This date may be in the past. This is OK since we are going to tell this rule to repeat everyday at the same time.

d) Choose the scene you'd like to activate for this rule. In this case, we pick "Thermostat Heat On."

e) For the Interval, enter "Days" to specify that this rule should repeat every day.

f) For the interval number, we will specify "1" to tell it to repeat every 1 day.

g) Finally, choose which Days of the Week you'd like this rule to be valid on.

Step 4: Repeat step 3, creating a rule to activate the "Heat Off" scene at 10 PM.
Your thermostat should now turn on and off every day based on the schedule you set.
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.
If you've ever wanted to integrate another program with InControl, one way to do it would be to use CURL to consume the hosted service. This page will outline the steps needed to perform such a task.
This tutorial will assume you are doing this from a Windows computer. It should still work in a similar fashion on other OSes though.
Step 1: You need to get a copy of CURL. Some OSes such as Linux might already have this. If not, visit the CURL web page to download the appropriate version for your operating system.
Once you have that downloaded, extract the curl.exe to your hard drive. To make this easier, put your CURL.EXE file in your C:\WINDOWS\SYSTEM32 folder. This isn't required, but makes it easier for the sake of this tutorial and helps prevent the "COMMAND IS NOT RECOGNIZED" errors that are common.
Step 2: Find out what your computer's IP address is. This is the computer where you have InControl installed. The quickest way to find this is to open up a CMD window (by clicking Start/Run and typing CMD). Once the window is open, type in ipconfig and hit enter. You should get output similar to this:

The important information is found on the line that says IPv4 address. In my case, it's 10.4.3.178 - make a note of this number because you'll need it later on. Note: if you see many of these listed like I do, the most likely bet is that it's the only one with a value for Default Gateway.
Step 3: Figure out your the scene's Guid ID that you want to activate. A Guid is just a simple way to identify an object. Each scene in your system is assigned something unique.
Go back to your CMD window now and be prepared to type in this command:
curl -X PUT -H "Content-Type:application/json;charset=utf-8" -d "{\"password\":\"yourPassword\"}" http://10.4.3.178:1178/zwave/getScenes
I've highlighted certain portions of the command that you'll need to change specifically for your own setup. If you use a password, replace yourPassword to match the password you setup. Just delete the text if you don't have one a password.
Replace 10.4.3.178 with the IP Address you noted from step 2.
Execute the command by hitting ENTER. Here's how it should look -- and I want to point out that this may not be for the faint of heart! Indeed, it could appear to be as cryptic as the vertical lines from the Matrix. Don't worry though, I'll help you sort it out:

Look for your scene in that list. I've highlighted mine for example purposes. The one I'm interested in is named "Portable Sonos." What you want is the sceneID associated to that scene, in this case, it's the series of numbers/characters that starts with 90f18. Grab the entire set of characters, including dashes up until the final quote and make a note of it.
This ID will never change, so once you have it you can store it away somewhere and always use it to activate that scene.
Step 4: Activate the scene.
It's now time to use another curl command to activate the scene we picked. I'll once again highlight the portions that you'll need to change to match your own setup.
curl -X PUT -H "Content-Type:application/json;charset=utf-8" -d "{\"password\":\"yourpassword\",\"sceneId\":\"90f18fea-bd80-4c53-96a3-5b04429ca790\",\"activate\":\"1\"}" http://10.4.3.178:1178/zwave/activateSceneByGuid
That's it! If everything went well your scene should now be active. You can repeat this command anytime to turn that scene on again.