Im using home assistant supervised zigbee2mqtt cc2531, and i got this error, when start this addon:
[22:20:23] INFO: Preparing to start...
[22:20:23] INFO: Socat not enabled
[22:20:23] INFO: Starting Zigbee2MQTT...
Starting Zigbee2MQTT without watchdog.
[2025-04-07 22:20:24] info: z2m: Logging to console, file (filename: log.log)
[2025-04-07 22:20:24] info: z2m: Starting Zigbee2MQTT version 2.2.1 (commit #unknown)
[2025-04-07 22:20:24] info: z2m: Starting zigbee-herdsman (3.4.11)
[2025-04-07 22:20:24] info: zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00","baudRate":115200,"rtscts":false,"autoOpen":false}
[2025-04-07 22:20:24] info: zh:zstack:znp: Serialport opened
[2025-04-07 22:20:24] error: zh:zstack:znp: Error while parsing to ZpiObject 'RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 1. Received 5'
[2025-04-07 22:20:31] error: zh:zstack:znp: Error while parsing to ZpiObject 'RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 1. Received 5'
[2025-04-07 22:20:37] error: z2m: Error while starting zigbee-herdsman
[2025-04-07 22:20:37] error: z2m: Failed to start zigbee-herdsman
[2025-04-07 22:20:37] error: z2m: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start_crashes-runtime.html for possible solutions
[2025-04-07 22:20:37] error: z2m: Exiting...
[2025-04-07 22:20:37] error: z2m: Error: SRSP - SYS - version after 6000ms
at Object.start (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/utils/waitress.ts:67:23)
at /app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:252:45
at Queue.execute (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/utils/queue.ts:36:26)
at Znp.request (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:245:27)
at Znp.requestWithReply (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/adapter/z-stack/znp/znp.ts:224:34)
at AdapterBackup.getAdapterVersion (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/adapter-backup.ts:446:48)
at AdapterBackup.createBackup (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/adapter-backup.ts:65:48)
at ZStackAdapter.backup (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:908:49)
at Controller.backup (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/controller/controller.ts:386:47)
at Controller.start (/app/node_modules/.pnpm/zigbee-herdsman@3.4.11/node_modules/zigbee-herdsman/src/controller/controller.ts:188:13)
Assistant
Okay, let's break down this Zigbee2MQTT error log.
You're encountering a situation where Zigbee2MQTT fails to start because it cannot properly communicate with your CC2531 USB stick. The key errors point to a problem during the initial handshake and version check with the adapter's firmware.
Here's an analysis of the important log lines:
[2025-04-07 22:20:24] info: zh:zstack:znp: Opening SerialPort with {"path":"/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00",...}: Zigbee2MQTT correctly identifies the serial port for your CC2531 stick. This part seems okay.
[2025-04-07 22:20:24] error: zh:zstack:znp: Error while parsing to ZpiObject 'RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 1. Received 5': This is the first critical error. zigbee-herdsman (the library that talks to the stick) received data from the CC2531 that it couldn't understand or parse correctly. The format was unexpected, specifically regarding an "offset" value. This often indicates corrupted communication or, more likely, an issue with the firmware on the CC2531 stick.
[2025-04-07 22:20:37] error: z2m: Error: SRSP - SYS - version after 6000ms: This is the timeout error. Zigbee2MQTT sent a command to the stick (likely asking for its firmware version) but didn't receive the expected response within 6 seconds. This reinforces the idea that communication is failing or the stick's firmware isn't responding correctly.
[2025-04-07 22:20:37] error: z2m: Failed to start zigbee-herdsman: Because the communication failed, the core component (zigbee-herdsman) couldn't initialize.
Zigbee2MQTT version 2.2.1 / zigbee-herdsman (3.4.11): These versions seem extremely old (current Zigbee2MQTT is around 1.3x.x and herdsman around 0.3x.x as of early 2024/2025). Are you sure these versions are correct? If so, this could be a major source of incompatibility or bugs. If you're using the official Home Assistant Addon, it should be much newer.
Troubleshooting Steps:
Based on the errors, here’s what you should try, in approximate order of likelihood:
Re-flash CC2531 Firmware: This is the most common cause for these specific errors (RangeError and SRSP timeout). The firmware on your CC2531 might be corrupted, outdated, or incompatible with the version of zigbee-herdsman being used.
Action: Download the latest recommended firmware for the CC2531 from the official Zigbee2MQTT website or Koenkk's GitHub repository. Follow instructions carefully to flash it onto your CC2531 stick. Ensure you are flashing firmware, not router firmware.
User
Start docker with access to device
Assistant
Okay, let's look at how to start a Docker container and give it access to a host device, like the CC2531 USB stick you were using before.
The primary way to do this is using the --device flag when running docker run.
Steps:
Identify the Host Device Path: You first need to know the exact path of the device on your host system as the host sees it. Common ways to find this:
For Serial/USB devices (like your CC2531): Check /dev/. Look for patterns like:
ttyUSB* (e.g., /dev/ttyUSB0)
ttyACM* (e.g., /dev/ttyACM0)
More reliably, check /dev/serial/by-id/ or /dev/serial/by-path/. These paths are generally persistent even if you plug the device into a different USB port or other devices are added/removed.
Example from your previous log:/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00
For other USB devices: Use lsusb to find the Bus and Device number, then look in /dev/bus/usb/XXX/YYY (where XXX is the bus number, YYY is the device number).
For Video devices:/dev/video* (e.g., /dev/video0)
Check dmesg: After plugging in the device, run dmesg | tail to see kernel messages, which often show the assigned device name.
Use the --device Flag: Add this flag to your docker run command.
Basic Syntax:--device=<host_device_path>
Mapping to a different path inside the container (optional):--device=<host_device_path>:<container_device_path>
Specifying permissions (optional, default is usually rwm - read, write, mknod):--device=<host_device_path>:<container_device_path>:<permissions>
Examples:
Giving access to your CC2531 stick (using the specific ID):
bash
User
I want start docker home assistant supervised with access to my usb device
Assistant
Okay, let's clarify how device access works with Home Assistant Supervised.
Unlike running a standard Docker container where you might manually use docker run --device ..., Home Assistant Supervised manages the Home Assistant Core container and its Add-ons for you. You don't directly modify the docker run command for the main Home Assistant instance.
The key is to ensure the host operating system (usually Debian) correctly sees the USB device and that the Home Assistant Supervisor can detect and pass it through when needed.
Here's the process and what you need to check:
Connect the USB Device to the Host: Plug your USB device (like your CC2531 stick, a Z-Wave stick, etc.) into the computer running the Home Assistant Supervised installation.
Verify Host OS Detection:
Log in to the host machine's terminal (via SSH or directly).
Run lsusb to list connected USB devices. You should see your device listed.
Run dmesg | tail immediately after plugging in the device. This shows kernel messages and often reveals the device path assigned (e.g., /dev/ttyUSB0, /dev/ttyACM0).
Crucially, check /dev/serial/by-id/. Run ls -l /dev/serial/by-id/. This directory provides persistent symbolic links to your serial devices based on their hardware IDs. Using these paths is highly recommended because they don't change even if you plug the device into a different port or other devices are added/removed.
Example path (from your previous log):/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00
Check Host Permissions:
The Docker daemon and the Supervisor need permission to access the device file in /dev. Often, serial devices require membership in the dialout group.
While the Supervisor often handles this, you can check the permissions: ls -l /dev/serial/by-id/<your_device_id_link> or ls -l /dev/ttyUSB0 (or whichever /dev/tty* path it has).
If you encounter permission issues later, you might need to add the user running the Docker daemon (often root or your primary user if running rootless Docker, although Supervised typically runs as root) to the relevant group (), or create a rule on the to ensure correct permissions and group ownership upon device connection. However, try without this first.
coordinator
coordinator
Search: You can search for "flash CC2531 coordinator firmware zigbee2mqtt".
Check/Update Zigbee2MQTT Addon: The versions listed in your log (2.2.1 / 3.4.11) seem highly unusual and outdated for a typical Home Assistant addon setup.
Action: Go to your Home Assistant Supervisor -> Add-ons -> Zigbee2MQTT. Check if there's an update available. If you manually installed something or are using a very old version, consider backing up your configuration (/config/zigbee2mqtt/configuration.yaml and other files like database.db), uninstalling the addon, and reinstalling the latest official version from the addon store. Restore your configuration afterward.
Basic Hardware Checks:
Restart: Stop the Zigbee2MQTT addon, physically unplug the CC2531 stick, wait 10-15 seconds, plug it back in (preferably into a different USB port if available), wait for the system to recognize it (check Home Assistant's Supervisor -> System -> Hardware if needed), and then start the Zigbee2MQTT addon again.
Full Reboot: Restart the entire Home Assistant host machine.
USB Cable/Port: If you use a USB extension cable, try connecting the stick directly or use a different cable. Try a different USB port on your machine. Ensure the USB port provides sufficient power.
Verify Configuration:
Serial Port: Double-check the serial: section in your Zigbee2MQTT configuration (/config/zigbee2mqtt/configuration.yaml or via the addon's Configuration tab). Ensure the port: path exactly matches the one detected: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00. Using the /dev/serial/by-id/... path is generally recommended over /dev/ttyUSBx as it's more stable across reboots.
Conflicts: Ensure no other addon or service (like Home Assistant's built-in ZHA integration) is trying to access the same USB device.
Check Host System Logs: Look at the host operating system logs (e.g., by running dmesg in the host terminal shortly after plugging in the CC2531) to see if there are any USB-related errors reported by the OS itself.
Consider Hardware Failure/Upgrade: The CC2531 is an older adapter. If flashing new firmware doesn't resolve the issue, the stick itself might be failing. You might consider upgrading to a more modern and robust adapter like one based on the CC2652P chip (e.g., Sonoff Zigbee 3.0 USB Dongle Plus - model ZBDongle-P, not the E model which uses a different chip).
Start with re-flashing the firmware, as that aligns best with the specific errors you're seeing. Also, investigate the very old version numbers reported in your log.
docker run -it --rm \
--device=/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00 \
your_image_name \
bash
(Replace your_image_name with the image you want to run, and bash with the command you want to run inside the container. Inside the container, the device will appear at the same path).
Giving access to the first USB-Serial device as /dev/ttyUSB0:
bash
docker run -it --rm \
--device=/dev/ttyUSB0 \
your_image_name \
bash
Mapping a host device to a specific path inside the container:
bash
docker run -it --rm \
--device=/dev/ttyACM0:/dev/zigbee_controller \
your_image_name \
bash
(Inside this container, the host's /dev/ttyACM0 will be available as /dev/zigbee_controller).
Permissions:
The user running the docker command (or the Docker daemon) needs appropriate permissions on the host to access the device file. Often, this means adding your user to a specific group (like dialout for serial devices, plugdev, or video).
Example: sudo usermod -aG dialout $USER (You might need to log out and back in for the group change to take effect).
The --device flag handles granting the container access to the device file within its isolated environment.
Alternative: Privileged Mode (Use with Caution!)
You can use the --privileged flag. This gives the container access to all host devices (/dev) and lifts many security restrictions. It's much less secure than specifically mapping devices with --device.
bash
docker run -it --rm --privileged your_image_name bash
Use --privileged only if absolutely necessary and you understand the security implications, as it significantly reduces container isolation.
Docker Compose:
If you are using Docker Compose, you use the devices key under the service definition in your docker-compose.yml file:
yaml
version: '3.8'
services:
my_app:
image: your_image_name
# ... other configurations
devices:
- "/dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00:/dev/ttyACM0" # Host:Container format
# Or just the host path if it should be the same in the container:
# - "/dev/ttyUSB0"
# command: ["bash"] # Or your app's start command
Choose the method (--device recommended) and the correct host path for your specific device.</container_device_path></host_device_path></container_device_path></host_device_path></host_device_path>
sudo usermod -aG dialout <username>
udev
host
Supervisor Detection: The Home Assistant Supervisor automatically scans the host system for hardware.
You can often see detected hardware in Home Assistant under Settings -> System -> Hardware. Click the three-dot menu and select "All Hardware" to see a more detailed list, including serial ports. The Supervisor makes these available to Home Assistant Core and Add-ons.
Configure the Integration or Add-on:
Now, go into Home Assistant and configure the specific integration or add-on that needs to use the USB device.
Example (Zigbee2MQTT Add-on): Go to Settings -> Add-ons -> Zigbee2MQTT -> Configuration tab. Find the serial section in the configuration (usually data_path: /config/zigbee2mqtt). You'll need to edit the configuration.yaml file within that folder (or edit directly in the UI if using UI configuration). Set the port: to the persistent path you found:
yaml
serial:
port: /dev/serial/by-id/usb-Texas_Instruments_TI_CC2531_USB_CDC___0X00124B0001DC4E8D-if00
# adapter: zstack # adapter type might also be needed depending on config
Example (ZHA Integration): Go to Settings -> Devices & Services -> Add Integration -> Search for ZHA. When prompted for the serial device path, choose "Enter Manually" if needed, select the correct radio type (e.g., ZNP for CC2531), and paste the /dev/serial/by-id/... path.
Example (Z-Wave JS UI Add-on): Go to the Add-on's configuration or its own Web UI settings and find the Serial Port setting. Select or enter the correct /dev/serial/by-id/... path for your Z-Wave stick.
In summary:
For Home Assistant Supervised, you don't use docker run --device. You ensure the host OS sees the device correctly (check lsusb, dmesg, /dev/serial/by-id/), and then you configure the specific integration or add-on within Home Assistant to use that device path. The Supervisor handles passing the device through automatically based on its detection of the host hardware.</your_device_id_link>