It’s finally here, thanks to amazing hacking work and collaborative effort of people in this GitHub post! With thanks in mind, I will show you how to flash Tasmota on Sonoff ZigBee Bridge (review) so you could use it with Home Assistant, NodeRED and more.
But why…?
I’m already rocking a CC2531 Zigbee stick flashed with Zigbee2MQTT, connected to a Raspberry Pi. Why would I flash Tasmota on Sonoff ZigBee Bridge instead? Apart from great range, using it comes with a great advantage: I can position the device anywhere at home optimising the range of my ZigBee network. I’m no longer tied to a physical location of the Raspberry Pi. In a well developed ZigBee mesh, that may not be an issue, but if you are getting started, it’s a great way to maximise your ZigBee coverage without extra devices.
As an added benefit, using Tasmota on Sonoff ZigBee Bridge will enable the device to support more ZigBee sensors, not just Sonoff Zigbee Sensors (review). Anything that is compatible with Z2T (Zigbee2Tasmota) firmware, will work. I already have guides how to add compatible ZigBee devices to Zigbee2MQTT & how to add new devices too.
Flashing Tasmota on Sonoff ZigBee Bridge
This is a 2 stage process, as Sonoff ZigBee Bridge comes with ESP8266 to control WiFi and MG21(EFR32) to handle ZigBee traffic. Thankfully, the process had been made a relatively easy and all you need is a couple of basic tools:
- a soldering iron – TS80 (review) or YIHUA 992DA+(review)
- 5 dupont cables
- FTD programmer (like this one)
- Raspberry Pi (for later)
Flashing Tasmota on Sonoff ZigBee Bridge
This is a standard procedure. Flip the board on it’s back as the dev pins are labelled for your convenience. Locate the following pins and connect them to the FTD programmer:
Sonoff ZigBee Bridge | FTD programmer |
3V3 | Vcc/3.3v |
GND | GND |
ERX | TX |
ETX | RX |
I00 (GPIO00) | GND (for flash only) |
I used Tasmotizer to flash and configure the Tasmota. Just run it as administrator if you come across any issues. Instead of the regular tasmota.bin
, you will need a pre-compiled version for ZigBee devices, which you can get from here:tasmota-zbbridge.bin
. The process of flashing is described in detail in the Tasmotizer article.
At this stage, only configure the WiFi. If your device isn’t connecting automatically to WiFi and the LED is blinking constantly, you can find Tasmota-XXXX SSID with your mobile and configure credentials this way. Find the device on your network (I use Fing Desktop app) and access Tasmota interface.
Go directly to the console option and execute this command so set the Tasmota with the interface for MG21(EFR32) flash:
Backlog Weblog 3; Module 0; Template {"NAME":"Flash ZBBridge","GPIO":[56,208,0,209,21,22,0,0,0,158,0,0,17],"FLAG":0,"BASE":18}
Sonoff ZigBee Bridge will reboot, and you will see a familiar Tasmota interface, but with 2 relay toggles. You are ready for the step 2.
Flashing firmware for MG21(EFR32)
First, you have to figure out what are you going to use the Sonoff ZigBee bridge for. As this will determine the firmware choice. Let’s install stuff that will help us: git
& lrzsz
sudo apt-get install lrzsz git -y
Clone Tasmota repo onto your Raspberry Pi (you can remove it when it’s done)
git clone https://github.com/arendst/Tasmota.git cd Tasmota/tools/fw_zbbridge/ ls ncp-uart-sw_6.5.5_115200.ota //HomeAssistant ncp-uart-sw_6.7.6_115200.ota //Zigbee2Tasmota readme.txt
There are 2 firmware files. One is for HomeAssistant, one for Zigbee2Tasmota – at this point, you have to make a call which one to flash. Before you can flash anything, you have to set the MG21(EFR32) into the correct mode.
Access Tasmota’s console and enable extended logs by typing Weblog 3
. At this stage you will see extra logs appearing on your console. Type TCPStart 8888
to open the port 8888 on the device.
14:31:34 CMD: TCPStart 8888 14:31:34 SRC: WebConsole from 192.168.1.5
Go back to the Tasmota menu and make sure that Relay 2
is OFF, then toggle Relay 1
, set it to ON then OFF and ON again to put the bootloader into flash mode. Go back to Tasmota’s console – you should see a couple TCP commands flooding (yours won’t be the same but similar) in:
14:38:30 TCP: from MCU: 0D0A4765636B6F20426F6F746C6F 14:38:30 TCP: from MCU: 616465722076312E392E312E30340D0A312E2 14:38:30 TCP: from MCU: 2065626C20696E666F0D0A424C203E20
If you don’t see these, something is not right, but you can reset the MG21 (EFR32) by using a dupont wire to momentarily shorten Z_RST
and GND
pins on the board.
Go back to the terminal and assuming you are still in the Tasmota/tools/fw_zbbridge/ directory run:
sx -vv -X -b --tcp-client <tasmota_IP>:8888 ncp-uart-sw_6.7.6_115200.ota
Change the command to reflect your Sonoff ZigBee Bridge IP and the file – Z2T in example above.
Sending ncp-uart-sw_6.7.6_115200.ota, 1486 blocks: Give your local XMODEM receive command now. Xmodem sectors/kbytes sent: 0/ 0kRetry 0: Got 0d for sector ACK Retry 0: Got 0d for sector ACK Retry 0: NAK on sector Bytes Sent: 190336 BPS:807 Transfer complete
Your Tasmota console will flash random TCP messages until the flash is complete.
11:15:23 TCP: from MCU: 0D0A53657269616C2075706C6F616420 11:15:23 TCP: from MCU: 636F6D706C6574650D0A
Congratulations. Now, it’s time to set the Tasmota on Sonoff Zigbee Bridge. Navigate back to main Tasmota menu and access Configuration->Configure Other to change the Tasmota template to:
{"NAME":"Sonoff ZBBridge","GPIO":[56,165,0,166,215,0,0,0,0,158,0,0,17],"FLAG":0,"BASE":18}
Don’t forget to tick the checkbox to activate the setting. Sonoff ZigBee Bridge will reboot and your device is ready for action. If your Tasmota still shows 2 relay toggles – go to Configuration->Configure Module and select Sonoff ZbBridge (75)
.
Buy Sonoff Zigbee Sensors
Buy it using these links to support NotEnoughTech.
Final thoughts
The process is still a little bit clunky, but you can enjoy Tasmota on Sonoff ZigBee Bridge. I will cover pairing sensors in another write-up, but if you are eager to get started, send ZbPermitJoin 1
in Tasmota’s console and the device will enter the pairing mode for 60 sec. Read more information about Zigbee2Tasmota in the documentation. Let me know if the process worked for you in this Reddit thread.