Modern Guide to Thread on a Sonoff Zigbee 3.0 USB Dongle Plus V2

I spent over an hour fussing with an Sonoff Zigbee 3.0 USB Dongle Plus V2 trying to get it to act as a Thread Border Router. Looking back, all the information I needed does exist somewhere, but as a new user doing it very recently, all I found was third party guides that turned out to be outdated, and feeling like the HA documentation only covered their official hardware/ dongle, with not a word of guidance about 3rd party dongles.

This was the first article that I worked from: Enabling Thread and Matter on Sonoff ZBDongle-E - SmartHomeScene
This website is a great resource, but the article is 2 years old. It has us install the Multi-PAN (RCP) firmware onto the dongle. However, after doing so and attempting to proceed, I saw in the Silabs Multiprotocol Addon addons/silabs-multiprotocol at master ¡ home-assistant/addons ¡ GitHub that:

Multiprotocol is no longer supported and will be removed in the near future!

So we move on. Here are the actual steps to follow. Note that this means that your dongle will only speak Thread afterwards, and no longer be able to speak Zigbee. You would likely need separate dongles if you wish to have a mix of Zigbee and Thread devices talking to HA.

  1. This is the same flasher that the article above has us use. We still use it, but flash the Openthread firmware:
    Silabs Firmware Flasher | Web based flasher for ZB-GW04 and ZBDongle-E. MultiPAN RCP firmware enables these devices to be used with Silabs Multiprotocol Addon in Home Assistant. Allow Zigbee and Thread to co-exist on the same dongle. Get ahead of the tech an experiment with Matter!

    Follow the instructions on that page. Use a Chrome-based browser. Heed the warnings about the CP2102 driver potential issues on Windows. I gave up on fussing with Windows and used my Macbook for this. Wait until Openthread firmware is successfully flashed on your dongle, then disconnect it.
  2. You will want to get deeply acquainted with this part of the documentation: Thread - Home Assistant
    In my case, I would follow: Turning Home Assistant into a Thread border router and then Case 1: Making Home Assistant your first Thread network. But if you have existing Thread networks/ routers, another section may apply to you.
    Plug your flashed USB dongle into your Home Assistant server/ host device.
    Install the Thread integration in HA under Settings → Devices & services → Thread.

    Then I opened it up and for me it was empty/ showed no devices, as I did not have any Thread devices yet and the Thread dongle is not yet set up.
  3. Install the OpenThread Border Router add-on , not the integration you just saw as an option in the last step. Navigate to it and you will see the Info, Documentation, Configuration, and Log tabs at the top.
    Now, you need to configure it, and while I now know that all the information was right in front of me in docs I have already linked above, I didn’t know what was relevant to me at the time as I tried to fuss with all of this. This was the topic I kept getting led to, and used as a starting point, but there are differences for the Sonoff dongle, so follow my config options below instead. Sonoff ZBDongle-E with Openthread RCP - #5 by francisp
    • Select your USB device from the options/ list.
    • The Baudrate for the Sonoff dongle is 460800
    • Turn Hardware flow control off !!!
    • Turn Automatically flash firmware off as it will not help you anyways, you are not using official HA hardware.
    • leave OTBR firewall on
    • leave NAT64 off
    • in my Network section, I already had port 8080 in use, so I changed it to 8082 and kept the second line as 8081. You should handle this if needed based on your own setup.

      Save all your Config settings. Go to the Info tab and start the add on. Watch Logs from the Log tab. If you put incorrect settings in Configuration above, you will see errors here, like I did. Not seeing errors and seeing INFO: Successfully sent discovery information to Home Assistant. is a great success point!
  4. Exercise patience. I would open a new tab of Home Assistant and navigate to Settings → Devices & services. Perhaps refresh it after a few minutes. Our goal is for the Open Thread Border Router integration to automatically show up in your list of integrations. Remember how you didn’t add this integration earlier? Good. You shouldn’t have to add it now. It should show up by itself. If you don’t see it after a few minutes, I suggest to restart Home Assistant. That’s what got things going for me.
  5. After the Open Thread Border Router integration has shown up,

    we want to click on the Thread integration.

    and press on the gear icon here:

    You should see something like this:

    The little i icon in the top right of is where the network information lives. That also took me a little while to figure out. Click it.

    I won’t show a screenshot of that particular modal that pops up as it is all your own private Thread network information.
    You don’t need to copy every line/ entry one by one.
    To configure ESPHome, just copy the last long line under Active dataset TLVs:



If you wish to set up an ESPHome device using Thread, you will need a compatible chipset. The ESP32-C6 supports Wifi, Bluetooth, and Thread, but to use Thread, you’ll need to turn the Wifi off. The ESP32-H2 does not speak Wifi. If you want to play, I suggest getting a ESP32-C6-DevKitC-1. Other options also exist, which the
Read this in great detail:

If you want to play, I suggest getting a ESP32-C6-DevKitC-1. Other options also exist, which this wonderful article also talks about:

Here I show a screenshot of my test ESPHome config of the C6-Devkit. I purposefully leave it as a screenshot only, as all the options are copied from the 2 articles linked above. Read them and you too shall have all the resources you need.
As I said, Wifi needs to be disabled to enable Thread.

I have the RGB LED on the dev board in Home Assistant!

You can OTA update over Thread! It takes a minute (seriously). It’s not molasses slow, but it is noticeably slower than USB or Wifi flashing. And that was with the ESP talking directly to the dongle, a foot apart, with no other nodes in between. But still, the fact that it’s possible amazes me. For your playing/ development, I suggest saving yourself some perception units and connecting to the ESP32-C6 dev board over USB for flashing and reading the logs afterwards.

And lastly, if you’ll recall the config that I changed to port 8082, this is what lives there! You can load that up in your browser, and go to the Topology tab to see what your Thread network is up to :slight_smile:

I hope this helps someone!

29 Likes

Thank you so much for sharing this. Incredibly useful guide, cut through all of the other outdated fluff.

3 Likes

Thanks for this great guide.

I know this is already in the documentation you’ve shared but I want to add for everyone who may have missed it, that before adding matter devices you need to synch the credentials of your thread border router to your companion app:

  • Before you can add Matter-based Thread devices, your phone needs to know the credentials of your newly created Thread network.
  • To share the credentials with your Android phone, open the Home Assistant Companion app.
    • In the Companion app, go to Settings > Companion app > Troubleshooting, then select Sync Thread credentials.
    • Follow the instructions on screen.
    • Result: You will see a confirmation stating that Thread credentials from Home Assistant have been added to this device.
  • To share the credentials with your iPhone, open the Home Assistant Companion app.
    • Go to Settings > Devices & services, select the Thread integration.
    • Select Configure under Services.
    • At the bottom of the preferred network box, select Send credentials to phone.
6 Likes

Hi Marco,

Thanks for this note. I’ve just gone ahead and done this now, but it’s the first I’m hearing of it and I still don’t know why you have to do it.

Can you link the section of the docs that states this for me please?
Perhaps it is for if you have a commercial “end user” Matter device like a Nest thermostat and you will use their mobile app to set it up, then your phone needs to know the details? I have not done that yet, so perhaps that is why I am unfamiliar with it. The ESP32-C6 got configured and deployed using ESPHome Builder on HA without any phone involvement.

I have the Sonoff Lite MG21 with OpenThread 2.4.4 firmware ( delivered with Sonoff). but getting errors trying to configure it as a router. Some people followed this guide with their LMG21 and succeeded. but i have no such luck. What am I Doing wrong

@Fleu Same problem here. Did you manage to find a solution ?

[Edit]

Seems OK for me with :

  openthread-border-router:
    image: openthread/border-router:latest
    container_name: otbr
    network_mode: host
    privileged: true
    environment:
      OT_RCP_DEVICE: "spinel+hdlc+uart:///dev/thread?uart-baudrate=460800"
      OT_INFRA_IF: "enxa0cec88bbb0a"
      OT_THREAD_IF: "wpan0"
      OT_REST_LISTEN_ADDR: "0.0.0.0"
      OT_REST_LISTEN_PORT: "8081"
      OT_LOG_LEVEL: 7
    devices:
      - /dev/serial/by-id/usb-SONOFF_SONOFF_Dongle_Lite_MG21_e81acdf782a0ef11a5fc9fa361ce3355-if00-port0:/dev/thread
      - /dev/net/tun:/dev/net/tun
    restart: unless-stopped

Hi there,

thanks for this great tutorial. Unfortunately I am not getting further as to Step 3. Even with enough patience I do not get the “Open Thred Boarder Router” Integration displayed in HA. The only new device HA is offering is the Device itself named “Sonoff Zigbee 3.0 USB Dongle Plus V2”

The log of the “OpenThread Border Router” AddOn looks good, doesn’t it?

