Difference between revisions of "ZWave API"
m (→Traces) |
(→Start) |
||
Line 170: | Line 170: | ||
35 04/11/08 18:25:29.763 ZWJobSetLearnMode: len = 6 buf = 0x00 0x50 0x02 0x01 0xef 0x00 <0xb68d9b90> | 35 04/11/08 18:25:29.763 ZWJobSetLearnMode: len = 6 buf = 0x00 0x50 0x02 0x01 0xef 0x00 <0xb68d9b90> | ||
36 04/11/08 18:25:29.763 ZWJobSetLearnMode: start learning <0xb68d9b90> | 36 04/11/08 18:25:29.763 ZWJobSetLearnMode: start learning <0xb68d9b90> | ||
− | + | </pre> | |
= References = | = References = | ||
http://www.basshome.com/leviton_z-wave_documentation_1970_ctg.htm | http://www.basshome.com/leviton_z-wave_documentation_1970_ctg.htm |
Revision as of 00:34, 12 April 2008
Contents
Introduction
The ZWave API is not available for free. You have to get the Zensys SDK for command specifications and device class definitions. This page tries to collect all the freely available information about ZWave. The final goal is to provide a header file with all necessary definitions for basic operation with open source software.
IMPORTANT: all information added to this page _must_ have a reference to the source where it came from.
API
Frame specification
Karl Denning implemented basic ZWave support in his software "HomeDaemon". He advised that basic frame specification can be derived from his source code (http://www.intouchcontrolsforum.com/forums/showpost.php?s=e11a812b08256225ebb66a73d8f6d193&p=173&postcount=13).
Basic Classes
From the Leviton Z-Wave RS232 ASCII Interface Programming Guide (RZC0P-1LW, 10/9/2007):
Controller 1 Static controller 2 Slave 3 Routing Slave 4
that leads us to some definitions:
#define OZA_BASIC_CLASS_CONTROLLER 0x01 #define OZA_BASIC_CLASS_STATIC_CONTROLLER 0x02 #define OZA_BASIC_CLASS_SLAVE 0x03 #define OZA_BASIC_CLASS_ROUTING_SLAVE 0x04
Device Types
From the Z-Wave Configuration Information-1.pdf:
CONTROLLER 0x01 (like the ZTH200, Classes: ) SWITCH/APPLIANCE 0x10 (ZRP200, Classes: 25, 27, 75) DIMMER 0x11 (ZDP200, ZDW230, .., Classes: 26, 27, 75, ...) TRANSMITTER 0x12 THERMOSTAT 0x08 SHUTTER 0x09
Command and Device classes
From the Electronic Solutions, Inc. DBMZ Advanced User manual:
Command/Device Classes
Basic Slave Device
All
Multilevel Switch
- COMMAND_CLASS_SWITCH_MULTILEVEL
MULTILEVEL_SWITCH_GET MULTILEVEL_SWITCH_SET MULTILEVEL_SWITCH_START_LEVEL_CHANGE MULTILEVEL_SWITCH_STOP_LEVEL_CHANGE
additional information from http://zwaveworld.com/forum/index.php?showtopic=237:
>?FI003,017,000 //basic class 3 (slave), generic class 0x11 (multlevel switch), specific class 0
Basic
- COMMAND_CLASS_BASIC
BASIC_GET BASIC_SET
Mandatory
Multilevel Sensor
(from the Vizia RF Application Note)
- COMMAND_CLASS_SENSOR_MULTILEVEL
example get:
>N4SE49,4 (RZC0P Syntax)
sensor report:
<N004:049,005,001,009,075 049: device class 005: command report 001: value send is a temperature value 009: value represented with 1 byte in degrees fahrenheit 075: 75° F
Manufacturer Specific
- COMMAND_CLASS_MANUFACTURER_SPECIFIC
Show the ESI product data:
MANUFACTURER_SPECIFIC_GET
Example return message:
0x00 0x33 0x52 0x50 0x30 0x32 0x00: maunfacturer id high byte 0x33: manufacturer id low byte, ID: 0x0033 Product type ID "RP" Product ID "02"
Version
- COMMAND_CLASS_VERSION
VERSION_GET
Example return message:
0x04 0x02 0x06 0x01 0x01 0x5a 0x04: Library type 4 for basic slave device 0x02: Protocol version 2 0x06: Protocol sub version 6 0x01: Application version 1 0x01: Application sub version 1 0x5a: ?
All Switch
- COMMAND_CLASS_SWITCH_ALL
SWITCH_ALL_GET SWITCH_ALL_ON SWITCH_ALL_OFF
Configuration
- COMMAND_CLASS_CONFIGURATION
Each parameter is a single byte ("0" or "1")
CONFIGURATION_GET CONFIGURATION_SET
Power Level
- COMMAND_CLASS_POWERLEVEL
POWERLEVEL_TEST_NODE_SET POWERLEVEL_TEST_NODE_GET POWERLEVEL_TEST_NODE_REPORT
Example: POWERLEVEL_SET, 5, 60 set the ZWave node's power level to 5 for the length of 60 seconds
Device configuration data
Traces
Starting the ZWave device:
40 03/28/08 15:53:34.590 0x1 0x3 0x0 0x15 0xe9 (#####) <0xb698bb90> 41 03/28/08 15:53:34.741 0x6 0x1 0x10 0x1 0x15 0x5a 0x2d 0x57 0x61 0x76 0x65 0x20 0x32 0x2e 0x33 0x31 0x0 0x1 0x96 (#####Z-Wave 2.31###) <0xb718cb90> 40 03/28/08 15:53:34.792 0x1 0x3 0x0 0x20 0xdc (### #) <0xb698bb90> 41 03/28/08 15:53:35.042 0x6 0x1 0x8 0x1 0x20 0x0 0x0 0x55 0x28 0x2 0xa9 (#### ##U(##) <0xb718cb90> 40 03/28/08 15:53:35.092 0x1 0x3 0x0 0x2 0xfe (#####) <0xb698bb90> 41 03/28/08 15:53:35.342 0x6 0x1 0x25 0x1 0x2 0x4 0x4 0x1d 0x3 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x2 0x1 0xc4 (##%#) <0xb718cb90> 40 03/28/08 15:53:35.393 0x1 0x4 0x0 0x52 0x1 0xa8 (###R##) <0xb698bb90> 41 03/28/08 15:53:35.643 0x6 0x1 0x4 0x1 0x52 0x1 0xa9 (####R##) <0xb718cb90> 40 03/28/08 15:53:35.694 0x1 0x3 0x0 0x56 0xaa (###V#) <0xb698bb90> 41 03/28/08 15:53:35.944 0x6 0x1 0x4 0x1 0x56 0x0 0xac (####V##) <0xb718cb90> 40 03/28/08 15:53:35.995 0x1 0x4 0x0 0x41 0x1 0xbb (###A##) <0xb698bb90> 41 03/28/08 15:53:36.245 0x6 0x1 0x9 0x1 0x41 0xc9 0x0 0x0 0x3 0x11 0x0 0x6d (####A######m) <0xb718cb90> 40 03/28/08 15:53:36.296 0x1 0x4 0x0 0x41 0x2 0xb8 (###A##) <0xb698bb90> 41 03/28/08 15:53:36.545 0x6 0x1 0x9 0x1 0x41 0xd2 0x6 0x0 0x2 0x2 0x0 0x62 (####A######b) <0xb718cb90>
Interesting string:
0x1 0x2 0x4 0x4 0x1d 0x3 0x0 0x0 0x0 ... 0x1 means it is a response 0x2 means it is initialization data 0x4 is the version 0x4 is the capabilities
LMCE will look for the next 4 bytes to get the list of devices. It seems to be a bit map. In this case, the first byte is 0x3 or in binary 00000011 so devices ID 1 and 2 are present. It is unclear to me why we only look at 4 bytes (32 zwave devices) while the protocol supports 252
Switching on a ZDP200 lamp plug from the Orbiter:
40 03/28/08 15:49:20.707 0x1 0xa 0x0 0x13 0x1 0x3 0x26 0x1 0x63 0x5 0x6 0xa3 (#\n####&#c###) <0xb68f3b90> 41 03/28/08 15:49:21.007 0x6 0x1 0x4 0x1 0x13 0x1 0xe8 (#######) <0xb70f4b90> 41 03/28/08 15:49:21.307 0x1 0x5 0x0 0x13 0x6 0x0 0xef (#######) <0xb70f4b90>
Pressing "all units on" on the ZTH200:
41 03/28/08 15:50:58.553 0x1 0x8 0x0 0x4 0x4 0xef 0x2 0x27 0x4 0x39 (#######'#9) <0xb70f4b90> 41 03/28/08 15:50:58.854 0x1 0x8 0x0 0x4 0x0 0xef 0x2 0x27 0x4 0x3d (#######'#=) <0xb70f4b90>
Pressing "all units off" on the ZTH200:
41 03/28/08 15:51:43.713 0x1 0x8 0x0 0x4 0x4 0xef 0x2 0x27 0x5 0x38 (#######'#8) <0xb70f4b90> 41 03/28/08 15:51:44.014 0x1 0x8 0x0 0x4 0x0 0xef 0x2 0x27 0x5 0x3c (#######'#<) <0xb70f4b90>
Pressing the local switch on the ZDP200 (toggling from off to on):
41 03/28/08 15:52:37.284 0x1 0xc 0x0 0x49 0x84 0x1 0x6 0x3 0x11 0x0 0x26 0x27 0x75 0x5f (###I######&'u_) <0xb70f4b90>
Learn Mode
Start
We send:
40 04/11/08 18:25:26.852 0x1 0x4 0x0 0x50 0x1 0xaa (###P##) <0xb68d9b90>
response:
41 04/11/08 18:25:27.052 0x6 (#) <0xb70dab90> 41 04/11/08 18:25:29.763 0x1 0x7 0x0 0x50 0x2 0x1 0xef 0x0 0x44 (###P####D) <0xb70dab90> 35 04/11/08 18:25:29.763 ZWJobSetLearnMode: len = 6 buf = 0x00 0x50 0x02 0x01 0xef 0x00 <0xb68d9b90> 36 04/11/08 18:25:29.763 ZWJobSetLearnMode: start learning <0xb68d9b90>
References
http://www.basshome.com/leviton_z-wave_documentation_1970_ctg.htm
http://zwaveworld.com/forum/index.php?showtopic=237
http://www.eilhk.com/en/product/Datasheet/Zensys/SDS10243-2%20-%20Z-Wave%20Protocol%20Overview.pdf
or
http://www.smarthus.info/support/download/zwave/Z-Wave%20Protocol%20Overview.pdf
or
http://www.smarthus.info/support/download/zwave/Z-Wave%20Node%20Type%20Overview%20and%20Network.pdf
http://www.smarthus.info/support/download/zwave/Z-Wave%20Configuration%20Information.pdf
http://www.ddj.com/embedded/193104353
Tools used
http://sourceforge.net/projects/slsnif/
Links
http://www.intouchcontrolsforum.com/forums/showthread.php?t=41&page=2
http://www.elec-solutions.com/docs/motor_controls/dbmz/DBMZ_v1+1_Advanced_User_Manual.pdf
http://zwaveworld.com/forum/index.php?showtopic=227&st=20