In this Tech Talks session, Senior Field Applications Engineer, Carlos Hernandez, describes Z-Wave command class structure and provides reference code examples. Click here to watch the entire session and register now for future Tech Talks. The following is an overview of Carlos’s presentation.
What is Z-Wave?
Z-Wave is a low-power, wireless mesh network communications protocol designed specifically for control, monitoring and status reading applications in residential and light commercial environments.
Z-Wave operates through regional Sub-GHz frequencies, ensuring product interoperability throughout the region. Every product in the Z-Wave ecosystem is interoperable and backward compatible all the way to the first generation.
Any device using Z-Wave must use command class structure, which is the “language of Z-Wave” and is classified in the Z-Wave specification.
Command Class Structure
Z-Wave commands are structured so that the most significant byte is always the “command class”, which is a group of commands that perform a specific function. The next byte is the command itself, such as “Set”, “Get” or “Report”. The next set of bytes can range in size from 0 to the maximum Z-Wave packet size, which is the payload of 64 minus the header. In the binary switch set command scenario, the third byte is the value itself – either 00 or FF, based on what you want the device to do, such as turn off or on a light.
7
6
5
4
3
2
1
0
Command Class = COMMAND_CLASS_SWITCH_BINARY
Command = SWITCH_BINARY_SET
Value
There are four command class types in the Z-Wave realm:
Application command class is a group of commands with a specific set of functions. All specific applications have a command class.
Management command class allows you to control devices in the network and manage the way devices behave.
Encapsulation command class includes commands that encapsulate other commands containing extra information.
Network command class allows you to perform network operations such as including and excluding nodes, and preprovisioning nodes into the network.
Most command classes have three types of commands.
Set command – the first type of command, allows a controller or gateway to set a specific state variable in another device.
Get command – requests spec info from the device. For example, requests the status of a light. The light will respond with an “On” or “Off”.
Report command – responds to a Get command type with the state of the variable that was requested. In the example of a light, “On” or “Off”.
Z-Wave end devices are structured in the following order:
Bottom layer — Z-Wave module or SoC (currently 700 series)
Z-Wave Protocol layer — precompiled in a set of libraries that you can add to your application to enable your protocol stack.
Building block modules (3) — prewritten, pre-certified C code modules that address 90% of development needs. This is the application framework, or Z-Wave “skeleton code”, that all applications are built on.
The Sample Application and Product Specific Code layer sits on top of the application framework. Applications in this layer are pre-written and have undergone the full Z-Wave certification process. This is the best place to start designing your application. By reusing this sample code in your own application, you can significantly reduce your development time.
Getting Started
The first step to building your application is to order our Z-Wave Wireless Starter Kit (WSTK), which contains everything you need to get your project going, including the following:
WSTK mainboard
Radio board
Buttons and LED expansion boards
Controller and network sniffer USB sticks
Our Simplicity Studio tools further speed development by providing software examples, demos, sample code and supporting documentation. Using our WSTK, you can develop any Z-Wave application.
Tech Talks Blog: Z-Wave Software Structure – Command Classes and Reference Code
In this Tech Talks session, Senior Field Applications Engineer, Carlos Hernandez, describes Z-Wave command class structure and provides reference code examples. Click here to watch the entire session and register now for future Tech Talks. The following is an overview of Carlos’s presentation.
What is Z-Wave?
Z-Wave is a low-power, wireless mesh network communications protocol designed specifically for control, monitoring and status reading applications in residential and light commercial environments.
Z-Wave operates through regional Sub-GHz frequencies, ensuring product interoperability throughout the region. Every product in the Z-Wave ecosystem is interoperable and backward compatible all the way to the first generation.
Any device using Z-Wave must use command class structure, which is the “language of Z-Wave” and is classified in the Z-Wave specification.
Command Class Structure
Z-Wave commands are structured so that the most significant byte is always the “command class”, which is a group of commands that perform a specific function. The next byte is the command itself, such as “Set”, “Get” or “Report”. The next set of bytes can range in size from 0 to the maximum Z-Wave packet size, which is the payload of 64 minus the header. In the binary switch set command scenario, the third byte is the value itself – either 00 or FF, based on what you want the device to do, such as turn off or on a light.
7
6
5
4
3
2
1
0
Command Class = COMMAND_CLASS_SWITCH_BINARY
Command = SWITCH_BINARY_SET
Value
There are four command class types in the Z-Wave realm:
Most command classes have three types of commands.
For a list of Z-Wave command classes, visit our Z-Wave specification page.
Structure of a Z-Wave End Device
Z-Wave end devices are structured in the following order:
The Sample Application and Product Specific Code layer sits on top of the application framework. Applications in this layer are pre-written and have undergone the full Z-Wave certification process. This is the best place to start designing your application. By reusing this sample code in your own application, you can significantly reduce your development time.
Getting Started
The first step to building your application is to order our Z-Wave Wireless Starter Kit (WSTK), which contains everything you need to get your project going, including the following:
Our Simplicity Studio tools further speed development by providing software examples, demos, sample code and supporting documentation. Using our WSTK, you can develop any Z-Wave application.
For more information on Z-Wave products and development tools, contact your Silicon Labs sales representative.