Error while Loading Z2M on HA Green with Sonoff Dongle-P

I’m new to HA, while I recently bought my HA Green along with Zigbee Dongle-P, and i added ZHA integration for more exposure. I’m trying to install Z2M on my HA Green, but I’m unable to load the Add-On due to the following error.
configuration is as follows
Socat
enabled: false
master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
options: “-d -d”
log: false

mqtt
server: mqtt://localhost:1883
user: [masked]
password: [masked]

serial
port: ttyUSB0
adapter: ember

error code:
error: zh:ember:uart:ash: Failed to init port with error Error: Error: No such file or directory, cannot open ttyUSB0
[2025-06-02 00:02:07] error: z2m: Error while starting zigbee-herdsman
[2025-06-02 00:02:07] error: z2m: Failed to start zigbee-herdsman
[2025-06-02 00:02:07] error: z2m: Check Zigbee2MQTT fails to start/crashes runtime | Zigbee2MQTT for possible solutions
[2025-06-02 00:02:07] error: z2m: Exiting…
[2025-06-02 00:02:07] error: z2m: Error: Failed to start EZSP layer with status=HOST_FATAL_ERROR.
at EmberAdapter.initEzsp (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:666:19)
at EmberAdapter.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/adapter/ember/adapter/emberAdapter.ts:1548:24)
at Controller.start (/app/node_modules/.pnpm/[email protected]/node_modules/zigbee-herdsman/src/controller/controller.ts:133:29)
at Zigbee.start (/app/lib/zigbee.ts:70:27)
at Controller.start (/app/lib/controller.ts:104:13)
at start (/app/index.js:149:5)

Please Help

Did you remove the ZHA integration before you started Zigbee2MQTT?

You can’t have both of them running and attempting to access the same coordinator (your Sonoff Dongle P).

On a separate note, you said you have the “P” model of the Sonoff Zigbee Dongle. That’s the version of hardware that uses zstack firmware. However, your Z2M’s configuration file shows you specified ember for adapter. It’s the “E” model of the Sonoff Zigbee Dongle that uses ember firmware.

P → zstack
E → ember

Look carefully on what’s printed on the Dongle and confirm which model it is then set adapter to the correct value (and ensure ZHA and Z2M aren’t both active and trying to talk to Sonoff Zigbee Dongle).

In addition to Taras’s solid advice your config may need some tweaking

mqtt:
  server: mqtt://core-mosquitto:1883
  user: [masked]
  password: [masked]
serial:
  port: /dev/ttyUSB0
  adapter: zstack
  rtscts: false

Your port and server format may have also been an issue in addition to the adapter type(very important).

Hello Shashankrao5,

In addition to what they said the tty ports can sometimes change internally, so it is suggested to use the /serial/by-id URL that always talks to your dongle by serial so it is always right.
You can find out that that is by using:
Open your Home Assistant instance and show hardware information.
and looking for it under all hardware, something like this:

Thank you, Taras and Sir_Goodenough, for your advice and I’d like to know 2 things before I proceed any further:

  1. Which one is better ZHA or Z2M, in terms of comparability and usability (FYI, I’m new to this)
  2. Is it better to have 2 Sonoff dongles for each of ZHA and Z2M, or run on one integration?
    Fyi, devices currently I’ve ordered are Sonoff ZBMIN-R2, Sonoff presence sensor, Sonoff PIR and Moes Dimmer module (Zigbee 3.0 and Tuya) and other Tuya Zigbee 3.0 devices.

Zigbee is a mesh network with low-powered radios. You really don’t want to split your mesh in half and risk interference by using ZHA and Zigbee2MQTT simultaneous . Choose one; and have a strong mesh.

Just a matter of taste. Zigbee2MQTT is easier and has faster updates for new devices, but I’m sure others will say ZHA is easier because it is a core integration.
You can’t go wrong with either.

1 Like