ZigBee and Z-Wave: Smart Home Automation for Android

A lot of technology-savvy people are very much looking forward to the day when the connected home with its smart devices will be a reality for all of us. Regulating temperature, humidity, and level of noise; being able to remotely turn on and off music and activate security systems – all this used to sound like a fairy tale, but not anymore.

Modern-day smart gadgets, however, often work primarily within their unique ecosystems: for example, Amazon Echo supports its own range of devices, and not all of them are compatible with other smart hubs.

Smart devices include anything from smart air conditioners to smart cookers, and are often developed by startups or hardware companies like TP -Link.

The general trend of devices communicating among themselves on command or automatically is known as the device mesh. The device mesh means that various appliances and gadgets form an ecosystem of their own and are in constant connection with each other. According to Gartner's prediction for 2017, the current rise of mobile technologies and various mobile platforms will bring the device mesh closer to the everyday lives of average people.

But for the device mesh to actually become our future, creators of new gadgets have to overcome the biggest obstacle to the success of these smart devices: they all have to be able to communicate with other devices that might come from different ecosystems.

We mentioned earlier that one of the core obstacles for any platform is the so-called chicken-and-egg problem: in order to become successful, a platform needs to attract users to its ecosystem. This is why tech giants like Google that develop smart ecosystems like Google Home want to enable as many devices to connect with their networks as possible. The more third-party solutions are available for their hub, the more value their whole ecosystem offers.

One way to help smart home ecosystems grow is to provide smart device manufacturers with access to open smart home APIs.

This is what Amazon did with the Alexa Smart Home Skill API, which allows third-party smart appliances by various manufacturers to communicate with Alexa. This API opens the door for Alexa to control various devices including lights, door locks, thermostats, and motion sensors.

Often, what we need is to enable various wireless networking protocols to power smart devices. These include old-school wireless protocols like Bluetooth, which is still commonly used in fitness trackers and almost all mobile devices on the market, and much newer solutions that, unfortunately, can sometimes be expensive and not support older devices.

Two of the most common wireless protocols that are in use for smart devices and home automation are ZigBee and Z-Wave.

smart-home-automation-for-android-1

ZigBee is named after the chaotic movements of bees harvesting pollen and nectar; the name symbolizes constant communication among various nodes of a mesh system.

ZigBee and Z-Wave have a lot of similar features, but each of these protocols offers a unique set of advantages for customers.

Each ZigBee or Z-Wave system includes three types of devices: a coordinator, a router, and so-called end devices. The coordinator device acts as the root and bridge of the network: it’s responsible for handling and storing information while receiving and transmitting data operations. Routers act as intermediary devices that allow data to go through them and on to other devices. Different types of networks (star, tree, or mesh) require different numbers of devices.

How do ZigBee and Z-Wave compare?

ZigBee and Z-Wave work similarly, allowing users to remotely control smart devices using their smartphones. Imagine that you’re at your work and you forgot to turn off a lamp in your living room, and you want to turn it off remotely. You tap a “turn off light” button on your smartphone, and the command is transferred through the internet to your smart home hub. Once the command is received by the hub, the hub will send that data from one device to the next until it reaches the lamp and the light goes off.

What characteristics of home automation protocols are important?

There are two important aspects of wireless connection protocols for smart devices: compatibility and security.

Security

ZigBee uses AES-128 encryption. This encryption was developed by the National Institute of Standards and Technology (NIST) and is commonly used by major banks. Each network of devices has its own network key, and messages between devices are authenticated using different keys. ZigBee-powered devices can be used to alert homeowners about intruders or smoke or carbon monoxide leaks, for instance.

Each Z-Wave network is assigned a unique ID, as is each device within each network. These IDs are used to communicate with the hub, making it so that another hub can never control your house’s hub and connected devices. Devices like door locks and alarms require a lot of security features, so Z-Wave also uses AES-128 encryption (just as ZigBee does).

With both of these protocols, the biggest potential threat comes from the openness of the system. Devices produced by third-party manufacturers might not meet security standards equally.

Compatibility

The ZigBee Alliance currently includes around 400 member organizations that use, develop, and improve ZigBee’s open standard for wireless connection.

The Z-Wave Alliance consists of 375 companies and 1,500 products.

Both ZigBee and Z-Wave allow customers to easily mix and match home automation devices manufactured by different companies.

Smart Home Automation Using Zigbee and Android devices: How do we do it?

A microcontroller is responsible for all functions of the smart devices in your smart home.

For example, when it’s getting darker outside, a light sensor might send a signal to the microcontrollers and the microcontroller might turn on the lights. The status of all smart devices is displayed on your Android device using protocols such as ZigBee or RS 232.

To create a fully-functional smart home environment, you need to combine sensors and controllers with a GUI that displays all necessary data.

We wanted to see how smart home solutions powered by the ZigBee protocol can be implemented using an Android smartphone app.

How smart home sensors communicate with each other:

  1. A user changes settings on a smart device

  2. A signal is transmitted to the closest router

  3. The signal is transmitted from the router to the server

  4. The server sends the signal to the microcontroller

  5. The microcontroller processes all data and sends the signal back to the sensors

ZigBee includes a full range of protocols that allow you to create a fully functioning network of sensors and smart home devices. Mobile apps allow users to tap into various opportunities that the ZigBee technology provides.

smart-home-automation-for-android-2

To implement Android app interactions with smart home devices, you will need to use Bluetooth sensors or a Wi-Fi network to send data to gadgets.

Using Wi-Fi might seem like the most straightforward option, but it’s not the most energy efficient. This is why it’s better to implement a ZigBee network adaptor on the server side, using standard IPC Unix mechanisms such as Pipes. This way your Android device will send REST requests to the server, and the server will interact with your smart home appliances using ZigBee protocols. This is more energy efficient, but it takes more work to implement. To make this setup work, you need to make sure that the microprocessor in the smart home hub you’re using includes adapters that transform the Wi-Fi signal into ZigBee-format of signal – only some processors are manufactured the way that allows them to do this.

ZigBee and Z-Wave are the protocols that you should keep in mind if you want to create a smooth Android app that can interact with smart home appliances and sensors from various smart home ecosystems.

4.8/ 5.0
Article rating
46
Reviews
Remember those Facebook reactions? Well, we aren't Facebook but we love reactions too. They can give us valuable insights on how to improve what we're doing. Would you tell us how you feel about this article?