Open Source Smart Home (Zigbee)

Summary: ZigBee is a technological standard for home networking and personal area networks (PAN) based on IEEE 802.15.4 created by the ZigBee Alliance. It is designed for low power consumption and low data rate wireless communication, making it suitable for controlling and sensing networks. ZigBee manages the upper layers of the network stack, while IEEE 802.15.4 covers the PHY and MAC layers. The standard supports various network topologies, including star, mesh, and tree, and can theoretically support up to 65,000 devices, though practical implementations usually handle around 240 devices.

How ZigBee works:

ZigBee is a standard for home networking and personal area networks (PAN) with low data rates and low power consumption, created by the ZigBee Alliance and based on IEEE 802.15.4. It’s a low power wireless communication system that’s designed for controlling and sensing networks, providing a secure and reliable wireless system. It operates on the IEEE 802.15.4 protocol and covers the PHY and MAC layers while ZigBee handles the upper layers. IEEE802.15.4 developed the PHY and MAC layer whereas, the ZigBee takes care of upper higher layers.

Frequency Bands:

868 MHz (Europe)

915 MHz (US and Australia)

2.4 GHz (Worldwide)

There are three different topologies that you can implement.

Star: Devices communicate directly with the coordination

Hardware needed -

  1. One Coordinator

  2. Up to 65,000 end devices

Mesh: All devices (coordinator, routers, and end devices) can communicate directly with each other. The network forms a mesh of connections, allowing multiple pathways for data transmission. This topology is good for large deployments.

Hardware needed -

  1. One Coordinator

  2. Multiple Routers needed.

  3. Up to 65,000 end devices

Tree: The network forms a hierarchical structure with one coordinator at the root, routers branching out from the coordinator, and end devices connected to routers. Each node (except the end devices) acts as a parent to other nodes. This is the topology I would use in a small to medium home.

Hardware needed -

  1. One Coordinator

  2. Multiple Routers needed.

  3. Up to 65,000 end devices

While there are a lot of options of smart home configuration, there are two Open source options: ZigBee and z-wave. Of these two I am going to be diving into how to configure your home to be ZigBee compatible.

What you need:


1. ZigBee coordinator: Preferability buy a raspberry Pi (This one is ready out of the box) to configure or use a usb ZigBee module

  • Some routers come with ZigBee hubs built into them but research shows that they are to be avoided.

  • “Sonoff has two models, the linked “ZBDongle-P” based on the TI CC2652P chip and the “ZBDongle-E” that uses the same SILabs EFR32MG21 as the SkyConnect. … Based on my testing though, limited and anecdotal as it may be, I would still buy the “P” over the “E” for ZigBee.”

  1. Use ZigBee compatible smart plugs as range extenders. These enable smart capabilities for appliances

  2. Use Lightbulbs that are compatible with ZigBee. Do your homework on what to purchase, there are many options at varying price points. Avoid Philips Hue, expensive and known to have connectivity issues.

There are a ton of devices that are compatible with this system from temperature sensors and thermostats to remote sensors to alert you if the toilet paper is out in the restroom.

Server setup

Equipment needed:

  • Computer/server running debian 12

  • ZigBee Coordinator

  • End Device to test

List of accepted Coordinators:

  • Silicon Labs EmberZNet based radios using the EZSP protocol (via the bellows library for zigpy)

 

Home Assistant Connect ZBT-1 (EFR32MG21-based USB dongle)

Home Assistant Yellow with integrated EFR32MG21 radio

ITead SONOFF ZigBee 3.0 USB Dongle Plus Model “ZBDongle-E” (EFR32MG21 variant)

Elelabs ZigBee USB Adapter/POPP ZB-Stick (Note! Not a must but recommend upgrade the EmberZNet NCP application firmware)

Elelabs ZigBee Raspberry Pi Shield (Note! Not a must but recommend upgrade the EmberZNet NCP application firmware)

SMLIGHT SLZB-07 (EFR32MG21-based USB dongle)

  • Texas Instruments based radios (via the zigpy-znp library for zigpy)

CC2652P/CC2652R/CC2652RB USB stick, module, or dev board hardware flashed with Z-Stack coordinator firmware

CC1352P/CC1352R USB stick, module, or dev board hardware flashed with Z-Stack coordinator firmware

XZG - Universal Firmware for ZigBee Gateway

  • dresden elektronik deCONZ based ZigBee radios (via the zigpy-deconz library for zigpy)

ConBee III (a.k.a. ConBee 3) USB adapter from dresden elektronik

ConBee II (a.k.a. ConBee 2) USB adapter from dresden elektronik

RaspBee II (a.k.a. RaspBee 2) Raspberry Pi Shield from dresden elektronik

 

Configuration - GUI

  1. Connect your radio module and restart Home Assistant.

  2. From the Home Assistant front page go to Configuration and then select Integrations from the list.

  3. Use the plus button in the bottom right to add a new integration called ZHA.

In the popup:

  1. Serial Device Path - List of detected serial ports on the system. You need to pick one to which your radio is connected

  2. Press Submit and the integration will try to detect radio type automatically. If unsuccessful, you will get a new pop-up asking for a radio type. In the pop-up:

Radio Type

ZigBee Radio Hardware

Radio Type

ZigBee Radio Hardware

ezsp

Silicon Labs EmberZNet protocol (e.g., Home Assistant SkyConnect, Elelabs, HUSBZB-1, Telegesis)

deconz

dresden elektronik deCONZ protocol (e.g., ConBee I/II, RaspBee I/II)

znp

Texas Instruments (e.g., CC253x, CC26x2, CC13x2)

zigate

ZiGate Serial protocol (e.g., ZiGate USB-TTL, PiZiGate, ZiGate WiFi)

xbee

Digi XBee ZB Coordinator Firmware protocol (e.g., Digi XBee Series 2, 2C, 3)

 

  1. Press Submit to save radio type and you will get a new form asking for port settings specific for this radio type. In the pop-up:

Serial device path

port speed (not applicable for all radios)

data flow control (not applicable for all radios)

Most devices need at the very least the serial device path, like /dev/ttyUSB0, but it is recommended to use device path from /dev/serial/by-id folder, e.g., /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_C0F003D3-if01-port0

A list of available device paths can be found in Settings > System > Hardware > dot menu > All Hardware.

7.Press Submit. The success dialog will appear or an error will be displayed in the popup. An error is likely if Home Assistant can’t access the USB device or your device is not up to date. Refer to Troubleshooting below for more information.

  1. Disable OTA updates for a specific manufacturer, add the following lines to your configuration.yaml and restart Home Assistant

“zha:
zigpy_config:
ota:
ikea_provider: false # Disable OTA update downloads for Trådfri devices
inovelli_provider: false # Disable OTA update downloads for INOVELLI devices
ledvance_provider: false # Disable OTA update downloads for LEDVANCE/OSRAM devices
salus_provider: false # Disable OTA update downloads for SALUS/Computime devices
sonoff_provider: false # Disable OTA update downloads for Sonoff (ITead) devices
thirdreality_provider: false # Disable OTA update downloads for 3REALITY devices”

  1. To add a new ZigBee device:

    1. Go to Settings > Devices & Services.

    2. Select the ZigBee Home Automation integration. Then, select Configure.

    3. To start a scan for new devices, on the bottom right corner of the screen, select Add device.

    4. Reset your ZigBee devices to factory default settings according to the device instructions provided by the manufacturer (e.g., turn on/off lights up to 10 times; switches usually have a reset button/pin). It might take a few seconds for the devices to appear. You can click on Show logs for more verbose output.

    5. Once the device is found, it will appear on that page and will be automatically added to your devices. You can optionally change its name and add it to an area (you can change this later). You can search again to add another device, or you can go back to the list of added devices.

  2. Grouping devices together allows you to control the devices with only one command/entity

    1. First press the “configure” button on the ZHA integration config page

    2. At the top, choose “Groups” and select “Create Group”.

    3. Set Group name and choose what devices to include.

  3. Binding is a on-device feature that attaches an endpoint of one ZigBee devices to another device or group.

    1. Binding a ZigBee light switch to a “living room lights” group

Good Info on ZigBee set up/ Troubleshooting: https://www.home-assistant.io/integrations/zha/#troubleshooting

ZigBee Security protocol:

ZigBee Overview: https://www.geeksforgeeks.org/introduction-of-zigbee/