Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Zigbee Router configuration for ESPHome on ZB-GW03 #12

Closed
Hedda opened this issue Feb 17, 2022 · 9 comments
Closed

[REQUEST] Zigbee Router configuration for ESPHome on ZB-GW03 #12

Hedda opened this issue Feb 17, 2022 · 9 comments

Comments

@Hedda
Copy link
Contributor

Hedda commented Feb 17, 2022

FYI, xsp1989 has uploaded a signed Zigbee Router firmware for ITead's Sonoff ZBBridge which could possibly make it a Tasmota/ESPHome connected Zigbee Router (instead of as a Zigbee Coordinator).

I think that this firmware image should also be compatible with ZB-GW03 as it too uses "SM-011 V1.0"?

Do you think that ESPHome could send basic commands to Zigbee Router firmware to initiate paring/joining and restart/reset?

https://drive.google.com/file/d/1H-M5CTh_XGGVl2te4vHLQ5SfGPHL6yCS/view?usp=sharing

This is the signed routing firmware used by ZBB, the usage method is the same as the unsigned firmware.

https://github.com/xsp1989/zigbeeFirmware/blob/master/firmware/Zigbee3.0_Dongle/RouterForDongle/README.md

Idea around this is also discussed for ITead's Sonoff ZBBridge hacked with Tasmota/ESPHome here:

arendst/Tasmota#11536

thegroove/esphome-zbbridge#3

xsp1989/zigbeeFirmware#2

xsp1989/zigbeeFirmware#16

I have not tried this myself as I got rid of my ITead Sonoff ZBBridge because being WiFi-based it did not work any good as a remote Zigbee Coordinator, and never bought a ZB-GW03, but might reconsider buying these if it worked as a Zigbee Router device that can be paired/joined and restarted/reset remotely via Tasmota and/or ESPHome. So that Tasmota/ESPHome is basically only used to initiate virtual join/pair button and restart/reset the device similar to a remote power-cycle it hangs.

@Hedda
Copy link
Contributor Author

Hedda commented Feb 18, 2022

Update from xsp1989 on router firmware posted on arendst/Tasmota#11536

"This firmware can ground the PA00 5S into pairing mode, and ground the RST to restart routing. UART is used to transmit data transparently.

and

"There is also another version of the routing firmware that can control the join network through a proprietary serial port protocol"

@Hedda
Copy link
Contributor Author

Hedda commented Feb 20, 2022

Check out this new "How to Convert the Sonoff Zigbee Bridge into a Router / Repeater" blog article by @digiblur here:

https://www.digiblur.com/2022/02/convert-sonoff-zigbee-bridge-to-router-repeater.html

Note that the article already assumes that you have flashed Tasmota onto ITead Sonoff ZBBridge as per his previous guide:

https://www.digiblur.com/2020/07/how-to-use-sonoff-zigbee-bridge-with.html

@syssi
Copy link
Owner

syssi commented Feb 22, 2022

{
  "NAME":"Sonoff ZigRouter","GPIO":
  [
    320,   # GPIO0     Led_i 1     Inverted LED - default state ON
    5088,  # GPIO1     TCP TX      TCP to serial bridge
    0,     # GPIO2     Not used
    5120,  # GPIO3     TCP RX      TCP to serial bridge
    257,   # GPIO4     Relay_i 2   Relay inverted
    256,   # GPIO5     Relay_i 1   Relay inverted
    0,     # GPIO6     Not used
    0,     # GPIO7     Not used
    0,     # GPIO8     Not used
    576,   # GPIO9     LedLinki    Device Status LED, inverted
    0,     # GPIO10    Not used
    0,     # GPIO11    Not used
    32,    # GPIO12    Button 1    Button active low, internal pull-up resistor
    0      # GPIO13    Not used
   ],
  "FLAG":0,
  "BASE":18
} ; delay1 ; module 0

Summary: GPIO5 is used to trigger to pairing mode (via Relay_i 1 or Button 1) at digiblurs tasmota template.

@syssi
Copy link
Owner

syssi commented Feb 22, 2022

Comparison of different Sonoff Zigbee Bridge tasmota templates:

