xAAL Gateway for Z2M
The main goal of this project is to provide a xAAL Gateway for Zigbee devices. After several tests with ZHA, we decided to switch to Zigbee2MQTT.
Features
- Bridges Zigbee devices managed by Zigbee2MQTT to the xAAL ecosystem
- Supports a wide range of Zigbee devices thanks to Z2M's extensive device compatibility
- Standalone application that can run in a container for easy deployment
- Seamless integration with xAAL without direct MQTT handling
Why Zigbee2MQTT?
The main reasons for choosing Zigbee2MQTT over ZHA are:
- Better device support: Z2M supports a lot of devices and provides a nice web interface to fine tune devices.
- Standalone application: Z2M is a standalone application, so we can run it in a container.
- Although Z2M is written in NodeJS (which we don't natively support), this gateway abstracts the complexity.
How it works
This gateway simply forwards Z2M events to xAAL bus and vice versa through MQTT. You can now use Z2M without messing with MQTT. Simply run this gateway, Z2M and a broker in a docker container. And you can use your Zigbee devices with xAAL.
Installation
The easiest (and most secure) way to use the gateway is to run it in a docker container. A docker-compose file is provided to run all services in the gitlab repository.
- Clone the docker repository:
git clone https://gitlab.imt-atlantique.fr/xaal/code/go/docker.git
- Navigate to the z2m directory and start the services:
cd docker/z2m docker-compose up -d
Configuration
The gateway can be configured using a z2m.ini
file in the xAAL configuration directory.
Available options include:
-
broker
: MQTT broker address (default: "mqtt") -
topic
: MQTT topic for Z2M (default: "zigbee2mqtt") -
port
: MQTT broker port (default: 1883) -
base_addr
: Base UUID address for xAAL devices (example: "12345678-1234-1234-1234-123456789012") -
log_level
: Logging level (DEBUG, INFO, WARN, ERROR)
Example configuration:
[DEFAULT]
broker = mqtt.local
topic = home/zigbee
port = 1883
base_addr = 12345678-1234-1234-1234-123456789012
log_level = INFO
FAQ
Why are you using this gateway instead of Z2M MQTT through HomeAssistant?
xAAL supports HomeAssistant out of the box. However, I don't want to rely on MQTT directly due to potential single points of failure and security concerns.
Why are you using Go instead of NodeJS or Python?
We don't have a native JS implementation of the xAAL stack right now. Go was chosen primarily to test and develop the Go implementation of the xAAL stack.
Contributing
Contributions are welcome! Please feel free to submit a Merge Request.