1technophile / OpenMQTTGateway

MQTT gateway for ESP8266 or ESP32 with bidirectional 433mhz/315mhz/868mhz, Infrared communications, BLE, Bluetooth, beacons detection, mi flora, mi jia, LYWSD02, LYWSD03MMC, Mi Scale, TPMS, BBQ thermometer compatibility & LoRa.
https://docs.openmqttgateway.com
GNU General Public License v3.0
3.5k stars 776 forks source link

Feature Request: Zigbee Support #205

Open jwillmer opened 6 years ago

jwillmer commented 6 years ago

Zigbee is becoming the de facto standard in home automation. It would be great if OpenMQTTGateway could support this protocol. Below I have a write up about the most promising solution at the moment. I think with some work it would be possible to write an interface for the serial communication of the CC253X hardware.

There is a zigbee2mqtt bridge for Raspberry Pi already. It is using zigbee-shepherd that runs on node.js. It all is build around the CC253X USB stick. The cc-znp library offers a firmware for serial communication with the Zigbee chip. A good explanation about the hardware setup can be found zigbee2mqtt wiki.

Additional references:

hihp commented 5 years ago

Any plans on this? I am currently looking into extending my little home automation setup at home, and I would really love to have a ESP8266- or Arduino-based MQTT bridge linking all non-Wifi devices to a Home Assistant instance, so Zigbee support in MQTT would be perfect.

I actually would be willing to pay money for this, as in setting a substantial bounty for this to be implemented. if necessary via a platform like Gitcoin or so.

I think that indeed, a TI chip would be easiest - something like the CC2530. There are pretty cheap to get even in a module that includes an actual antenna (search via Google for "CC2530 module"), and using the Z-Stack by TI seem to be farely straightforward to use:

https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/158/t/218226

One can even flash a CC2530 without the CCDebugger, using an Arduino or even an ESP8266:

https://koenkk.github.io/zigbee2mqtt/information/alternative_flashing_methods.html

1technophile commented 5 years ago

Surely zigbee will be an ultimate feature for OMG. Thanks for proposing support it is appreciated. At this time I don't know yet how I will go into this. For the next release 0.9.1 I will concentrate on Lora and autodiscovery features. Once this is stable zigbee will be an excellent candidate for the next steps.

snovotill commented 5 years ago

I see the Nordic nRF52 chips such as nRF52840 support ZigBee, BLE5 and Thread. The new TI chips CC2652R, CC1352R, CC1352P also. The Nordic also have built-in USB, while the TI support sub-GHz radio.

podarok commented 4 years ago

I guess instead of copying what zigbee2mgtt does would be cool to merge effort on building gateway framework that merge zigbee2mgtt and OMG all together

james-fry commented 4 years ago

This is a really interesting idea. I found this thread since I recently purchased a TI cc1352p based board for zigbee2mqtt but I am really interested by the sub-1GHz (inc 433 and 868 mhz) of this chipset and wondered on the possibility of OMG type capability in parallel with Z2M. It has the possibility to be an absolutely killer home automation hub.

1technophile commented 4 years ago

I recently purchased a TI cc1352p based board for zigbee2mqtt but I am really interested by the sub-1GHz (inc 433 and 868 mhz)

It seems an interesting board, Could you share a link to the board you bought?

james-fry commented 4 years ago

Sure. I bought this board: http://www.ti.com/tool/LAUNCHXL-CC1352P

It’s about $50 + tax

There are two versions of the board with different RF tuning for either 2.4ghz or sub 1ghz. I purchased the P-2 version which is more suited for 2.4 for zigbee. That’s said both boards will operate with both bands.

Support for this chipset was only added for zigbee2mqtt in the past week. There is an active github issue thread if you are interested: https://github.com/Koenkk/zigbee2mqtt/issues/1429

Gamester17 commented 4 years ago

FYI, Tasmota firmware for ESP8266 recently added bridge support for Zigbee via TI CC2530 chip that is flashed with a custom Texas Instruments Z-Stack firmware from Zigbee2mqtt project by Koenkk

https://tasmota.github.io/docs/#/Zigbee