{"NAME":"ZHA ZBBridge",    "GPIO":[ 56, 208,0, 209, 59, 58,0,0,0,  0,0,0,17  ],"FLAG":0,"BASE":18}
{"NAME":"Sonoff ZHABridge","GPIO":[ 56, 208,0, 209, 59, 58,0,0,0,  0,0,0,17  ],"FLAG":0,"BASE":18} ; module 0
{"NAME":"Sonoff ZigRouter","GPIO":[320,5088,0,5120,257,256,0,0,0,576,0,0,32,0],"FLAG":0,"BASE":18} ; delay1 ; module 0 
{
  "NAME":"ZHA ZBBridge",
  "GPIO":[
    56,  # GPIO1     Led_i 1     Inverted LED - default state ON
    208, # GPIO2     TCP TX      TCP to serial bridge
    0,   # GPIO3     Not used
    209, # GPIO4     TCP RX      TCP to serial bridge
    59,  # GPIO5     Led_i 4     Inverted LED - default state ON
    58,  # GPIO6     Led_i 3     Inverted LED - default state ON
    0,   # GPIO7     Not used
    0,   # GPIO8     Not used
    0,   # GPIO9     Not used
    0,   # GPIO10    Not used
    0,   # GPIO11    Not used
    0,   # GPIO12    Not used     
    17   # GPIO13    
  ],
  "FLAG":0,
  "BASE":18
}

@syssi
Copy link
Owner

syssi commented Feb 22, 2022

xsp1989/zigbeeFirmware#16 (comment)
arendst/Tasmota#11536 (reply in thread)

"This firmware can ground the PA00 5S into pairing mode, and ground the RST to restart routing. UART is used to transmit data transparently.

At the ZB-GW03 PA00 is attached to GPIO12 of the ESP: https://github.com/syssi/esphome-zb-gw03/blob/main/example.yaml#L93-L99

@syssi syssi closed this as completed in 42f3060 Feb 22, 2022
@syssi
Copy link
Owner

syssi commented Feb 22, 2022

I've added a guide to use the ZB-GW03 as Zigbee router: https://github.com/syssi/esphome-zb-gw03/blob/main/docs/router.md

@digiblur
Copy link

I kept it simple with the pairing and zigbee reset for folks.

@Hedda
Copy link
Contributor Author

Hedda commented Feb 23, 2022

@syssi Could you maybe replicate the button press paring mode option from @digiblur as well as too is great alternative option?

https://www.digiblur.com/2022/02/convert-sonoff-zigbee-bridge-to-router-repeater.html

Having two possible methods with one being a virtual button in the UI and one being pressing a physical button would be super!

Next we need to enable the ability for the GUI and reset button to be used as the device pairing procedure. Paste the following command into the console all on one line:

backlog template {"NAME":"Sonoff ZigRouter","GPIO":[320,5088,0,5120,257,256,0,0,0,576,0,0,32,0],"FLAG":0,"BASE":18} ; delay1 ; module 0

The bridge should reboot and come back up on the console. The device is ready to be paired with your Zigbee network. Go ahead and place it in the desired location of the home and power it up. Enable pairing on your Zigbee Network as you would normally pair a regular sensor, switch, etc. NOTE: Zigbee2MQTT users as of this time will need to add a custom file to support this router before pairing (see last section of this guide)

To place the device into pairing mode, simply use a paper clip to briefly push the reset button next to the USB power plug.

image

The green LED will light up. Allow 5-6 seconds to pass and press the button again, this will turn off the green LED and the device will be in pairing mode.

image

ZHA Users should see something like this

image

Another method of pairing is to press the "Toggle 1" button on the Tasmota GUI and leave it set to ON for 5-6 seconds then turn it back off. This is the same as the reset button paper clip push method above. Toggle 2 is the Zigbee chipset reboot button, toggling it will reset the Zigbee chipset, do not leave it set to ON.

image

That's it! You now have another router on your network! Congrats!

@syssi
Copy link
Owner

syssi commented Feb 23, 2022

This is already the case: https://github.com/syssi/esphome-zb-gw03/blob/main/packages/button_pairing_mode.yaml#L21-L31

If you press the button of the device the pairing mode is triggered. On difference: There is no LED attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants