Jump to content

Setting Z-Wave Configuration Parameters using your browser (REST)


Chris Jahn

Recommended Posts

The following works in both the 4.x.x and 5.x.x  ISY versions supporting Z-Wave:

 

You can use the following URL in a browser to set the Z-Wave parameter, and it should let you set a full 4-byte value.  You can also specify a hexadecimal value by prefixing it with ‘0x’

 

https:///rest/zwave/node//config/set///>

 

The parameter size can be either 1,2, or 4 bytes

 

e.g.

 http: //192.168.0.51/rest/zwave/node/ZW003_1/config/set/1/77/1

 http: //192.168.0.51/rest/zwave/node/ZW003_1/config/set/2/0xFFFFFFFF/4

 

 

You can query the actual value stored in the device by doing the following:

 

https:///rest/zwave/node//config/query/>

 

e.g.

 http: //192.168.0.101/rest/zwave/node/ZW003_1/config/query/2

 

It will return something like:

 

  • Like 4
Link to comment
Share on other sites

It's supported at least as far back as 4.3 and likely close to when ZWave was added to the REST interface (1st line in post says 4.x.x or 5.x.x, so for a while).  I'm running 4.3.26 and while not using it from a browser, I am using REST based scripts to do this and it works.

 

One caveat - at least under 4.3.26, there is a problem where the set command always returns successful, even when it failed -- query works and reports errors appropriately if it can't contact the device (a more likely event for battery powered devices).

Link to comment
Share on other sites

For folks looking to script this process, the wget command is available for all platforms (it's native to linux, but there are builds for Mac and Windows).  With it, you can write a script file to set all your parameters, then run it and wake up your device to have it all set in one blurp (helpful for battery devices that might go back to sleep if you were to delay between each parameter setting).  I actually created a script to setup each type of device.  For example, my everspring climate sensors need 3 parameters set to work for my use.  I have 12 of the sensors around this house and the settings are in a script where I pass the ZWave ID as a parameter.  When I add a new or replace a unit, a single command configures it.  I have a script for those, power sensors, doorbells, motion sensors.

 

A typical usage would be:

wget -q -O - --user=USRNAME --password=PASSWD http://isy994i/rest/zwave/node/ZID/config/set/P#/VALUE/SIZE

where

USRNAME is the ISY user name

PASSWD is the ISY user password

isy994i is the dns name of your unit (or use an IP address)

ZID is the ZWave ID from the ISY (like 'ZW002_1')

P# is the parameter # to set

VALUE is the value to set into the parameter

SIZE is the value size from the ZWave docs for that device/parameter (1,2 or 4)

 

NOTE: The "-O -" (that is, dash oh, not zero) directs wget to write the results returned from the ISY to the console/display.  If you'd rather not see it, you can put a file name there like "-O setparam.log" and direct it out to a file.

 

Example:

Setting Parameter 6 to a value of 1 for my climate device ZW031_1 would look like:

wget -q -O - --user=admin --password=admin http://isy994i/rest/zwave/node/ZW031_1/config/set/6/1/2
Its pretty easy to string a bunch of these together in a script to program a specific kind of device
 
You can also use this to query a configuration parameter like this:
 
wget -q -O - --user=admin --password=admin http://isy994i/rest/zwave/node/ZW031_1/config/query/6
note that the result is returned as an XML fragment (just look for the value= part for the value) and it includes the size of parameter you'd use for setting the parameter (useful when you're not sure -- zwave docs can be very unreliable about actual size). 
 
Finally, a good (but not perfect) place to find ZWave parameter documentation is  http://www.pepper1.net/zwavedb/device
 
Gerry
  • Like 2
Link to comment
Share on other sites

You can actually use a network resource to call the REST API on the same ISY. It works fine AS LONG as you DON'T use 127.0.0.1 as the host. This can cause the ISY to lock up randomly...

 

If your ISY has a static IP (or a static DHCP reservation), you can use the actual IP in the host field....

 

Just make sure to add an Authorization header with your ISY username and password...

 

Michael.

  • Like 4
Link to comment
Share on other sites

Is there expected in version 5 to expose other feature rather than lock/unlock/querry in the normal programing interface?  Going via rest via network module feels like your expecting a lot of the average user.  Eg. I want to add and remove user codes for a given time period for a cleaning service.  And I'm hacking around rest from my Linux box.

