Z-Wave – Basics of wireless technology for the smart home

House Radio

© Lead Image © file404, 123RF.com

© Lead Image © file404, 123RF.com

Article from Issue 194/2017
Author(s):

Z-Wave connects components in the smart home and ensures that remote commands from the control station take effect on real household appliances. We look at how it works, its range, the security of the protocol, and some basics that every Z-Waver should know.

The door lock opens when the owner's mobile phone approaches the entrance. The light in the apartment switches on when the motion detector senses a being walking around and the light sensor determines that it is night. The garage door closes automatically when the car drives in, and a controller detects that the absent-minded driver once again forgot to press the close button on the garage gate before leaving through the back door, so the gate now closes itself.

These automatic actions are no longer a smart home fiction; they are available right now. However, before pressing the "Buy" button, house owners have to decide which method to use when sensors are picking up signals and report them to the controller, which then in turn initiates actions to control real physical household devices.

Simply Wireless

Not everyone is likely to build their own new home so they are able to route cables in the walls for all kinds of playful extravagances; wireless solutions work around these limitations for the common man. In the 1990s, hobbyists who had a knack for tinkering, mainly in the United States, began to switch lamps or even household appliances on and off with a technology called X10. Signals were transmitted either via power lines or wireless RF technology. But X10 did not offer reliable communication; it was often impossible to say with certainty whether a device had actually received a transmitted signal.

In the United States, where imperfection and unreliability are more easily accepted, the product fared quite well, but in Europe, it never caught quite on. Along with other wireless alternatives (e.g., ZigBee [1], EnOcean [2], and good old WiFi), the Z-Wave Protocol was launched in the 1990s [3] by a Danish company named Zensys. In 2008, chip maker Sigma Designs [4] acquired the rights to Z-Wave.

The industrial consortium Z-Wave Alliance, to which some 300 corporations with approximately 1,000 certified products belong today, guides the development and the certification of new products. Hobbyists can build small solutions for little money that they then can extend piece by piece to a professionally automated smart home with dozens of components.

Acknowledgement Needed

On a wireless Z-Wave network, the brains of the system are called controllers. They send commands to actuators, called slaves, which then initiate actions. As an example, a laptop with a USB stick like the one shown in Figure 1 acts as a controller and uses a wireless radio connection to control the mains switch in Figure 2, the slave, which turns electrical consumers such as a lamp or another computer on and off.

Figure 1: The Z-Wave DSA02203 USB stick controller by Aeon Labs lets a Linux system send wireless commands to Z-Wave slaves.
Figure 2: The Z-Wave slave, in the form of the Aeon Labs DSC06106 network switch, receives commands for switching the consumer on and off wirelessly.

To set up new gadgets on the network, you will usually find a button to press on the device, for example at the side on the mains switch in Figure 2. This causes the device to advertise its presence on the network and any listening controllers, such as the USB stick in Figure 1, whom the user also switches to a special integration mode. The controller then picks up the beacon from the new gadget and teaches it its new name on the network, making sure that it knows which wireless commands it needs to pick off the air and respond to going forward.

The process is similar for deregistering a device from the network; the user typically has to confirm on the unit itself, usually by pushing a button, that the device is now leaving the collective.

Once integrated, the controller and slave rely on a handshake protocol in which the slave confirms the receipt of commands sent by the controller. When the slave's ACK reaches the controller, as shown in the top part of Figure 3, the controller knows that the slave has received and validated the packet with the command. It says nothing about whether the slave was able to execute the command or whether the desired effect has occurred. A subsequent status request sent by the controller to the slave can obtain clarity on the matter.

Figure 3: Z-Wave's handshake protocol requires the slave to confirm the commands sent by the controller by returning an ACK.

Until recently it was only possible to learn the details of the protocol by purchasing an expensive SDK from Sigma Designs, but the company finally released the Z-Wave specification online in September 2016 [3]. The Z-Wave Consortium still insists on the certification of new equipment, so nobody can simply dump new Z-Wave devices on the market. To certify a new gadget, you need to register as a commercial development partner. However, the specification allows hobbyists to write their own control software, for example for the controller in Figure 1.

Fault Tolerance

In the case of an unreliable wireless connection, it can happen that, as shown in the middle part of Figure 3, the command from the controller does not even reach the slave, or that the slave receives the command and sends an ACK, but it does not make its way back to the controller (bottom of Figure 3). In both cases, the controller simply assumes that the command failed and repeats the procedure up to two times. If the third attempt also fails, the controller reports an error and assumes that the connection to the slave is down.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Z-Wave Home Assistant

    Z-Wave components, a RaZberry module, and the free Home Assistant software make the Raspberry Pi a powerful smart home control center.

  • Home Assistant with MQTT

    Automating your four walls does not necessarily require commercial solutions. With a little skill, you can develop your own projects on a low budget.

  • Programming Snapshot – Power Outages

    A power failure can cause the IQ of a smart home to plummet suddenly. An emergency power supply and a script on the SmartThings platform can prevent a total outage and inform the owner. The polyglot Perlmeister embarks on a foray into the territory of the Groovy scripting language in this issue.

  • ioBroker + Rasp Pi

    Control devices from different manufacturers of home automation devices from a single interface by combining free software and a Raspberry Pi.

  • Wave

    Part email, part instant messenger, part bulletin board, and part wiki, Google’s new communication platform promises to transform correspondence into conversation.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News