Getting the level of a device or a sensor from the command line

9. October 2012 02:25 by Ryan in Clipsal, InControl Tips, z-wave  //  Tags: , , ,   //   Comments (0)
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):

Thermostat Scheduling Using InControl

31. May 2012 02:01 by Ryan in Clipsal, InControl Tips, z-wave  //  Tags: , ,   //   Comments (0)

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.