Link to comment
Share on other sites

Is there expected in version 5 to expose other feature rather than lock/unlock/querry in the normal programing interface?  Going via rest via network module feels like your expecting a lot of the average user.  Eg. I want to add and remove user codes for a given time period for a cleaning service.  And I'm hacking around rest from my Linux box.

 

Hi brockp,

 

Its there now, you just right+click on the device in the tree and select it from the Z-Wave submenu

Link to comment
Share on other sites

Chris,

 

Thanks for your reply.  The Z-Wave menu isn't what I mean, I men in ISY programs, if I select the device, the only options I am given are lock, unlock, and query.  I want to script this up, and not resort to hacking the REST interface.

Link to comment
Share on other sites

Chris,

 

Thanks for your reply.  The Z-Wave menu isn't what I mean, I men in ISY programs, if I select the device, the only options I am given are lock, unlock, and query.  I want to script this up, and not resort to hacking the REST interface.

 

Hi brockp,

This is available in the ISY 5.x branch, but not the 4.x.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

You can actually use a network resource to call the REST API on the same ISY. It works fine AS LONG as you DON'T use 127.0.0.1 as the host. This can cause the ISY to lock up randomly...

 

If your ISY has a static IP (or a static DHCP reservation), you can use the actual IP in the host field....

 

Just make sure to add an Authorization header with your ISY username and password...

 

Michael.

 

Now I can change the ringtone in v4 with a program. Thanks for the tip!

~Mike

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

I was going to use this feature to update the voltage setting of my AEON HEM v1 (Home Energy Monitor) for better accuracy.  The v1 does not have the ability to measure voltage itself (just current using current clamps), but does have a parameter setting to set voltage so that its Wattage calculations are accurate.  So I plan to read voltage from an Aeon Gen5 Smart Switch which does provide voltage readings and put that into the HEMv1 whenever the voltage changes by more than 1 V.  So far, this seems to send updates to the HEMv1 about 20-30 times a day.  My home voltage varies from a low of 119V to high of 125V.  The issue is that I worry about all that writing to what I assume is flash memory on the HEMv1.  Is there a concern this will destroy the memory after a while?    

Edited by blueman2
Link to comment
Share on other sites

Absolutely, yes! The flash memory for changing the LED brightness allows 1,000,000 changes. Guessing the HEM is about the same, at 30 changes a day that'd be just over ninety-one and one quarter years. You may want to start saving for a replacement B)

  • Like 1
Link to comment
Share on other sites

Absolutely, yes! The flash memory for changing the LED brightness allows 1,000,000 changes. Guessing the HEM is about the same, at 30 changes a day that'd be just over ninety-one and one quarter years. You may want to start saving for a replacement B)

 But what if it has only 1/2 the life they say.  I might have to replace this in only 45 years.  :o

 

Thanks for the sanity check!!!

Link to comment
Share on other sites

  • 1 month later...

Chris,  is it possible to make the set return a bad status when it doesn't actually set the param?  I run on a battery device and I think it sets the value, but then I check with the query and it's not set.

 

I ran this:

http://192.168.86.64/rest/zwave/node/ZW037_1/config/set/8/5/1

Which returned:

<RestResponse succeeded="true">
<status>200</status>
</RestResponse>
 
Then ran:
which returned:
<config paramNum="8" size="1" value="0"/>
Edited by Jimbo
Link to comment
Share on other sites

Hi Jimbo,

 

If the command itself cannot be sent then it will return an error, but the only way to be sure the value is updated as expected is to query it afterwards because some devices just fail silently when processing the config command.

 

I suppose we could add an optional "verify" parameter to the command that would cause us to automatically do a query after the set (its a low priority though).

Link to comment
Share on other sites

  • 3 months later...

You can, but depends on what you mean Programatically.  From outside the ISY, the REST interface is well described and pretty easy to use.  From within the ISY, you can use a network resource to basically execute the REST command and then trigger that from an ISY program.

Link to comment
Share on other sites

  • 3 weeks later...

I primary have Insteon and have been getting more and more into Zwave. I have 4 doors and a garage door with sensors. I bought a Dome Siren and can program it to turn on and off when a door opens but cannot control the volume or get to the different chimes for different doors. Is there anyone that can walk me through this? I am using isy 4.6.2 and don't know where to start.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...