[SOLVED] How to setup the Sonoff Zigbee USB Dongle?

Thanks Rich,

Here’s the config, I’ve gone with the defaults.

UID: zigbee:coordinator_ember:515617b262
label: Ember Coordinator
thingTypeUID: zigbee:coordinator_ember
configuration:
  zigbee_port: /dev/ttyUSB0
  zigbee_initialise: false
  zigbee_channel: 11
  zigbee_concentrator: 0
  zigbee_trustcentremode: TC_JOIN_SECURE
  zigbee_extendedpanid: CED1189272438D7C
  zigbee_flowcontrol: 1
  zigbee_baud: 115200
  zigbee_panid: 17002
  zigbee_powermode: 1
  zigbee_txpower: 0
  zigbee_networksize: 100
  zigbee_linkkey: 5A6967426565416C6C69616E63653039
  zigbee_childtimeout: 86400
  zigbee_networkkey: 08312D3C284A754C57D6B22215185AB4
  zigbee_meshupdateperiod: 86400

Double check that usb port. It defaults on ttyUSB0 or somesuch, until it doesn’t and you’re left scratching your head as to why it’s not working.
Also, check the permissions. Just because the port is correct does not mean that the openHAB user has the rights to access it/read it.

Had a play around last night and this morning. Tried a number of different options I’m still no closer. Here’s the logs that seem to suggest the Binding doesn’t want to keep the port open.

2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Initializing ZigBee network [zigbee:coordinator_ember:db367f96e9].
2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Channel 0
2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - PANID 0
2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - EPANID 0000000000000000
2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Network Key 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Link Key 5A 69 67 42 65 65 41 6C 6C 69 61 6E 63 65 30 39
2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Config: zigbee_initialise found, initializeNetwork=false
2022-09-28 07:59:33.880 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - ExtendedPanId or PanId not set: initializeNetwork=true
2022-09-28 07:59:33.881 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Network Key String 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2022-09-28 07:59:33.881 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Network key initialised 48100E0DCDCB9AB62B50633068AA5471
2022-09-28 07:59:33.881 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Network key final array 48100E0DCDCB9AB62B50633068AA5471
2022-09-28 07:59:33.881 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Link Key String 5A 69 67 42 65 65 41 6C 6C 69 61 6E 63 65 30 39
2022-09-28 07:59:33.882 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Initialising network
2022-09-28 07:59:33.882 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Channel set to 11.
2022-09-28 07:59:34.172 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Created random ZigBee PAN ID [4863].
2022-09-28 07:59:34.296 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Created random ZigBee extended PAN ID [50A953B4917D885D].
2022-09-28 07:59:34.604 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Link key final array 5A6967426565416C6C69616E63653039
2022-09-28 07:59:34.604 [DEBUG] [ng.zigbee.ember.handler.EmberHandler] - Initializing ZigBee Ember serial bridge handler.
2022-09-28 07:59:34.604 [DEBUG] [ng.zigbee.ember.handler.EmberHandler] - ZigBee Ember Coordinator opening Port:'/dev/ttyUSB1' PAN:4863, EPAN:50A953B4917D885D, Channel:11
2022-09-28 07:59:34.604 [DEBUG] [ng.zigbee.ember.handler.EmberHandler] - Ember end device poll timeout set to (169 * 2^9) = 86528 seconds
2022-09-28 07:59:34.604 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Scheduling ZigBee start
2022-09-28 07:59:35.605 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - ZigBee network starting
2022-09-28 07:59:35.606 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Initialising ZigBee coordinator
2022-09-28 07:59:35.607 [DEBUG] [ding.zigbee.internal.ZigBeeDataStore] - Creating ZigBee persistence folder /var/lib/openhab/zigbee/zigbee_coordinator_ember_db367f96e9/
2022-09-28 07:59:35.608 [DEBUG] [nding.zigbee.serial.ZigBeeSerialPort] - Connecting to serial port [/dev/ttyUSB1] at 115200 baud, flow control FLOWCONTROL_OUT_NONE.
2022-09-28 07:59:35.608 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: networkStateUpdated called with state=INITIALISING
2022-09-28 07:59:35.912 [DEBUG] [nding.zigbee.serial.ZigBeeSerialPort] - Serial port [/dev/ttyUSB1] is initialized.
2022-09-28 07:59:45.925 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: networkStateUpdated called with state=OFFLINE
2022-09-28 07:59:46.927 [INFO ] [bee.handler.ZigBeeCoordinatorHandler] - ZigBee dongle inactivity timer. Reinitializing ZigBee
2022-09-28 07:59:46.940 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: networkStateUpdated called with state=SHUTDOWN
2022-09-28 07:59:47.288 [DEBUG] [nding.zigbee.serial.ZigBeeSerialPort] - Serial port '/dev/ttyUSB1' closed.
2022-09-28 07:59:47.288 [DEBUG] [ng.zigbee.ember.handler.EmberHandler] - Initializing ZigBee Ember serial bridge handler.
2022-09-28 07:59:47.289 [DEBUG] [ng.zigbee.ember.handler.EmberHandler] - ZigBee Ember Coordinator opening Port:'/dev/ttyUSB1' PAN:4863, EPAN:50A953B4917D885D, Channel:11
2022-09-28 07:59:47.289 [DEBUG] [ng.zigbee.ember.handler.EmberHandler] - Ember end device poll timeout set to (169 * 2^9) = 86528 seconds
2022-09-28 07:59:47.289 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Scheduling ZigBee start
2022-09-28 07:59:48.289 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - ZigBee network starting
2022-09-28 07:59:48.290 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - Initialising ZigBee coordinator
2022-09-28 07:59:48.291 [DEBUG] [nding.zigbee.serial.ZigBeeSerialPort] - Connecting to serial port [/dev/ttyUSB1] at 115200 baud, flow control FLOWCONTROL_OUT_NONE.
2022-09-28 07:59:48.291 [DEBUG] [bee.handler.ZigBeeCoordinatorHandler] - null: networkStateUpdated called with state=INITIALISING
2022-09-28 07:59:48.640 [DEBUG] [nding.zigbee.serial.ZigBeeSerialPort] - Serial port [/dev/ttyUSB1] is initialized.

Hi Maximo,
Did you ever get this working, I am running it on Windows10 and it comes up with “ERROR: COMM” could it be an error with data/parity/stop bits ?,

Hi Morbid,

The version of the dongle I have isn’t compatible with the Zigbee binding, so it’s not a configuration issue and can’t be resolved. I’ve put the dongle to one side until I decide what to do next. It works great with HA and that is an option, but I prefer how openHAB works, also it would take a great deal of effort to migrate my current setup.

Hopefully someone is working on a fix to the binding that will allow it to work and can re-visit this in the future.

Could you use zigbee2mqtt? Then you could keep openHAB. The page below lists compatible controllers…

Yes I’ve seen this and have setup it up to try out. Although I managed to get it working, it’s not the ideal setup as it then adds more components into the mix. But haven’t ruled it out as an option either.

Hi All,
I have played around with a couple of options, my main thing is be off cloud, I am still testing a variety of options, I just need a Zigbee link. Will do further testing and let you know next week.

Which version is that? (I have been sitting for hours trying to get the thing to work)

When I do usb-devices, Mine shows up as this:

T:  Bus=01 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#=  6 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=10c4 ProdID=ea60 Rev=01.00
S:  Manufacturer=Silicon Labs
S:  Product=Sonoff Zigbee 3.0 USB Dongle Plus
S:  SerialNumber=0001
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=cp210x

I think openHAB is seeing it (I can select its port when adding an Ember coordinator in the Zigbee binding), but then it gets stuck initializing…

Output for https://itead.cc/product/zigbee-3-0-usb-dongle/ :

T:  Bus=01 Lev=03 Prnt=04 Port=01 Cnt=02 Dev#=  7 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=02(commc) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=1a86 ProdID=55d4 Rev=04.42
S:  Manufacturer=ITEAD
S:  Product=SONOFF Zigbee 3.0 USB Dongle Plus V2
S:  SerialNumber=20220817XXXXXX
C:  #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=132mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

ZBDongle-P is not supported by the Zigbee Binding: ZigBee - Bindings | openHAB

2 Likes

OK, then I have the wrong version :sob: It was sold as compatible with openHAB, so the seller apparently mixed up the two versions. Thank you so much for clarifying this.

I guess part of the confusion might be that it is the newer version that openHAB supports while the old version is “not yet” supported…

Hi Chris,

You have the bought the same one as me, although it works with Zigbee2Mqtt it doesn’t work directly with the Zigbee binding. It’s it’s a little more complicated to get setup and means you have to also manage your MQTT broker. So far now mine is sat in the draw gather dust, I’ve looked to see if I can get hold of the E version.

Yes, I eventually managed to set it up via zigbee2mqtt. But it was a pain because zigbee2mqtt sends a JSON-formated payload by default so I tried to get the JSONpath to work in OH3 until I stumbled across this post, telling me that there is a hidden feature in zigbee2mqtt that gets rid of all that and just produces “normal” mqtt topics with their respective states. Once I had that set up, it worked nicely.

At first I was sceptical about introducing yet another app into the system, but now I see the advantage of not doing everything on OH3. Managing the zigbeenetwork independently of OH3 kinda makes sense and it feels I’m less dependent on OH3.

Also super useful for troubleshooting.
If you have a weird issue, maybe it’s openHAB, or an error on a rule, or something acting up.
Turn off openHAB and send a command directly to the device, which you can do with zigbee2mqtt.
Additionally, that zigbee map is super nice to see whether or not you have link quality problems.

Oh yes, I love my map. Shows me all my devices in a simple and easy to understand way:

Bwuahhahaha :smiley: don’t worry, sensors have a tendency of multiplying :stuck_out_tongue:

I have now managed to get hold of ZBDongle-E, here’s the output from usb-devices below. Having tried various configuration combinations I still can’t get OH to see it.

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=02(commc) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=1a86 ProdID=55d4 Rev=04.42
S:  Manufacturer=ITEAD
S:  Product=SONOFF Zigbee 3.0 USB Dongle Plus V2
S:  SerialNumber=20221031xxxxxxxx
C:  #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=132mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=01 Driver=cdc_acm
I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm

Having looked at zigbee2mqtt previously, sticking with a Hue Bridge and Tradfri Gateway provides me with the same level of functionality and needs less effort. But this defeats my objective of removing them altogether and have a single Zigbee controller.

Has anyone managed to get the ZBDongle-E configured and working directly with the Zigbee Biding? If so, can you share you configuration.

The only error I have to work with is:

[ERROR] [zigbee.dongle.ember.ZigBeeDongleEzsp] - EZSP Dongle: Unable to open serial port

There are success stories for the ZBDongle-E/Zigbee Binding on the forum.

Try

openhabian@openhabian:/dev $ ls -al /dev/serial/by-id
total 0
drwxr-xr-x 2 root root 80 Mar 26 13:31 .
drwxr-xr-x 4 root root 80 Mar 16 15:58 ..
lrwxrwxrwx 1 root root 13 Mar 16 15:58 usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220817212806-if00 -> ../../ttyACM0
lrwxrwxrwx 1 root root 13 Mar 26 13:31 usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0 -> ../../ttyUSB0

to find the the Unix device your dongle is connected to and make sure that the port configuration in the Zigbee Binding is correct.

I strongly recommend using udev to assign a permanent Unix device name to your dongle:

OK, I’ve made a little progress. It’s a permissions issue that I’m experiencing. If I run openhab with the root user I can access the dongle fine, but running openhab with the openhab user I can’t access the dongle.

I’ve followed all the guides.

sudo adduser openhab dialout
sudo adduser openhab tty

EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyZWAVE:/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/dev/ttyACM0:/dev/ttyAMA0"

I have finally resolved the issue by following this write up.

For those who just want the the solution, here you go.

usermod -a -G lock openhab
1 Like