Z2T (Zigbee to Tasmota) concept allows you to make your own Zigbee to WiFi bridge

https://www.cnx-software.com/2019/12/23/tasmota-open-source-firmware-now-supports-zigbee-connectivity/

"Basically all you need is ESP82xx hardware connected to a Texas Instruments C2530 based Zigbee device over a serial. Note that C2531 based device won’t work since they are connected over USB. Normally, C2530 firmware is flashed through CC Debugger tool, but in this case, you don’t need to purchase extra hardware since Z-Stack firmware flashing can be performed through any ESP8266 board running CCLib instead. Once it’s done flash Zigbee2Tasmota Tasmota firmware to your ESP82xx board or device, and you need to configure the system for communication between the Zigbee module and ESP8266. This is all explained in detail in the documentation."

wimpie007 commented 4 years ago

integrating Z2T in home assistant is difficult and involves lots of custom translating stuff for the moment. PITA.

Hedda commented 4 years ago

FYI, Itead has just launched Sonoff ZBBridge as an inexpensive Sonoff Zigbee Bridge (which is somewhat based on a similar concept/idea as the product that they have in their Sonoff RF Bridge)

This new Sonoff ZBBridge (and their existing Sonoff RF Bridge) uses ESP8266 ("ESP8266EX") for WiFi and bridge/gateway/controller software, so the main difference is that they use different types of MCU for the RF radio module part.

According to the teardown on notenoughtech.com it sounds as if it the new Sonoff ZBBridge is based on Silicon Labs EFR32 (Mighty Gecko) for Zigbee 3.0 radio module support

Please consider porting OpenMQTTGateway to the new Sonoff Zigbee Bridge (Sonoff ZBBridge).

As you probably already know, Tasmota does something similar with Zigbee2Tasmota (Z2T) but by connecting an ESP8266 to a Texas Instrument CC2530 module instead however it too is using a serial communication protocol, see:

https://tasmota.github.io/docs/Zigbee/

EZSP (EmberZNet Serial Protocol) interface that Silicon Labs uses is also well documented and already used by open source projects, see example Home Assistant's ZHA integration component via zigpy and bellows:

Z Smart System also has a Java device driver for Ember based serial dongles (among other dongles):

For reference, Z Smart System also has a sniffer library written in Java which uses same serial interface:

Hedda commented 4 years ago

One workaround for Home Assistant users could be to simply present a Zigbee radio module as a remote adapter to Home Assistant's ZHA (their Zigbee Home Automation integration component)?

You could use something like ser2net to allow ZHA to remote connect to it via serial over network, like:

Then you need a radio library for zigpy that works with the serial protocol used. For example with that Sonoff ZBBridge you would need a zigpy radio library for EZSP protocol used by Silicon Labs EFR32

Hopefully, their bellows radio library should already be compatible or could be made to be if updated

zigpy devs already do something similar to connect remotely with ESP8266 based "ZiGate Pack WiFi"

As proof-of-concept you could do this with a CC2530 remote to zigpy-cc from a ESP8266 using ser2net

https://github.com/zigpy/zigpy-cc

wimpie007 commented 4 years ago

"As proof-of-concept you could do this with a CC2530 remote to zigpy-cc from a ESP8266 using ser2net" I use a esp8266 with CC2530 already to connect to a zigbee2mqtt instance. Espeasy with serial server. Works like a treat.

wimpie007 commented 4 years ago

the new chipset seems promising!! (range!)

Hedda commented 4 years ago

Do you think that you could maybe use the serial bridge from esp-link for a serial forwarding feature?

Hedda commented 4 years ago

oxan might have a "stream server" solution for ESPHome firmware in https://github.com/esphome/feature-requests/issues/660

1technophile commented 4 years ago

The best way could be to share a common arduino zigbee driver on all these projects, I have some zigbee devices around and a CC2530, this will be the occasion to play in the next months

Hedda commented 4 years ago

@1technophile problem with that is that there are so many different Zigbee modules

Maybe better to port zigpy and its radio libraries or would that be overkill?

1technophile commented 4 years ago

