The ZHA (Zigbee Home Automation) integration allows you to connect many off-the-shelf Zigbee based devices directly to Home Assistant, using one of the many available Zigbee coordinators.
ZHA uses an open-source Python library implementing a hardware-independent Zigbee stack called zigpy. All coordinators compatible with zigpy can be used with ZHA.
There is currently support for the following device types within Home Assistant:
- Binary Sensor
- Climate (beta)
There is also support for grouping of lights, switches, and fans (i.e. support for commanding device groups as entities). At least two entities must be added to a group before the group entity is created.
The ZHA implementation in Home Assistant relies on a library called “ZHA Device Handlers” to resolve issues with Zigbee devices that do not fully conform with the Zigbee standards. The few devices that deviate from the Zigbee specifications set by the Zigbee Alliance may therefore require proper bug reports with debug logs from users to assistant the developers in writing custom ZHA Device Handlers for all of a device functions to work properly with the ZHA integration.
Such a custom “ZHA Device Handler” are Python scripts that internally is also referred to as a “quirk” because they fix “quirks” as in deviations from the standard specifications. ZHA Device Handles do this by transparently acting as a translator, translating and converting non-compliant device messages and instead present them to the application as coming from a virtual compliant device. These ZHA Device Handlers for Home Assistant can thus be used to parse custom messages to and from Zigbee devices. The ZHA Device Handlers that are made can then be reused by all users in future versions of Home Assistant.
The custom quirks implementations for zigpy implemented as ZHA Device Handlers for Home Assistant are a similar concept to that of Hub-connected Device Handlers for the SmartThings Classics platform as well as that of Zigbee-Herdsman Converters (formerly Zigbee-Shepherd Converters) as used by Zigbee2mqtt, meaning they are each virtual representations of a physical device that expose additional functionality that is not provided out-of-the-box by the existing integration between these platforms.
ZHA integration uses a hardware independent Zigbee stack implementation with modular design which means that it can support any one of the many Zigbee coordinator radio modules/adapters available from different manufacturers, as long as that module/adapter is compatible with zigpy.
- dresden elektronik deCONZ based Zigbee radios (via the zigpy-deconz library for zigpy)
- Silicon Labs EmberZNet based radios using the EZSP protocol (via the bellows library for zigpy)
- ITEAD Sonoff ZBBridge (Note! This first have to be flashed with Tasmota firmware and Silabs EmberZNet NCP EZSP UART Host firmware)
- Nortek GoControl QuickStick Combo Model HUSBZB-1 (Z-Wave & Zigbee Ember 3581 USB Adapter) (Note! Not a must but recommend upgrade the EmberZNet NCP application firmware)
- Elelabs Zigbee USB Adapter (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)
- Bitron Video/Smabit BV AV2010/10 USB-Stick with Silicon Labs Ember 3587
- Telegesis ETRX357USB (Note! This first have to be flashed with other EmberZNet firmware)
- Telegesis ETRX357USB-LRS (Note! This first have to be flashed with other EmberZNet firmware)
- Telegesis ETRX357USB-LRS+8M (Note! This first have to be flashed with other EmberZNet firmware)
- Texas Instruments based radios with Z-Stack 3.x.x (via the zigpy-znp library for zigpy)
- Digi XBee Zigbee based radios (via the zigpy-xbee library for zigpy)
- Digi XBee Series 3 (xbee3-24) modules
- Digi XBee Series 2C (S2C) modules
- Digi XBee Series 2 (S2) modules (Note! This first have to be flashed with Zigbee Coordinator API firmware)
- Texas Instruments based radios with Z-Stack Home 1.2.x (via the zigpy-cc library for zigpy)
- ZiGate based radios (via the zigpy-zigate library for zigpy and require firmware 3.1a or later)
From the Home Assistant front page go to Configuration and then select Integrations from the list.
Use the plus button in the bottom right to add a new integration called ZHA.
In the popup:
- Serial Device Path - List of detected serial ports on the system. You need to pick one to which your radio is connected
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
|Radio Type||Zigbee Radio Hardware|
||Silicon Labs EmberZNet protocol (e.g., Elelabs, HUSBZB-1, Telegesis)|
||dresden elektronik deCONZ protocol (e.g., ConBee I/II, RaspBee I/II)|
||Texas Instruments new (active): Z-Stack 3.x.x ZNP protocol (e.g., CC26x2, CC13x2)|
||Texas Instruments legacy & HA12: Z-Stack Home 1.2.x ZNP protocol (e.g., CC253x)|
||ZiGate Serial protocol (e.g., ZiGate USB-TTL, PiZiGate, ZiGate WiFi)|
||Digi XBee ZB Coordinator Firmware protocol (e.g., Digi XBee Series 2, 2C, 3)|
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
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.
If you are use ZiGate or Sonoff ZBBridge you have to use some special usb_path configuration:
- ZiGate USB TTL or DIN:
autoto auto discover the zigate
- PiZigate :
- Wifi Zigate :
- Sonoff ZBBridge :
To add new devices to the network, call the
permit service on the
zha domain. Do this by clicking the Service icon in Developer tools and typing
zha.permit in the Service dropdown box. Next, follow the device instructions for adding, scanning or factory reset.
This service opens network for joining new devices.
||yes||For how long to allow new devices to join, default 60s|
||yes||allow new devices to join via an existing device|
To join a new device using an install code (ZB3 devices) use the following data attributes (must use parameters only from the same group:
||install_code||The IEEE address of the joining ZB3 device. Use with
||install_code||Install Code of the joining device. Use with
||qr_code||QR code containing IEEE and Install Code of the joining ZB3 device|
qr_code supports QR Install Codes from:
This service remove an existing device from the network.
||no||IEEE address of the device to remove|
ZHA component does have the ability to automatically download and perform OTA (Over-The-Air) firmware updates of Zigbee devices if the OTA firmware provider source URL for updates is available. OTA firmware updating is set to disabled (
false) in the configuration by default.
Currently, OTA providers for firmware updates are only available for IKEA and LEDVANCE devices. OTA updates for device of other manufactures could possible also be supported by ZHA dependencies in the future, if these manufacturers publish their firmware publicly.
To enable OTA firmware updates for the ZHA integration you need to add the following configuration to your
configuration.yaml and restart Home Assistant:
zha: zigpy_config: ota: ikea_provider: true # Auto update Trådfri devices ledvance_provider: true # Auto update LEDVANCE devices #otau_directory: /path/to/your/ota/folder # Utilize .ota files to update everything else
You can choose if the IKEA or LEDVANCE provider should be set to enabled (
true) or disabled (
false) individually. After the OTA firmware upgrades are finished, you can set these to
false again if you do not want ZHA to automatically download and perform OTA firmware upgrades in the future.
Note that the
otau_directory setting is optional and can be used for any firmware files you have downloaded yourself.
zha: zigpy_config: network: channel: 15 # What channel the radio should try to use. channels: [15, 20, 25] # Channel mask
This is a good reference for channel selection Zigbee and Wifi Coexistance
To add a new device:
- Go to the Integrations page, find the Zigbee Home Automation integration that was added by the configuration steps above, and select Configure.
- Click on the plus button at the bottom right corner to start a scan for new devices.
- Reset your Zigbee devices 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.
- 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.
To help resolve any kinks or compatibility problems by reporting bugs as issues with debug logs. Please follow the instructions in this troubleshooting section.
There is no official compatibility list of supported devices for the simple reason that practically all devices Zigbee Home Automation that are fully compliant with the standards and specifications as set by the Zigbee Alliance the should technically be compatible with this ZHA integration. The fact however remains that some hardware manufacturers do not always fully comply with each set specification which can cause a few devices to only partially work or not work at all with ZHA, but developers can create workarounds for such issues via a solution for ‘ZHA exception and deviation handling’ that this implementation features, please see that section for more information.
Tip to new users is that while there is no official list of supported devices, some ZHA users take comfort that blakadder maintains an unofficial Zigbee Device Compatibility Repository which anyone can submit compatibility reports to, it can be found at zigbee.blakadder.com and currently contains independent compatibility lists and device pairing tips for several home automation gateway/bridge/hub software, including but not limited to open source Zigbee implementations such as; ZHA, Tasmota, Zigbee2MQTT, and ZiGate.
When reporting issues, please provide the following information in addition to information requested by issue template:
- Debug logs for the issue, see debug logging
- Model of Zigbee radio being used
- If issue is related to a specific Zigbee device, provide device Zigbee signature. Signature is available at Configuration -> Integrations -> Zigbee Home Automation (click Configure) -> Devices (pick your device) -> Zigbee Device Signature
To enable debug logging for ZHA component and radio libraries, add the following logger configuration to
logger: default: info logs: homeassistant.core: debug homeassistant.components.zha: debug bellows.zigbee.application: debug bellows.ezsp: debug zigpy: debug zigpy_cc: debug zigpy_deconz.zigbee.application: debug zigpy_deconz.api: debug zigpy_xbee.zigbee.application: debug zigpy_xbee.api: debug zigpy_zigate: debug zigpy_znp: debug zhaquirks: debug
Philips Hue bulbs that have previously been added to another bridge won’t show up during search. You have to restore your bulbs back to factory settings first. To achieve this, you basically have the following options.
Using a Philips Hue Dimmer Switch is probably the easiest way to factory-reset your bulbs. For this to work, the remote doesn’t have to be paired with your previous bridge.
- Turn on your Hue bulb you want to reset
- Hold the Dimmer Switch near your bulb (< 10 cm)
- Press and hold the (I)/(ON) and (O)/(OFF) buttons of the Dimmer Switch for about 10 seconds until your bulb starts to blink
- Your bulb should stop blinking and eventually turn on again. At the same time, a green light on the top left of your remote indicates that your bulb has been successfully reset to factory settings.
Follow the instructions on https://github.com/vanviegen/hue-thief/ (EZSP-based Zigbee USB stick required)
On Linux hosts ZHA can fail to start during HA startup or restarts because the Zigbee USB device is being claimed by the host’s modemmanager service. To fix this disable the modemmanger on the host system.
To remove modemmanager from a Debian/Ubuntu host run this command:
sudo apt-get purge modemmanager
If you are using Docker and can’t connect, you most likely need to forward your device from the host machine to the Docker instance. This can be achieved by adding the device mapping to the end of the startup string or ideally using Docker compose.
Install Docker-Compose for your platform (Linux -
sudo apt-get install docker-compose).
docker-compose.yml with the following data:
version: '2' services: homeassistant: # customisable name container_name: home-assistant # must be image for your platform, this is the rpi3 variant image: homeassistant/raspberrypi3-homeassistant volumes: - <DIRECTORY HOLDING HOME ASSISTANT CONFIG FILES>:/config - /etc/localtime:/etc/localtime:ro devices: # your usb device forwarding to the docker image - /dev/ttyUSB0:/dev/ttyUSB0 restart: always network_mode: host