Introduction
SONOFF Zigbee devices are a great choice for building a stable and responsive local smart home network. With Home Assistant as your automation hub, and a Zigbee coordinator such as the SONOFF Zigbee 3.0 USB Dongle Plus (ZBDongle-E or ZBDongle-P), you can control SONOFF Zigbee devices like the ZBM5 smart wall switch without relying on the cloud.
This guide will walk you through integrating SONOFF Zigbee devices with Home Assistant using two methods:
- ZHA (Zigbee Home Automation)
- Z2M (Zigbee2MQTT)
Both offer excellent local control, automation support, and compatibility with SONOFF Zigbee product lineup.
Preparation
Before you begin, ensure you have the following:
- Home Assistant installed and running
- A Zigbee Coordinator (e.g., SONOFF Zigbee 3.0 USB Dongle Plus-P/-E)
- SONOFF Zigbee Device: SONOFF ZBM5
Setup Guide
There are two ways to use the SONOFF Zigbee 3.0 USB Dongle Plus to add your Zigbee devices to Home Assistant: ZHA or Zigbee2MQTT.
Here I'll introduce
Follow here if you use ZBDongle-E: Add ZBDongle-E to HA
Follow here if you use ZBDongle-P: Add ZBDongle-P to HA
After adding SONOFF Zigbee 3.0 USB Dongle Plus to Home Assistant, then we can add Zigbee devices to HA for control.
via ZHA
Step 1: Install and Configure ZHA in Home Assistant
- Go to Home Assistant and navigate to Settings → Devices & Services.
- Click “Add Integration” and search for Zigbee Home Automation (ZHA).
- Once completed, you should see ZHA successfully configured in Home Assistant.
Step 2: Add SONOFF ZBM5 to Home Assistant
- In Home Assistant, navigate to Settings > Devices & Services > ZHA > devices.
- Put the SONOFF ZBM5 into pairing mode by pressing and holding the physical button for 5 seconds until the LED starts blinking.
- Click “Add Device” and wait for ZHA to discover the ZBM5.
- Once found, you can rename and assign the device to a room if needed.
via Z2M
Step 1: Install Add-ons
When connecting HA through the Zigbee2MQTT Add-on, you need to install the following two add-ons:
- Mosquitto broker (MQTT Broker)
- Zigbee2MQTT
Install Mosquitto broker
Go to Settings → Add-ons → Add-on store and install the Mosquitto broker add-on, then start it.
Install Zigbee2MQTT
- Add Repository
Go back to the Add-on store, click ”⋮“ → “Repositories“, fill in
https://github.com/zigbee2mqtt/hassio-zigbee2mqtt
and click Add → Close or click the Add repository button below, click Add → Close
Install Zigbee2MQTT
Return to the store list, find Zigbee2MQTT, and proceed with installation.
Step 2: Configure Zigbee2MQTT
Open the Zigbee2MQTT add-on → Configuration page.
You need to configure the device’s adapter type and serial port path under serial.
The following format:
adapter: Adapter Type
port: ZBDongle Serial Port Path
Example Configuration:
For ZBDongle-E (SONOFF Zigbee 3.0 USB Dongle Plus V2):
adapter: ember
port: /dev/ttyUSB0
For ZBDongle-P (SONOFF Zigbee 3.0 USB Dongle Plus):
adapter: zstack
port: /dev/ttyUSB0
⚠️ The serial port path may vary depending on the host system. On Linux, you can find the serial path by running:
ls -l /dev/serial/by-id
Example output:
coolkit@coolkit-All-Series:~$ ls -l /dev/serial/by-id
total 0
lrwxrwxrwx 1 root root 13 3月 31 18:09 usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_76536147c914ef11950378b8bf9df066-if00-port0 -> ../../ttyUSB0
The serial port path in this case is:
/dev/ttyUSB0
After completing the configuration, start the Zigbee2MQTT add-on. Wait for about two minutes, then you can click to enter the Web UI Console to add and manage Zigbee devices.
Troubleshooting
Device not found?
Ensure the ZBDongle is detected in /dev/ttyUSB*
Restart Home Assistant after inserting the dongle
Move dongle away from USB 3.0 ports or use a USB extender
Pairing timeout?
Ensure ZBM5 is in pairing mode (blinking LED)
Power cycle the switch and try again
Z2M not starting?
Double-check Zigbee adapter type and port in configuration.yaml
FAQ
Q: Can I use ZBM5 without internet?
Yes. Both ZHA and Z2M are local integrations, no cloud required after setup.
Q: Can I update the firmware of ZBM5 via Home Assistant?
Yes, you can update device firmware on Home Assistant.
Q: What's the difference between ZHA and Zigbee2MQTT?
ZHA is more user-friendly and built into HA. Z2M offers more control, logs, and device support. Both are compatible with SONOFF.
Q: Are the same features available on Home Assistant when integrating devices via ZHA and Z2M?
A: No, they are not exactly the same. While both ZHA and Z2M allow you to control and monitor Zigbee devices in Home Assistant, there are differences in device support, configuration flexibility, and feature exposure. The available features may vary depending on the specific device and integration method.
Q: Can I mix ZHA and Z2M in the same Home Assistant?
No. You can only use one Zigbee integration per dongle/instance unless you use separate coordinators and Zigbee channels.