Adapter settings file /data/thread/0_bc8d7efffe92d84b.data is the most recently used, skipping
[12:31:24] INFO: Starting otbr-agent...
[NOTE]-AGENT---: Running 0.3.0-b067e5ac-dirty
[NOTE]-AGENT---: Thread version: 1.3.0
[NOTE]-AGENT---: Thread interface: wpan0
[NOTE]-AGENT---: Radio URL: spinel+hdlc+uart:///dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_3c61df5764f3ef11bdbabf1b6d9880ab-if00-port0?uart-baudrate=460800&uart-init-deassert
[NOTE]-AGENT---: Radio URL: trel://end0
[NOTE]-ILS-----: Infra link selected: end0
73d.12:28:29.464 [C] P-SpinelDrive-: Software reset co-processor successfully
00:00:00.044 [N] RoutingManager: BR ULA prefix: fd7e:4652:ccc3::/48 (loaded)
00:00:00.045 [N] RoutingManager: Local on-link prefix: fda2:3585:56a0:602::/64
00:00:00.062 [N] Mle-----------: Role disabled -> detached
00:00:00.076 [N] P-Netif-------: Changing interface state to up.
00:00:00.086 [W] P-Netif-------: Failed to process request#2: No such process
00:00:00.087 [W] P-Netif-------: Failed to process request#6: No such process
s6-rc: info: service otbr-agent successfully started
s6-rc: info: service otbr-agent-configure: starting
Done
s6-rc: info: service otbr-agent-configure successfully started
s6-rc: info: service otbr-agent-rest-discovery: starting
00:00:00.544 [W] P-Daemon------: Failed to write CLI output: Broken pipe
[12:31:25] INFO: Successfully sent discovery information to Home Assistant.
s6-rc: info: service otbr-agent-rest-discovery successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
00:00:26.909 [N] Mle-----------: RLOC16 8000 -> fffe
00:00:27.344 [N] Mle-----------: Attach attempt 1, AnyPartition reattaching with Active Dataset
00:00:33.844 [N] RouterTable---: Allocate router id 32
00:00:33.844 [N] Mle-----------: RLOC16 fffe -> 8000
00:00:33.847 [N] Mle-----------: Role detached -> leader
00:00:33.848 [N] Mle-----------: Partition ID 0xe184fb4
[NOTE]-BBA-----: BackboneAgent: Backbone Router becomes Primary!
00:00:37.621 [W] DuaManager----: Failed to perform next registration: NotFound

Or am I all set now if I find my border router listed under Thread integration:

Thank you! I was pulling out my hair until I saw this post, toggled that setting, and everything magically started to work.

2 Likes

Thank you very much! This solved the issues for me. I do not know wwhy, but there you can also trigger the credentials sync from the Thread integration settings. However, that always failed for me. Going via the Companion App Troubleshooting, it worked the first time and made adding Thread/Matter devices possible!
Thx again!

I flashed my Dongle Lite mg21 to thread fw using this hassio-ihost-addon/hassio-ihost-sonoff-dongle-flasher at master ¡ iHost-Open-Source-Project/hassio-ihost-addon ¡ GitHub
And now things work following other stuff above in this thread.

In the meantime I found the official Sonoff web flasher also has openthread firmware as an option and seems a bit more reliable for me. Not sure if you still need to do the driver dance.

Edit: Pretty sure I had the Openthread App set to run on restart but it had stopped, which was causing my issue.

Also the Sonoff website has a guide about how to update the firmware

I’m quite new to HA, so pardon me if I ask the wrong questions, but: I flashed my dongle with the sonoff Flasher, which worked perfectly.
Then tried this guide to set it up in HA, but I keep gettting this error when running the openThread app (copy/past from debug log): "
OSError: [Errno 5] Input/output error: ‘/dev/serial/by-id/usb-Itead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_V2_a82451488cf3ef11b990c41b6d9880ab-if00-port0’
[22:42:51] WARNING: otbr-agent exited with code 1 (by signal 0)."

Can any1 help me with this? Previously used the dongle for zigbee; I deleted this integration. chatGPT seems to think there is some “zigbee” left in mij .storage, but I’m hesitant to make changes based on chatGPT.

Thanks for any input!

I did all the above. but my matter connection stucks at "connected thread network, checking thread network. How to solve this? I reinstalled the compagnion app, dit delete cache etc in Google home services, reinstalled Google home app. but no luck.
Thanks for the help