New OH user - trouble binding to Sonoff Zigbee USB 3.0 Dongle Plus

  • Platform information:

  • Hardware: pi4 8gb RAM, 8gb SD

  • OS: openhabian 3.2.0 (latest release image)

  • Java Runtime Environment: openjdk 11.0.14 2022-01-18

OpenJDK

Runtime Environment (build 11.0.14+9-post-Raspbian-1deb11u1)

OpenJDK Server VM (build 11.0.14+9-post-Raspbian-1deb11u1, mixed mode)

  • openHAB version: 3.2.0

  • Issue of the topic: New OH user - trouble binding to Sonoff Zigbee USB 3.0 Dongle Plus

  • Please post configurations (if applicable):

  • Items configuration related to the issue

  • Sitemap configuration related to the issue

  • Rules code related to the issue

  • Services configuration related to the issue

  • If logs where generated please post these here using code fences:

Using the latest firmware for the Sonoff USB Dongle: CC1352P2_CC2652P_launchpad_coordinator_20220219.zip

I am new to Openhab. I’ve started by installed OH 3.2.0 using the openhabian image on a blank SD card. I’ve followed example(s) I cannot locate at the moment. Basically:

  • download and write openhabian image to SD - allow install to complete

  • use openhabian-config to add options (11,12,13,14)

  • optional components: log web viewer and Mosquitto

  • system settings: set timezone, prepare serial port

*Install zigbee2mqtt (using linux instructions here: Linux | Zigbee2MQTT)

  • Add a Mosquitto broker

At this point, I have my mosquitto broker “online”, and my zigbee2mqtt running in console without errors. I set my port on z2m (configuration.yaml) to 8084 and get the web page generated by z2m on a browser at openhabian:8084. It is my understanding that the Sonoff Dongle will “see” the zigbee devices and z2m will connect to the Sonoff Dongle to pull that data to Openhabian through the Ember Coordinator. So I’m assuming at this point the zigbee devices I have turned on/powered up should start showing up in the zigbee2mqtt web page, but I’ve never seen any devices after setting the “Permit Join” button.

Next, I try to add a binding for my Sonoff Zigbee USB 3.0 Dongle Plus.

Things: +: Ember Coordinator (bridge): Ember Coordinator:

  • Show Advanced: checked

  • Reinitialize Controller (on)

  • leave untouched: Channel, PanID, ExtendedPanID, Network Security Key, Link Sec Key, Install, code, Group Restrictions, Mesh Update Period.

*Trust Center Join Mode: Allow All Joins

  • serial port: TTYUSB0 (as detected and tested on openhabian)

  • Flow Control: (I’ve tried several settings)

  • Baud Rate: (I’ve tried several settings)

  • Ember NCP: left at Boost

  • Transmit Power: left at Normal

  • Child Aging Timeout: left at 1 day

  • Network size: left at Medium

  • Concentrator: tried both settings

Create thing and wait. Some settings leave me with Unknown status, others with Comm Error. I tried several different settings, restarting Openhabian with “Sudo Reboot” after deleting a coordinator and installing a new one.

I’ve never seen any zigbee traffic (watching zigbee2mqtt running in console) from the Sonoff SNZB-02 (temp humidity) or Sonoff S31 (Smart Plug supposed to work with zigbee) devices. And after adding the Ember Binding successfully, I would expect more than just bindings to show up on the “Add Thing” page. Searching bears no fruit.

I added a Network binding and saw a whole lotta (e.g. port 80) things show up in the list when click plus and wait.

I added a Nortek Zwave and Zigbee adaptor and was able to get all the bindings (MQTT, Zigbee, Zwave) showing “Online” status, however, I read that zigbee2mqtt doesn’t yet support this adaptor so I’m back to the Sonoff.

Many thanks to the developers ( I love Open Source ) and those who assist here.

They won’t just magically appear. You will need to set each of your devices into pair mode - check the zigbee2mqtt documentation for instructions on how to do that for your devices.

I’d be interested to understand where this idea comes from.

This is how it should work:

  • Your ZigBee dongle connects to zigbee2mqtt.
  • Your ZigBee devices connect via your ZigBee dongle to zigbee2mqtt.
  • Zigbee2mqtt connects to your MQTT broker (Mosquitto in your case)
  • openHAB also connects to your MQTT broker via the MQTT Binding.
  • openHAB and zigbee2mqtt now ‘talk’ to each other via the MQTT broker. openHAB does not interact with your ZigBee dongle at all, as previously mentioned.

So it goes:

ZigBee device → ZigBee dongle → zigbee2mqtt → MQTT broker → openHAB via MQTT binding.

1 Like

Thank you for your response. My Understanding - the sonoff dongle is a device that has a transmitter and a receiver for zigbee frequencies. It plugs into your hardware (e.g. Raspberry Pi) and your hardware must have a driver to talk to it (USB device in openhabian). The Sonoff also requires firmware to configure the various electronics onboard and in order to use that device with its firmware you need an application on your computer os to “talk to it” - which is zigbee2mqtt.

I’m thinking that since the zigbee2mqtt is operational, it is “talking to” the dongle, and since those three things (openhabian, zigbee2mqtt, Sonoff Dongle) are operating, I should see some things show up. I did (and will retry) setting the items to pairing mode… wouldn’t an “online” Zigbee Coordinator be required in Openhab Things in order to see any Zigbee devices in Openhab?

If I understand your assertion, I shouldn’t then need an Ember Coordinator for Zigbee?

Correct. And I suspect there’s some confusion here about what openHAB is, and what openhabian is.

You’re right that your OS needs a USB driver so that your dongle can communicate with software. We could probably stretch that statement and say that openhabian is the OS which provides that USB driver.

But that’s it. No more openHAB or openhabian involvement. Your dongle ONLY talks to zigbee2mqtt. zigbee2mqtt ONLY talks to Mosquitto. openHAB (via the MQTT binding) ONLY talks to Mosquitto.

No. Unless you want to ditch zigbee2mqtt entirely and use the ZigBee Binding instead, which will talk directly to your dongle, assuming that your dongle is supported (I have no idea about that).

Ok. I now see a device in the zigbee2mqtt (pairing enabled) and will dig in again to move forward :slight_smile:

Thank you hafniumzinc!

Good. Note that getting your device into pair mode is explicitly described in the zigbee2mqtt Getting Started documentation - you’re entering a crazy and awesome world, but doing it without consulting the available documentation carefully will lead to much frustration!

You are correct. The challenge for OH3 is so many abstractions. Thank you for helping me get past that one. Since the Adaptor is new, and OH3 is kinda new, and I’m new… :wink: