Zigbee

From Domoticz
Revision as of 09:34, 22 December 2023 by Walter vl (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Zigbee is intended for embedded applications and as a suite of wireless protocol standards also has a few protocol that is specifically meant for home automation, smart lighting and smart houses.


Introduction

Zigbee creates its own isolated wireless network-mesh which boosts in range the more mains-powered devices you that you add your network mesh, with all mains-powered devices acting as repeater. Zigbee supports encyption, so it is harder to listen in on your devices.

Zigbee protocol standards are managed by the Zigbee Alliance and they have relativly low royalty fees and allow anyone to manufacturer chips for Zigbee and Zigbee protocol stacks. Official certification of manufacturers devices by the Zigbee Alliance cost more and though it is not requires it is still recommended, which makes it possible for devices to be non cerfified devices to be cheap and certified devices to be relativly inexpensive.

The downside of the Zigbee protocol being loosley controlled by Zigbee Alliance, not even requireing certifications or quality control means that there can be interoperability issues between differet manufacturers, so compatibility between devices and gateways/bridges/controllers can not be garanteed. Because of this is recommended to preferably buy devices that are "Zigbee 3.0" cerfified by the Zigbee Alliance as that should mean that they have been independently tested to at least meet their minimum requirements of follwing the official Zigbee standards.

Zigbee for home automation overview

Zigbee is a suite wireless standards made up of high-level communication protocols which create personal area networks with small digital radios which have low power consumption and uses very low data rates

Zigbee networks can be seen a a little more complexed than most other popular wireless standards used home automation (such as WiFi, Bluetooth, Z-Wave or 315MHz/433MHz) as the end-users should preferably at least grasp the different use and purpose of the three main components that are a Zigbee Coordinator, Zigbee Routers and Zigbee End Devices, as well as understand the core concept in its use of a "mesh network", with its need to use Zigbee Routers as repeaters to relay and extend the range. Without basic knowledge about how to optimize the use of these three components you risk ending up with an unstable Zigbee network with poor range to Zigbee End Devices due to too few Zigbee Routers or intermitant working devices due to people powering off Zigbee Routers which should always be left on.

The technology defined by the Zigbee specification is technically intended to be simpler and less expensive than other wireless personal area networks (WPANs), such as Bluetooth or Wi-Fi. Applications include wireless light switches, electrical meters with in-home-displays, traffic management systems, and other consumer and industrial equipment that requires short-range low-rate wireless data transfer.

Its low power consumption limits transmission distances to 10–100 meters line-of-sight, depending on power output and environmental characteristics. Zigbee devices can transmit data over long distances by passing data through a mesh network of intermediate devices to reach more distant ones. Zigbee is typically used in low data rate applications that require long battery life and secure networking (Zigbee networks are secured by 128 bit symmetric encryption keys.) Zigbee has a defined rate of 250 kbit/s, best suited for intermittent data transmissions from a sensor or input device.

Zigbee Modules and Network

Zigbee Mesh

Zigbee is a standard for low-power, short range wireless devices based on an IEEE 802.15.4-based specification which creates personal area networks (PAN). Zigbee modules work in unlicensed ISM(Industrial Scientific Medical) band. Zigbee devices are capable of peer-to-peer, point-to-multipoint and mesh communication. They offer convenient low power wireless solutions for embedded systems where power consumption is a critical factor. A Zigbee network consist of three different types of Zigbee devices: coordinator, router, end-device. Each network has a 16bit PAN ID. All devices in a Zigbee network is assigned a single PAN ID.

Zigbee Device Types

  • Zigbee Coordinator (ZC) : Zigbee Coordinator control/manage and coordinate the whole a Zigbee network, (and all Zigbee bridges/gateways/hubs/controllers therefore contain a Zigbee Coordinator). It is the most capable device in a Zigbee network, as the coordinator forms the root of the network tree and might bridge to other networks. There must be one Zigbee coordinator in each network since it is the device that starts the network originally. There also can not be more than one Zigbee coordinator per Zigbee network. The coordinator initiates a Personal Area Network(PAN) by selecting a RF channel and PAN ID. Zigbee Coordinator also control permissions and security to allow routers and end-devices to join the PAN. It is able to store information about the network, including acting as the Trust Center & repository for security keys.
  • Zigbee Router (ZR) : Zigbee routers are always-on devices that are normally mains-powered (meaning not battery-powered). As well as running an application function, a router can act as an intermediate relay device, repeating and passing on data from other devices. A router can start operation only when it has establishes connection with the ZC (Zigbee Coordinator). Zigbee Routers should always be left on and otherwise you risk loss of service to any Zigbee devices connect to that router until the Zigbee mesh network manage to repair itself, it is therefor a bad idea to plugin a Zigbee lightbulb like Philips Hue or IKEA Trådfri lights when you still have its power going through a wall-switch or cord-switch as it is inevitable will flick the switch off the light using those switches.
  • Zigbee End Device (ZED) : Sometimes also written togther as "Zigbee enddevice" or "Zigbee enddevices": Zigbee end devices are usually battery-powered devices like wireless sensors or remotes which 'sleep' for periods of times to save the power of their batteries. These contains just enough functionality to talk to the parent node (either the Zigbee Coordinator or a Zigbee Router device). Zigbee end devices cannot repeat and relay data to or from other devices. This relationship allows the node to be asleep a significant amount of the time thereby giving long battery life. Under the hood, a Zigbee end device must always join PAN like a Zigbee Router before sending any senor data. Zigbee end devices requires the least amount of local CPU performance and RAM memory from the Zigbee chip that the contajn, and therefore can be less expensive to manufacture than a ZR or ZC (Zigbee Coordinator). Individual Zigbee end devices must have a battery life of at least two years to pass Zigbee 3.0 certification by the Zigbee Alliance.

Zigbee support in Domoticz

Various large brands and manufacturers are now making and/or selling Zigbee devices like light bulbs, switches and sensors. For example: IKEA Tradfri, Philips Hue, Xiaomi / Agara, Trust, Heiman, OSRAM, LEDVANCE, Lutron, Legrand Netatmo, SALUS/Computime, Sengled, Schneider Wiser, Tuya, etc..

Domoticz itself does not have native support for Zigbee USB-adapters (Zigbee Coordinator) but there are plugins for Domoticz that can connect to various Zigbee USB-adapters or Bridges/Gateways/Hubs/Controllers that in turn can connect to and control Zigbee devices.

There is also a special Zigbee section in the Domoticz Forum for more detailed information:


Zigbee Wifi Channel Coexistance

The choice of 2.4-GHz band channel for the network is pre-configured as either a fixed channel (in the range 11-26) or a set of channels from which the best channel will be selected by the Co-ordinator. In the latter case, the Co-ordinator performs an energy scan of the possible channels and chooses the quietest channel.

The channels 25 and 26 can be used in North America for operation clear of Wi-Fi interference. For deployment in an environment where resource planning and bandwidth allocation can be guaranteed (see Section 1.2.5 ‘Channel Allocation’), a channel centre-frequency offset of 7 MHz is recommended to ensure acceptable co-existence with Wi-Fi. The non-overlapping channels (1, 6 and 11 for North America, 1, 7 and 13 for Europe) can also be used to avoid Wi-Fi interference where non-overlapping Wi-Fi channels have been allocated.

Note that the general recommendation is to avoid changing Zigbee channel of your Zigbee network if possible, and instead only change Wi-Fi channels on your WiFi router and WiFi access points. This is the general recommendation not only because changing Wi-Fi channels is easier but also because not all Zigbee devices support pairing/joining or running on all Zigbee channels.

Zigbee channels vs Wifi channels


References