@@ -45,19 +45,26 @@ minutes!) to scan the ZWave network and set up its data structures.
4545So, be sure to register a "scan complete" callback, and after it gets called,
4646you can safely start issuing commands to your ZWave devices.
4747
48- Modifying device state:
48+ ** Controlling zwave valueIDs** is usually done by passing the ValueID as a
49+ Javascipt object or as 4 discrete integer arguments:
50+ - 1: ZWave Node Id,
51+ - 2: Command Class,
52+ - 3: Instance and
53+ - 4: Index
54+
55+ For example if Zwave Node #3 is a binary switch, to turn it on and off, use
56+ command class 37:
57+
4958``` js
50- /*
51- * Set arbitrary values.
52- */
53- // 1) by means of passing each individual ValueID constituent:
54- zwave .setValue (nodeid, commandclass, instance, index, value);
55- zwave .setValue (3 , 37 , 1 , 0 , true ); // node 3: turn on
56- zwave .setValue (3 , 37 , 1 , 0 , false ); // node 3: turn off
57- // dimmer node 5: set to 50%
58- zwave .setValue (5 , 38 , 1 , 0 , 50 );
59- // 2) or by passing the valueID object (emitted by ValueAdded event):
60- zwave .setValue ({ node_id: 5 , class_id: 38 , instance: 1 , index: 0 }, 50 );
59+ zwave .setValue (3 , 37 , 1 , 0 , true ); // node 3: turn on
60+ zwave .setValue (3 , 37 , 1 , 0 , false ); // node 3: turn off
61+ ```
62+
63+ Another example: if Zwave Node #5 is a dimmer, use class 38:
64+
65+ ``` js
66+ zwave .setValue (5 , 38 , 1 , 0 , 50 ); // 1) passing each individual ValueID constituent:
67+ zwave .setValue ({ node_id: 5 , class_id: 38 , instance: 1 , index: 0 }, 50 ); // 2) or a valueID object (emitted by ValueAdded event):
6168
6269/*
6370 * Turn a binary switch on/off.
@@ -94,13 +101,13 @@ zwave.setNodeName(nodeid, name); // arbitrary name string
94101
95102Polling a device for changes (not all devices require this):
96103``` js
97- zwave .enablePoll (nodeid, commandclass , intensity);
98- zwave .disablePoll (nodeid, commandclass );
99- zwave .setPollInterval (nodeid, )
100- zwave .getPollInterval ();
101- zwave .isPolled ();
102- zwave .setPollIntensity ( );
103- zwave .getPollIntensity ( );
104+ zwave .enablePoll ({valueId} , intensity);
105+ zwave .disablePoll ({valueId} );
106+ zwave .setPollInterval (intervalMillisecs) // set the polling interval in msec
107+ zwave .getPollInterval (); // return the polling interval
108+ zwave .setPollIntensity ({valueId}, intensity); // Set the frequency of polling (0=none, 1=every time through the list, 2-every other time, etc)
109+ zwave .getPollIntensity ({valueId} );
110+ zwave .isPolled ({valueId} );
104111```
105112
106113Association groups management:
0 commit comments