Z-Wave in Z-Uno

Z-Wave is a wireless home automation protocol. Designed for DIY and IoT it is very simple to deploy in your home.

Working on sub-gigahertz frequencies it does not have interference with other wireless systems like WiFi, Bluetooth, LTE and others. In different regions Z-Wave frequencies differs and varies from 860 to 930 MHz. Z-Uno supports all Z-Wave frequencies. You can choose required frequency in Arduino IDE.

Z-Uno delivers out of the box Z-Wave funtionality. Your sketch will interact with other Z-Wave products in your network via radio protocol according to Z-Wave Plus standards. You don't need to know deep Z-Wave protocol — Z-Uno will hide all Z-Wave internals and provide you simple to use functions.

Channels

To allow multiple functions in one device Z-Wave introduces channels (sometimes called instances). Z-Uno follows this concept allowing you to create very complex devices. Each channel in Z-Uno will have it's own functionality. Each channel hosts only two Command Classes: Basic and one of Switch Binary/Switch Multilevel/Sensor Binary/Sensor Multilevel depending on the channel type. Use ZUNO_SETUP_CHANNELS macro to setup types of channels.

You can also partially control Z-Uno without using channels: first channel of each type is mapped to the corresponding Command Class outside channels.

Example: Z-Uno with channels #1 Switch Multilevel, #2 Switch Binary, #3 Switch Multilevel, #4 Sensor Binary, #5 Sensor Binary will allow to control without channels Switch Multilevel (from channel #1), Switch Binary (from channel #3) and Sennsor Binary (from channel #4).

If no channels are specified, Z-Uno will present Sensor Binary (and Basic mapped to it) to report Service Button state.

Basic interoperability

Z-Wave provides Basic interoperability between different devices from different manufacturers via Basic Command Class. This Command Class is mapped to the corresponding Switch Binary/Switch Multilevel/Sensor Binary/Sensor Multilevel depending on channel type. Basic outside of channel behaves like Basic on channel #1.

Associations

Z-Uno allows to report values from each channel (be it a sensors or switch channel) out of the box. This is know as Life Line.

But it is also important to be able to control other devices in Z-Wave network. For this Z-Wave protocol introduces association groups or shortly associations. Association group is just a list of other devices in the network to whom Z-Uno is supposed to send some commands. This list is managed using standard UI provided by all existing Z-Wave controllers. Each association group is defined to have one of the allowed types depending on commands we want to be sent out. This can be control of switches or control of dimmers or even scenes switching. You can manage association groups using ZUNO_SETUP_ASSOCIATIONS macro.

Z-Uno Associations supports simple and channel (managed by Association and MultiChannel Association Command Classes correspondingly). Each group (control groups and Life Line) can host up to 5 entries.

Power management

Z-Wave was design to allow very low power consumption profile. Hence, many sensors are battery powered and can work more than two years without battery replacement. But as a side effect, such devices have to sleep most of the time to save battery and wake up only for short period to send reports to controller upon environment changes (i.e. temperature has changed or button is pressed). In Z-Wave these devices are called sleeping. Usually all battery powered sensors are sleeping. Wakeup period can be configured via Wakeup Command Class from Z-Wave controller.

To solve this reachability problems of battery devices Z-Wave allows another type of power management mode called frequently listening or FLiRS. These devices wake up every second to check if there is something for them in the ether and goes immediately back into sleep. In this mode initial communication to such device will take a bit more than one second and during this second the ether will be jammed. But after this the device will react very fast. The battery in this mode will last for only about one year. Usual applications of frequently listening is a battery operated switch, alarm or door lock.

All mains powered devices such as dimmers, switches and other actors are always listening. This means they are always reachable instantly, they always listen for ether and can act as repeaters for other devices forming mesh network.

Z-Uno supports all three types of power management modes. You can define it using ZUNO_SETUP_SLEEPING_MODE macro in your sketch.

Configuration parameters