If we cover the CC2530 on an ESP you don't think it would be sufficient?

james-fry commented 4 years ago

The zigbee2mqtt project is beginning to move away from the cc2530. The cc2530 is a low power (CPU) device and has limitations as a zigbee coordinator.

1technophile commented 4 years ago

The zigbee2mqtt project is beginning to move away from the cc2530. The cc2530 is a low power (CPU) device and has limitations as a zigbee coordinator.

Thanks, good to know.

What would be the ideal component in your point of view?

Hedda commented 4 years ago

As james-fry wrote; Zigbee2mqtt is long moving towards more powerful Zigbee 3.0 compatible radio modules with support for CC2652, a.k.a CC26X2R1 (CC2652P, CC2652R, and CC2652RB chips) and CC1352 (CC1352P chips), but more importantly to consider is that even Zigbee2mqtt is now also moving towards hardware-independent support, with support for ConBee, ConBee II, and RaspBee support now already available in Zigbee2mqtt.

It would also not work on Sonoff ZBBridge as I requested because it contains a Silicon Labs EFR32MG21 Zigbee 3.0 radio module support. EFR32MG21 is one of the latest chip in EFR32 Gecko Series 2 MCU

Regardless, zigpy has radio libraries to support for all of those mentioned radio modules and more.

Hedda commented 4 years ago

For details, you need to check out this thread https://github.com/Koenkk/zigbee2mqtt/issues/1429

Guys there recommend different CC1352 and CC2652 based modules if you have to choose one today.

Again, Sonoff ZBBridge is a prepackaged product at less than $17 so will be hard to beat that price

james-fry commented 4 years ago

The CC1352P-2 is I think especially interesting for omg as it can also do sub 1ghz as well a 2.4ghz (zigbee)

Hedda commented 4 years ago

I also believe that those sub 1GHz modules do not do two or more frequencies at the same time(?) as I believe that you set it to one specific frequency (like 2.4GHz, 915MHz or 868MHz, 315MHz or 433MHz) to use it(?)

Are sub 1GHz even used by any Zigbee application profiles part of the Zigbee 3.0 spec in any case?

https://www.unifore.net/home-alarm-system/introduction-to-zigbee-3-0-zigbee-ha-protocol.html

Or is sub 1GHz only used by Zigbee application profiles that are not part of the Zigbee 3.0 spec?

Hedda commented 4 years ago

Anyway, the CC2652P looks like the best chip based on chip specification, with CC2652R and CC2652RB chips having the second-best chip specifications, however, CC1352P based modules are much more readily available today.

Both CC1352P and CC2652P/CC2652R/CC2652RB chips can be bought directly to TI but there appear not to be any complete CC2652 based modules available yet, while there already are already CC1352P modules available from example Ebyte.

http://www.ebyte.com/en/product-view-news.aspx?id=766

Search for article: "E79-400DM2005S" on sites like eBay or Aliexpress to find Ebyte CC1352P module.

Again, CC1352 and CC2652 just users a newer version of the same serial protocol and command set as the CC253x series of chips, so if you get it working on either C1352 or CC2652 then it should not be too much work updating the solution to work on all.

See zigpy-znp https://github.com/zha-ng/zigpy-znp and zigpy-cc https://github.com/zigpy/zigpy-cc

Hedda commented 4 years ago

To get the equivalent SMD module from Silicon Labs then might want to look at EFR32MG1B Series 1.

Ebyte's E180-ZG120A and E180-ZG120B are Zigbee 3.0 module based on EFR32MG1B SoC:

EFR32MG1B Series 1 is a 20dbm powerful Zigbee 3.0 radio capable SoC / chip in Silicon Labs EFR32 family which I understand also used the Ember / EZSP interface so could be made compatible with zipy's bellows radio library if flashed with the right firmware? So I guess main question is which exact firmware to use?

E180-ZG120B (and the previous E180-ZG120A) modules are sold on eBay and Aliexpress at low prices.

Example:

Ebyte also have this inexpensive development board called "E180-ZG120B-TB" based on that module:

This development is sold for less than $9 US-dollar on Aliexpress or about twice that on eBay UK:

