HowToDomoticzZigbeeMQTT - albertmon/smarthome GitHub Wiki

UNDER CONSTRUCTION

How to use Zigbee in Domoticz

See also: www.zigbee2mqtt.io

To connect Zigbee devices to Domoticz we need:

  1. Hardware to communicate with the Zigbee devices
  2. Software to communicate with the Zigbee communication hardware
  3. Software to communicate between the Zigbee software and Domoticz software
  4. Software to configure Domoticz to handle Zigbee devices

For the hardware (USB dongle) we chose CC2531, but other hardware is now recommended (see supported adapters)
For the communication between the dongle and MQTT we use zigbee2mqtt
For the communication between the zigbee2mqtt and Domoticz we use MosQuiTTo
To enable Domoticz to understand Zigbee we use the Domoticz plugin domoticz-zigbee2mqtt-plugin
For the installation and configuration we use docker-compose. This makes all installation activities easy and keeps your system clean.

The tasks to perform are:

  1. Flash the dongle (when the hardware needs it)
  2. Install docker-compose
  3. Install and configure MQTT (or use existing MQTT)
  4. Install and configure Zigbee2MQTT
  5. Install Domoticz Zigbee2MQTT plugin
  6. Configure Domoticz

Links

How To Domoticz Zigbee2MQTT : https://www.domoticz.com/wiki/Zigbee2MQTT
Firmware for CC2531 (zip-file) : CC2531_DEFAULT_20201127.zip

Flash the dongle

CC2531 on Raspberry

Steps:

  1. Create a working directory (zigbee-mqtt)
  2. Get the firmware and unzip
  3. Get and build the software to flash
  4. Flash the firmware

Commands:

mkdir zigbee-mqtt
cd zigbee-mqtt
wget "https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20201127.zip"
unzip CC2531_DEFAULT_20201127.zip

git clone https://github.com/dashesy/cc-tool.git
cd cc-tool
./configure
make

sudo ./cc-tool -e -w ../CC2531ZNP-Prod.hex

Install docker-compose

The simplest way to install docker-compose (after installing docker) is by using pip (package installer for Python).
Make sure you have pip3 installed by running

pip3 --version

If this commands returns an error, you have to install pip3:

sudo apt update
sudo apt install python3-venv python3-pip

Install docker-compose:

sudo pip3 install docker-compose

Install and configure MQTT

Install and configure Zigbee2MQTT

A simple (my preferred) way of connecting Zigbee devices to Domoticz is using docker-compose
See InstallDocker

Install Domoticz Zigbee2MQTT plugin

Configure Domoticz