Beside defining Z-Uno behavior in the user sketch, there are also few configuration parameters. Some parameters can be defined only during sketch upload (via Arduino IDE menu), others can be changed wirelessly via Z-Wave Configuration. Get more details on supported parameters.

Include/exclude, wake up and sending NIF

To become part of Z-Wave network Z-Uno need to be included (added) to the network using Z-Wave controller. Read more about inclusion and exclusion processes. Inclusion and exclusion are confirmed on Z-Uno by three press on the Service button. This sequence will also tell Z-Uno to send Node Information Frame (NIF).

Once sleeping power mode is used, Z-Uno will remain in deep sleep most of the time. Single press on Service button will wake up Z-Uno.

Security

Z-Wave protocol allows secure commands transmission to bring more privacy to your IoT network. To enable Security in Z-Uno use Arduino IDE menu item. Once Security is turned on Z-Uno will follow the rules below:

  • All control commands to Z-Uno must be secure.
  • All commands sent by Z-Uno (based on Association groups) follow rules:
    • First time Z-Uno tries to speak securelly.
    • If success, Z-Uno will memorize that this device must always be spoken securelly.
    • If fails, Z-Uno will remember this and send unsecure commands to such a device.
    This allows to mix secure and unsecure devices in the same Association group.
  • Only descriptive Command Classes are accessible without of Security: Battery, Device Reset Locally, Firmware Update, Manufacturer Specific, Power Level, Version, Wakeup, Z-Wave Plus Info.

Command Classes

Z-Uno supports the following Command Classes:

  • Association
  • Association Group Information
  • Battery (for sleeping and FLiRS modes)
  • Basic
  • Configuration
  • Device Reset Locally
  • Firmware Update
  • Manufacturer Specific
  • MultiChannel
  • MultiChannel Association
  • Power Level
  • Security
  • Version
  • Wakeup (for sleeping mode)
  • Z-Wave Plus Info

Depending on channels types Z-Uno will also support some of these Command Classes:

  • Sensor Binary
  • Sensor Multilevel
  • Switch Binary
  • Switch Multilevel

Depending on Association Groups set up Z-Uno can control:

  • Basic
  • Door Lock
  • Switch Multilevel
  • Scene Activation

Device Classes

Z-Wave also defines so called Device Classes to allow better interoperability. Z-Uno will automatically set corresponding Device Class to each channel depending on channel type. Z-Uno Device Class will be same as Device Class of channel #1. If no channels are defined, Z-Uno will behave like Sensor Binary (see above).

Sensor BinarySensor MultilevelSwitch BinarySwitch Multilevel
Generic typeSensor NotificationSensor MultilevelSwitch BinarySwitch Multilevel
Specific typeNotification SensorRouting Sensor MultilevelPower Switch BinaryPower Switch Multilevel

Firmware upgrade

Z-Uno allows Over-The-Air bootloader and user sketch upgrade. So instead of connecting your Z-Uno via USB and upgrading bootloader or user sketch from Arduino IDE, you can also use Z-Wave Controller Firmware Upgrade feature. Firmware upgrade is confirmed by three times press of Service Button or via configuration parameter. Note that your sketch will be deleted during bootloader upgrade process — you will need to upload it again. See OTA process description for more info.

Device reset

Z-Uno can be excluded from network by following Exclusion process via Z-Wave controller or by resetting the device via Service button: hold Service button for 5 seconds and then press three times. Use this procedure only if your controller is missing or inoperable. Note that the sketch is not erased during exclusion or reset process.

Changing Z-Wave settings

Z-Uno sketch defines number of channels, their types, number of association groups and power mode. Arduino IDE also allows to turn on/off security. But Z-Wave do not allow to change these paramenters «on the fly». To remain compatible with Z-Wave Plus, Z-Uno will not adopt these changes until device is excluded or resetted.

Learn more about Z-Wave

Z-Wave Basics Z-Wave Basics written by Dr. Christian Paetz is the perfect book to continue your dive into Z-Wave world. The book is available at amazon.com or amazon.co.uk in English, in German or in Russian.