Looks like you can just remove some jumpers to disable the USB converter to use the serial directly.

Again see bellows for zigpy's Silicon Labs library https://github.com/zigpy/bellows

Hedda commented 4 years ago

Almost any ESP8266 development board (like a NodeMCU or a Wemos D1 Mini) with a Silicon Labs EFR32MG based Zigbee module like the Ebyte E180-ZG120B would just about be about the equivalent to having a hacked Sonoff ZBBridge, so such a setup could be used as a development environment.

The downside to using such setup instead of Sonoff ZBBridge is that the E180-ZG120B module will likely not come preloaded with firmware so have to build EmberZNet PRO Zigbee Stack firmware with coordinator device type config and flash firmware to the E180-ZG120B module first.

See a longer discussion about building Silabs EmberZNet firmware here -> https://github.com/xoseperez/espurna/issues/2224

Hedda commented 4 years ago

FYI @SillyDay don't own a E180-ZG120B but has tried to build a firmware for it as per discussion here:

https://github.com/Koenkk/zigbee-herdsman/issues/168

SillyDay GitHub repo for EFR32 firmware:

https://github.com/SillyDay/EFR32

Hedda commented 4 years ago

FYI, as per related request https://github.com/zigpy/zigpy/issues/405 I just learned that there is an existing ESP8266-based networked-attached Zigbee-adapter called "ZiGate Pack WiFi adapter" which has a new v2.0 firmware that archives this requested function of UART-to-TCP/IP (for Serial-port to WiFi-bridge function) using "ESP-LINK from Jeelab" software, in addition, using ESP-LINK also adds mDNS zeroconf to allow automatic network discovery and configuration:

Description of functions that using ESP-LINK will add to v2.0 firmware for ZiGate Pack WiFi adapter:

https://translate.google.com/translate?sl=fr&tl=en&u=https%3A%2F%2Fzigate.fr%2Fdocumentation%2Fdescription-du-firmware-v2-xx%2F

As I understand it, all ZiGate hardware look to be modular in design and the "ZiGate Pack WiFi adapter" is really just an optional ESP8266 based "dumb" UART-to-TCP/IP (for Serial-port to WiFi-bridge function) for the standard "ZiGate TTL adapter" that allows users to connect to it remotely using TCP/IP over your home LAN (Local Area Network) instead of plugging it directly to your computer via the optional USB adapter.

Specifically, please see the picture of "ZiGate Pack WiFi adapter" https://zigate.fr/produit/zigate-pack-wifi-v1-3/ compared to the picture of "ZiGate TTL USB adapter" https://zigate.fr/produit/zigate-ttl/

Thus "ZiGate Pack WiFi adapter" allows ZHA users to have a networked Zigbee adapter setup like this:

ZHA <–> zigpy/zigpy-zigate <–> TCP/IP over LAN <–> ZiGate-WiFi <–> UART <–> ZiGate Radio

Suggesting this now as I just learned from @doudz there that the new v2.0 version of the ZiGate Pack WiFi adapter firmware contains "ESP-LINK from Jeelab" software which among other things adds mDNS and UART WiFi Bridge support over TCP. As I understand, version v1.x of the firmware for the ZiGate Pack WiFi adapter basically only contained a simple UART/serial-port server forwarding service ( serial server software that just acts as a dumb Zigbee to WiFi bridge for zigpy-zigate), while the new version v2.x also has more advanced features (which does not need to used) it still also contain a simple UART/serial-port server forwarding service, but now mDNS also makes it easier to discover the adapter on your local network.

Now it would be awesome if the ZHA integration component for Home Assistant from an end-user perspective supported just as an easy detection and configuration of network networked-attached Zigbee coordinator adapters, like the Sonoff ZBBridge and the ZiGate Pack WiFi adapter.

I would therefore also suggest using some kind of Zero-configuration networking (zeroconf) method, like for example mDNS, (as mDNS is already in use in Home Assistant Core), to make the ZHA integration component for Home Assistant automatically detect, connect, and configure compatible networked-attached Zigbee coordinator adapters like the "ZiGate Pack WiFi adapter" as that is otherwise already supported by the zigpy-zigate radio library for zigpy.

Hedda commented 4 years ago

FYI, @s-hadinger has now got a Sonoff ZBBridge and started reviewing the board in it (for Tasmota)

First signs it is the EFR32 Zigbee module it has inside it has EmberZNet / Ember based firmware.

1technophile commented 4 years ago

Thanks for the info!

Hedda commented 4 years ago

There is now also a deep dive follow-up discussion here in parallel about hacking or flashing its EFR32:

Hedda commented 4 years ago

FYI; @s-hadinger is making great progress hacking the Zigbee module in Sonoff ZBBridge for Tasmota:

@mtx512 has now built a custom EZSP NCP firmware for the EFR32 module inside Sonoff ZBBridge:

Interestingly @s-hadinger also added a TCP serial bridge to Tasmota firmware for remote access:

Description:

Add a new feature: Serial to TCP bridge (similar to esp-link). This allows to remotely communicate to a MCU through ESP8266. Needs #define USE_TCP_BRIDGE

It adds 2 GPIO types: TCP Tx (208) and TCP Rx (209) and can work with hardware or software serial.

Commands:

  • TCPBaudRate <x>: sets the baudrate for serial (only 8N1 mode), min 1200, max 115200 by 1200 increments.
  • TCPStart <port>: listens to port <port>. This features supports 2 parallel TCP connexions, which can be useful if you need a terminal + a specific protocol (like XMODEM). The 3rd connection will disconnect an previous connection. The number of parallel connections is a compile-time option.
  • TCPStart 0 or TCPStart: shuts down the TCP server and disconnects any existing connection.

For security reasons, the TCP bridge is not started at boot, and requires an explicit TCPStart command (can be automated with Rules).

Hedda commented 4 years ago

FYI, Silicon Labs recently just released a less expensive "EFR32xG22 Wireless Gecko Starter Kit" (SLWSTK6021A) development kit for $99 which only contain one mainboard/development board and a couple of EFR32MG22 modules which are low-power Zigbee Green Power compatible Mightly Gecko Series 2 radios.

https://www.silabs.com/products/development-tools/wireless/efr32xg22-wireless-starter-kit

While the EFR32MG22 low-power radios it comes with are not really usable as Zigbee coordinators, for $99 that kit can be very useful to developers since it jas been confirmed that buying that kit also gives full official access to Silicon Labs Zigbee Stack, Zigbee SDK, and libraries (current, future, and old versions).

Hedda commented 4 years ago

FYI, Silicon Labs recently just released a less expensive "EFR32xG22 Wireless Gecko Starter Kit" (SLWSTK6021A) development kit for $99 which only contain one mainboard/development board and a couple of EFR32MG22 modules which are low-power Zigbee Green Power compatible Mightly Gecko Series 2 radios.

https://www.silabs.com/products/development-tools/wireless/efr32xg22-wireless-starter-kit

While the EFR32MG22 low-power radios it comes with are not really usable as Zigbee coordinators, for $99 that kit can be very useful to developers since it has been confirmed that buying that kit also gives full official access to Silicon Labs Zigbee Stack, Zigbee SDK, and libraries (current, future, and old versions).

Those who are interested in that official $99 SLWSTK6021A started kit might also be interested in buying article SLWRB4180A for around $49 at the same time as that is the matching EFR32MG21 based high-power (+20 dBm) radio board for that dev board kit.

https://www.silabs.com/products/development-tools/wireless/slwrb4180a-efr32-wireless-gecko-radio-board

(Google search shows that SLWRB4180A can be bought from many of resellers globally who also stock the SLWSTK6021A kit).

Hedda commented 4 years ago

FYI, @s-hadinger has after the last pull request posted saying that he now feels Tasmota ready for testing of EZSP v8 interface:

https://github.com/arendst/Tasmota/issues/8583

https://github.com/arendst/Tasmota/pull/8839

Not for everyone yet since still need to flash its EFR32 chip with some type of J-Link Debug Probe (might always be required?).

Hedda commented 3 years ago

Any further thoughts on Sonoff ZBBridge support now that this is fully supported and already very stable feature in Tasmota?

https://github.com/arendst/Tasmota/issues/8583

https://github.com/arendst/Tasmota/pulls?q=EZSP

That Sonoff ZBBridge is inexpensive but contain great Zigbee hardware with potential for different types of Zigbee controller uses, as inside it has an ESP8266 WiFi SoC/MCU connected via UART to a very powerful Silicon Labs EFR32MG2 (Mighty Gecko Series 2) Zigbee SoC/MCU on the same board.

https://sonoff.tech/product/smart-home-security/zbbridge

Tasmota allows using its ser2net like TCP serial-server inside ESP8266 firmware to take direct control of the Zigbee chip that it is connected to via UART/serial and then connect to Zigbee devices without any further involvement on Tasmota (which via its TCP serial-server only will only act as a dumb pass-through WiFi-to-serial bridge without any knowledge of what the data traffic that is going back and forth between the remote Zigbee chip AND different home automation software like example Home Assistant).

You can even make your own DIY WiFi bridge with an ESP8266 board + an ICC-A-1 module torn out of an IKEA Tradfri device:

https://github.com/MattWestb/IKEA-TRADFRI-ICC-A-1-Module

Example with ZHA integration component in Home Assistant which add native support for Zigbee adapters, including the ZBBridge:

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

Sure, it could have been even greater with ESP32 but still geat ESP8266 hardware with Silabs EFR32 MG2 Zigbee coordinator!

1technophile commented 3 years ago

It would be an interesting addition to OMG, but maybe the best way would be to externalize it into a Zigbee library. This way it will benefit the different projects (OMG, ESPurna, ESPEasy, ESPHome...).

Hedda commented 3 years ago

It would be an interesting addition to OMG, but maybe the best way would be to externalize it into a Zigbee library. This way it will benefit the different projects (OMG, ESPurna, ESPEasy, ESPHome...).

zigpy and its radio libraries are externalized for use over serial-port via any pass-through serial-bridge if that is what you mean?

https://github.com/zigpy/zigpy/

Or do you mean splitting all the Zigbee code parts out on Zigbee2Tasmota (Z2T) into an Arduino library which could be reused?

https://tasmota.github.io/docs/Zigbee/

As I understand it, the Zigbee2Tasmota (Z2T) solution is very large, especially compared to to only providing a TCP serial-server.

1technophile commented 3 years ago

Or do you mean splitting all the Zigbee code parts out on Zigbee2Tasmota (Z2T) into an Arduino library which could be reused?

Exactly. This way it could be used by other projects.

Hedda commented 3 years ago

Or do you mean splitting all the Zigbee code parts out on Zigbee2Tasmota (Z2T) into an Arduino library which could be reused?

Exactly. This way it could be used by other projects.

What I know is that whole Zigbee bridge code in Zigbee2Tasmota (Z2T) is large and very resource-intensive for a ESP8266 MCU, and that why they now provide a separate dedicated tasmota-zbbridge firmware for that where they disable other stuff not needed for Zigbee bridge. ESP32 would be better for such Zigbee bridge functions: https://tasmota.github.io/docs/Zigbee/

The whole Zigbee bridge code is not needed though to only provide a stable TCP serial-server (similar to ser2net) to enable transparent pass-through function over IP for https://www.digiblur.com/2020/07/how-to-use-sonoff-zigbee-bridge-with.html

jwillmer commented 3 years ago

Cool project @clubbit but what does it have to do with this task? Feels like attention spam 👎

1technophile commented 3 years ago

Thanks @jwillmer, link removed

Hedda commented 3 years ago

FYI, HW tip now is to instead use Tube's Zigbee Gateways open-source hardware by @tube0013 (which is tested with ESPHome).

It is based on WT32-ETH01 ESP32 board from Wireless-Tag which also has wired Ethernet.

He designed two variants; one has a Silicon Labs EFR32 Series 2 module and one that has a Texas Instruments CC2652P module.

https://github.com/tube0013/tube_gateways

https://github.com/zigpy/zigpy/discussions/584

https://www.tubeszb.com/shop/coordinators/2

image

image

1technophile commented 3 years ago

He designed two variants; one has a Silicon Labs EFR32 Series 2 module and one that has a Texas Instruments CC2652P module.

If I want to target the best module for adding Zigbee to OMG, what could be the one between these 2 or another module?

Hedda commented 3 years ago

If I want to target the best module for adding Zigbee to OMG, what could be the one between these 2 or another module?

Guess that best would probably be if you could get some informal advice about their API/CLI protocols from @s-hadinger as he has experience of both since he implemented ZNP (TI Z-Stack) and EZSP (Silabs EmberZNet) support in Tasmota Z2T (Zigbee2Tasmota):

https://tasmota.github.io/docs/Zigbee/

https://github.com/arendst/Tasmota/pulls?q=s-hadinger

If only look at availability of dev-tools + modules available to buy then Texas Instruments CC2652P and/or CC1352P are best today:

https://www.szrfstar.com/product/list-196-en.html

https://www.ebyte.com/en/product-view-news.aspx?id=766

https://www.ebyte.com/en/product-view-news.html?id=1002

Silabs require buying their official starter kit to get access to firmware SDK + availability of EFR32MG21 modules is currently low:

https://www.silabs.com/development-tools/wireless/efr32xg22-wireless-starter-kit

https://www.silabs.com/development-tools/wireless/slwrb4180b-efr32xg21-wireless-gecko-radio-board

https://github.com/zigpy/zigpy/discussions/586

But low available of EFR32MG21 modules might not be a factor if could figure out to utilize the new ITead Zigbee 3.0 Dongle(?):

https://www.itead.cc/zigbee-3-0-usb-dongle.html

The older EFR32MG12 is another option available and it is even possible to extract such modules from any IKEA Trådfri device:

https://www.ebyte.com/en/product-view-news.html?id=842

https://github.com/MattWestb/IKEA-TRADFRI-ICC-A-1-Module

Texas Instruments currently also have more open source tools for things like firmware flashing + NVRAM backup and restore:

https://github.com/JelmerT/cc2538-bsl

https://github.com/zigpy/open-coordinator-backup

https://github.com/zigpy/zigpy-znp/blob/dev/TOOLS.md#backup-and-restore

https://github.com/zigpy/zigpy-znp

I don't know about Texas Instruments ZNP serial protocol but if you want to offer an EZSP serial-server bridge option in OpenMQTTGateway to enable Zigbee-to-IP then know that really want to use Ethernet and not WiFi to get a stable connection.

https://github.com/zigpy/bellows#warning-about-zigbee-to-wifi-bridges

PS: I believe @tube0013 and @grobasoz (who both make DIY gateway hardware) mention they prefer TI CC chips, tools, FW, APIs?

Hedda commented 3 years ago

CC1352 is more expensive but allow Sub-1 GHz frequencies used by Zigbee Smart Energy (ZSE) profile which isn't part of Zigbee 3.0

https://www.ebyte.com/en/product-view-news.aspx?id=766

https://www.szrfstar.com/product/235-en.html

https://www.szrfstar.com/product/188-en.html

Zigbee Smart Energy is the world standard used by electricity, water, and gas meters that all utility companies install in your house.

https://zigbeealliance.org/solution/smart-energy/

https://zigbeealliance.org/wp-content/uploads/2019/11/docs-07-5356-19-0zse-zigbee-smart-energy-profile-specification.pdf

https://training.ti.com/overview-zigbee-smart-energy-internet-things

https://www.ti.com/lit/slaa467

https://www.ti.com/lit/pdf/tidu213

https://www.ti.com/lit/pdf/swra467

https://www.nxp.com/pages/jn516x-zigbee-smart-energy:ZIGBEE-SMART-ENERGY

https://www.nxp.com/docs/en/supporting-information/MAXSECZBNETART.pdf

"Zigbee Smart Energy (Zigbee SE) is the world's leading standard for interoperable wireless products that monitor, control and automate the delivery and use of energy (and other resources, such as water). A wireless network is implemented at the consumer's premises using the ZigBee PRO protocol with the Smart Energy application profile. This Home Area Network (HAN) contains devices such as a Metering Device, In-Premise Display (IPD) and Load Control Device, and is connected to the energy provider using an Energy Service Interface (ESI) via a backhaul network."

PS: Note that Z-Stack 3 and SE share ZCL cluster library but the encryption of Z-Stack 3.0 and SE profiles are different:

https://e2e.ti.com/support/wireless-connectivity/zigbee-and-thread/f/zigbee-thread-forum/661416/cc2538-using-smart-energy-devices-in-z-stack-3-0

Hedda commented 3 years ago

It would be an interesting addition to OMG, but maybe the best way would be to externalize it into a Zigbee library. This way it will benefit the different projects (OMG, ESPurna, ESPEasy, ESPHome...).

Or do you mean splitting all the Zigbee code parts out on Zigbee2Tasmota (Z2T) into an Arduino library which could be reused?

Exactly. This way it could be used by other projects.

@1technophile might interested in today's related discussion between @Barracuda09 and @TD-er c in https://github.com/letscontrolit/ESPEasy/issues/3021

Hedda commented 2 years ago

FYI, thegroove made a simple to use Serial-to-IP bridge appliance firmware for Sonoff Zigbee Bridge running ESPHome firmware:

https://github.com/thegroove/esphome-zbbridge

oxan and thegroove also look to have made two alternative serial server code component solutions for ESPHome firmware:

https://github.com/oxan/esphome-stream-server

https://github.com/thegroove/esphome-serial-server

thegroove even made an experimental version with Zeroconf support for automatic network discovery by ZHA in Home Assistant:

https://github.com/thegroove/esphome-zha-ezsp-zeroconf

https://www.home-assistant.io/integrations/zha/#discovery-via-usb-or-zeroconf

Note that Zigbee2MQTT is another popular alternative to Home Assistant's ZHA for use with this type of Serial-to-IP bridge:

https://www.digiblur.com/2021/03/zigbee2mqtt-with-sonoff-zigbee-bridge.html

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

Hedda commented 2 years ago

FYI, ZB-GW03 eWeLink Ethernet Zigbee Gateway is based on an ESP32 and Silabs EFR32 Zigbee and has been hacked with Tasmota.

https://github.com/arendst/Tasmota/discussions/12764

ZB-GW03 has been hacked with Tasmota32 and look to support the same Tasmota and Silabs firmware as ITead Sonoff ZBBridge, however since the ZB-GW03 has wired Ethernet port instead of WiFi it should be a better option compared to ITead Sonoff ZBBridge.

https://templates.blakadder.com/ewelink_ZB-GW03

image

image

image

ZB-GW03 v1.0 and ZB-GW03-V1.2 is apparently sold rebranded under many names, including SmartWise and EACHEN brands:

https://ewelink.eachen.cc/product/eachen-ewelink-zigbee-bridge-pro-zbbridge-pro/

https://ewelinkcommunity.net/device-lists/zigbee/eachen-zb-gw03/

https://www.okosabbotthon.hu/smartwise-zigbee-bridge-pro

https://www.amazon.de/APP-Fernbedienung-Sprachsteuerung-Funktioniert-Verbindung-Smart-Produkten/dp/B094JKVLNR/

image

image

Looks like is it is based on the same "SM-011 V1.0" module by CoolKit as ITead uses in their Sonoff ZBBridge Zigbee Bridge:

https://github.com/zigpy/zigpy/discussions/586

https://github.com/xsp1989/zigbeeFirmware/

https://www.coolkit.cn/product/sm-011/

https://github.com/CoolKit-Technologies/DevDocs/tree/master/Zigbee

https://github.com/CoolKit-Technologies/DevDocs/blob/master/Zigbee/SM-011%E5%BA%94%E7%94%A8%E6%8C%87%E5%AF%BC%E4%B9%A6.md

https://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fgithub.com%2FCoolKit-Technologies%2FDevDocs%2Fblob%2Fmaster%2FZigbee%2FSM-011%E5%BA%94%E7%94%A8%E6%8C%87%E5%AF%BC%E4%B9%A6.md