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

Zigbee/Thread support on the new upcoming ESP32-H2 variant? #1397

Open
levihb opened this issue Sep 3, 2021 · 79 comments
Open

Zigbee/Thread support on the new upcoming ESP32-H2 variant? #1397

levihb opened this issue Sep 3, 2021 · 79 comments
Labels
enhancement New feature or request

Comments

@levihb
Copy link

levihb commented Sep 3, 2021

Describe the problem you have/What new integration you would like

A new variant of the ESP32 was announced last month, the ESP32-H2. It supports 802.15.4 and therefore Zigbee and Thread, as well as BLE, and now runs on a RISC-V architecture which should be a lot more efficient. It also still supports WiFi.

This looks super interesting because it will finally give home users a way to easily build Zigbee/Thread versions instead of WiFi ones. I think ESPHome supporting this would be a brilliant step forward.

Please describe your use case for this integration and alternatives you've tried:

There are no alternatives to ESPHome for Zigbee as far as I know? Or really any simple development environments for home users.

Additional context

Of course the H2 isn't out yet. But I think it'd be good to get a discussion on this going before it is released. Zigbee is definitely a lot more friendly to larger home installations in many ways.

Support for battery operated end Zigbee devices would also be a huge leap forward. And I would think that should be possible on the new H2.

@rradar rradar added the enhancement New feature or request label Sep 4, 2021
@oxan
Copy link
Member

oxan commented Sep 6, 2021

The big open question here is whether some group will port a Zigbee stack to the H2, as that's likely a too big task to do for ESPHome by itself.

@levihb
Copy link
Author

levihb commented Sep 20, 2021

The big open question here is whether some group will port a Zigbee stack to the H2, as that's likely a too big task to do for ESPHome by itself.

I asked on the ESP forums. Looks like they haven't released any information publicly yet.

But there will be an OpenThread implementation available. What about potential support for that?

@levihb
Copy link
Author

levihb commented Sep 25, 2021

@oxan Excellent news. They have confirmed that there will be a Zigbee stack available!

Hopefully this means we can have a Zigbee ESPHome.

@DelusionalAI
Copy link

With thread being IP based, would it be possible to connect it to a ESPHome thread device to a thread-border router and then control it over existing tools like MQTT and the Esphome API?
I believe the only "issue" would be that Thread is IPv6 only, which is being worked on

Controlling my devices over the existing APIs but without worrying about wifi would be amazing, and then you wouldn't be limited to the zigbee protocols.

@oxan
Copy link
Member

oxan commented Jan 11, 2022

I looked a tiny bit into this, and getting the API to run on Thread seems like it'll be fairly straighforward. Once devices start becoming available that's probably something we'll work to support.

As for Zigbee, examples using the Z-Boss 3.0 stack have started appearing in the IDF repository last week, so I bet that's what they're going with. There's actually an example of how to use an ESP as a lightbulb. It doesn't seem like it'll be too hard to integrate that into ESPHome as well, in case anyone is interested. I'm happy to help people implementing this, but probably won't work on it myself.

@Drizzt321
Copy link

Really interested in this myself! Would love to create a few battery sipping things for myself, particularly Zigbee 3.0.

@Hedda
Copy link

Hedda commented Feb 21, 2022

With thread being IP based, would it be possible to connect it to a ESPHome thread device to a thread-border router and then control it over existing tools like MQTT and the Esphome AP

That could indeed be possible if Espressif releases a documented CLI or open API for Zigbee NCP or a Zigbee SDK for RCP, and that is something that Tasmota already feature support for but only for Silicon Labs EZSP and Texas Instruments ZNP, see: https://tasmota.github.io/docs/Zigbee/

There is by the way a related similar request here for Silabs EZSP (EmberZNet Serial Protocol) -> #681

There is also a separate request for just pass-through serial stream server (ser2net tunnel) support for Zigbee MCU here -> #688

@kaystrobach
Copy link

Related?

https://community.home-assistant.io/t/announcement-esphome-running-on-adafruit-52840-over-thread-mesh-networking-using-zephyrrtos/363712

@HarvsG
Copy link

HarvsG commented Mar 27, 2022

I would very happy to contribute to the esphome team getting an engineering sample ASAP (if it is a matter of $) - Apparently espressif are hoping to get them out in May 2022 according to this reddit post

@Hedda
Copy link

Hedda commented Mar 28, 2022

Espressif now looks to have released ESP ZBOSS 3.0 binary libraries supporting the Zboss Zigbee 3.0 stack for ESP32 series chips:

https://components.espressif.com/component/espressif/esp-zboss-lib

https://www.esp32.com/viewtopic.php?t=24624

FYI, Espressif has joined "ZBOSS Open Initiative (ZOI)" so chances are they will base is Zigbee stack on ZOI's ZBOSS stack by DRS:

https://dsr-iot.com/news/78

https://www.prweb.com/releases/espressif_joins_zboss_open_initiative_zoi_a_community_for_royalty_free_zigbee_pro_stack_software/prweb18263163.htm

ZOI (ZBOSS Open Initiative) ZBOSS stack look to be available as royalty-free for ZOI members like but not as open source code:

https://dsr-zoi.com/frequently-asked-questions/

https://www.prweb.com/releases/announcing_launch_of_zboss_open_initiative_zoi_for_royalty_free_zigbee_pro_stack_software/prweb16814352.htm

https://dsr-zboss.com/#!/updates/dsr-joins-cmgc-partnership-s2link

All support for it will need be handled though Espressif as implementer and not directly to ZOI or DRS.

There now also looks to be Zigbee examples in Espressif’s IoT Development Framework (ESP-IDF) but no news on SDK or docs?

https://components.espressif.com/component/espressif/esp-zboss-lib

ESP ZBOSS 3.0 Libraries

This repository contains binary libraries supporting the Zboss Zigbee 3.0 stack for ESP32 series chips.

Packages from this repository are uploaded to Espressif’s component serivce. You can add them to your project via idf.py add-dependency

More information about idf-component-manager can be found in Espressif API guide or PyPi registry.

There now looks to be some Zigbee examples in Espressif’s IoT Development Framework (ESP-IDF):

https://components.espressif.com/component/espressif/esp-zboss-lib

https://www.espressif.com/en/products/sdks/esp-idf

https://github.com/espressif/esp-idf

https://github.com/espressif/esp-idf/tree/master/examples/zigbee

Those examples include; Zigbee coordinator ("light coordinator"), "Zigbee RCP (radio co-processor"), and "Zigbee gateway":

https://github.com/espressif/esp-idf/tree/master/examples/zigbee/light_sample/light_coordinator

"light_coordinator is a light coordinator example demonstrating Zigbee Coordinator role. It provides a formation of the Zigbee network. It runs on an 802.15.4 SoC like ESP32-H2. For more details to see the example readme file."

https://github.com/espressif/esp-idf/tree/master/examples/zigbee/esp_zigbee_rcp

https://github.com/espressif/esp-idf/tree/master/examples/zigbee/esp_zigbee_gateway

Wondering if "RPC" works similar to Silicon Labs RPC which works like a dumb radio requiring external ESP ZBOSS 3.0 libraries?

https://components.espressif.com/component/espressif/esp-zboss-lib

"This test code shows how to configure Zigbee rcp (radio co-processor) device. Rcp doesn't function alone, it needs to work together with Zigbee gateway (see esp_zigbee_gateway example)"

"After rcp starts up, it will send its own MAC ieee address and Zigbee stack version number to the Zigbee gateway and start working together with Zigbee gateway via UART communication"

ESP32-H2 has apparently now also already been certified as a “Zigbee Compliant Platform” by CSA:

https://www.espressif.com/en/news/ESP32-H2_Thread_and_Zigbee_certified

https://www.espressif.com/sites/default/files/ESP32-H2%20Zigbee%20Compliant%20Platform%20Certification.pdf

Type of Device: Zigbee Compliant Platform
Zigbee PRO Feature Set (2017)
Manufacturer: Espressif Systems (Shanghai) Co., Ltd.
Model Identification: ESP32-H2
Firmware Version: V1.0
Hardware Version: V1.0
Certification Date: October 20, 2021
Certification ID Number: ZIG21030ZCP27315-24

PS: ESP32-H2 has also passed "Thread Certified Component” certification and will surely also be prioritizing Matter certification:

https://youtu.be/bS9Ch7k_GK0

PPS: They also say Espressif’s IoT Development Framework (ESP-IDF) feature a Thread SDK and that OpenThread is now supported:

https://github.com/espressif/esp-idf/tree/master/examples/openthread

@HarvsG
Copy link

HarvsG commented Mar 29, 2022

@Hedda thanks for that information dump. Could I be bold and ask what the implications for esphome are? Sounds like many of the software stacks are already quite mature. Do you think that the team have enough to work with or do they need the SDK first?

@Hedda
Copy link

Hedda commented Sep 27, 2022

FYI, ESP-IDF (Espressif IoT Development Framework) look to now have posted an OpenThread RCP (Radio Co-Processor) example:

https://github.com/espressif/esp-idf/tree/master/examples/openthread/ot_rcp

I think that is needed for ESPHome to support OpenThread and Matter over Thread on ESP32-H2 with its IEEE 802.15.4 radio?

https://www.espressif.com/en/news/ESP32_H2

At least if that could be built so firmware provides OpenThread RCP (Radio Co-Processor) mode with SPI interface over the Spinel protocol (spinel+hdlc+uart serial protocol) and tunnel that serial stream to agners OTBR addon (OpenThread Border Router add-on via OpenThread adapter in RCP mode) from Home Assistant addons-development repository for testing Thread/Matter support inside Home Assistant:

https://community.home-assistant.io/t/chip-matter-support-including-thread/305633/88

https://github.com/home-assistant/addons-development/tree/master/openthread_border_router

https://github.com/openthread/ot-br-posix/

https://openthread.io/platforms/co-processor

https://github.com/agners

https://community.home-assistant.io/u/agners/summary

Matter upstream SDK also has support for ESP32 (but not sure if that is only over WiFi?):

https://github.com/project-chip/connectedhomeip/tree/master/examples/lighting-app/esp32

The main reason for OpenThread RCP (Radio Co-Processor) support in an "RPC" firmware with OTBR (OpenThread Border Router) support will make ESP32-H2 with its IEEE 802.15.4 radio compatible with the upcoming Thread stack / IEEE 802.15.4 radio based "Matter" (Project CHIP / Connected Home over IP) devices if used in Home Assistant with their other add-ons for the that is also in development. That addon by agners requires that the IEEE 802.15.4 radio have a OpenThread firmware in "RPC" mode instead of the no traditional "NCP" mode of OpenThread stack running on the IEEE 802.15.4 radio:

https://github.com/home-assistant/addons-development/tree/master/chip_controller_repl

https://github.com/home-assistant/addons-development/tree/master/chip_tool

https://github.com/project-chip/connectedhomeip

https://buildwithmatter.com

https://csa-iot.org/all-solutions/matter/

Also having optional OpenThread "NCP" border router firmware would allow users to alternatively use other existing OpenThread applications that use "NCP" mode instead of the newer "RPC" mode which require additional component running on the host. Ex:

https://github.com/openthread/wpantund

Note that as far as I read so far agners has only worked with Silicon Labs based adapter with OpenThread "RPC" firmware for Thread / EEE 802.15.4 radio based Matter (as well as ESP32-C3 based devkit for Matter over WiFi) and that is only because it is a Silabs EFR32MG21 chip based adapter that will ship inside the official Home Assistant Yellow (formerly Home Assistant Amber) hardware as well as the upcoming official Home Assistant SkyConnect USB Stick dongle:

zigpy/zigpy#894

https://github.com/home-assistant/addons-development/tree/master/silabs-multiprotocol

https://www.home-assistant.io/blog/2021/09/13/home-assistant-yellow/

https://www.crowdsupply.com/nabu-casa/home-assistant-yellow

https://community.home-assistant.io/t/home-assistant-skyconnect-usb-stick-announced-will-be-compatible-with-both-zigbee-and-thread-including-matter-chip-over-thread/433594

@Hedda
Copy link

Hedda commented Sep 27, 2022

FYI, see they now also released ESP ZBOSS 3.0 binary libraries (esp_zboss_lib) to support Zboss Zigbee 3.0 stack on chips like ESP32-H2:

https://github.com/espressif/esp-zboss-lib

Again that could be used with their "ESP" Zigbee RPC + Gateway examples with their ESP32-H2 DevKitC (ESP32-H2-DevKitC-1 V2.1) board:

https://github.com/espressif/esp-idf/tree/master/examples/zigbee/

https://github.com/espressif/esp-idf/blob/master/examples/zigbee/esp_zigbee_rcp

https://github.com/espressif/esp-idf/tree/master/examples/zigbee/esp_zigbee_gateway

Home Assistant's ZHA integration would need a ZBOSS (e.g. zigpy-zboss) radio library to be able to use it as a remote Zigbee Coordinator in serial pass-through mode.

https://www.home-assistant.io/integrations/zha

https://github.com/zigpy/zigpy

Compatible zigpy radio libraries

  • Texas Instruments based Zigbee radios with all compatible Z-Stack firmware via the zigpy-znp library for zigpy.
  • Silicon Labs (EmberZNet) based Zigbee radios using the EZSP protocol via the bellows library for zigpy.
  • dresden elektronik deCONZ based Zigbee radios via the zigpy-deconz library for zigpy.
  • ZiGate based ZigBee radios via the zigpy-zigate library for zigpy.
  • Digi XBee based Zigbee radios via the zigpy-xbee library for zigpy.

@Hedda
Copy link

Hedda commented Jan 31, 2023

ESP32-C6 SoC, module and development board has now been launched with WiFi 6, BLE 5.0, and 802.15.4, ink. OpenThread and Zigbee! ...so think these could be perfect for ESPHome as either a Thread Board Router (for Matter) or as a Zigbee Router device.

https://www.espressif.com.cn/en/news/ESP32-C6_Available

https://espressif-docs.readthedocs-hosted.com/projects/espressif-esp-dev-kits/en/latest/esp32c6/esp32-c6-devkitc-1/index.html

espressif/esp-idf#10423

Espressif launched the ESP32-C6 WiFi 6, Bluetooth 5.0 LE, and 802.15.4 IoT microcontroller by making the ESP32-C6-WROOM-1 module:

https://www.cnx-software.com/2021/04/11/esp32-c6-wifi-6-and-bluetooth-le-risc-v-soc-for-iot-devices/

image

image

Espressif Systems has finally launched the ESP32-C6 WiFi 6, Bluetooth 5.0 LE, and 802.15.4 IoT microcontroller by making the ESP32-C6-WROOM-1 module available on Aliexpress for $14.25 for a pack of 5 modules as well as the ESP32-C6-DevKitC-1 development board that’s out of stock on the official store at the time of writing. but somehow listed in another store for $16.22 plus shipping.

Besides the availability announcement, another surprise is the 802.15.4 radio for Zigbee and Thread that was not part of the original ESP32-C6 announcement in April 2021. The ESP32-C6-DevKitC-1 development board comes with a module with 8MB flash, exposes most of the I/O’s from the ESP32-C3, and comes with two USB-C ports, two buttons, and an RGB LED.

ESP32-C6-DevKitC-1 development board specifications:

  • Wireless module – ESP32-C6-WROOM-1 with
    • ESP32-C6 single-core 32-bit RISC-V clocked up to 160 MHz 320KB ROM, 512KB SRAM, low-power RISC-V core @ up to 20 MHz
    • Wireless – 2.4 GHz WiFi 6, Bluetooth 5.0 LE, 802.15.4 radio for Zigbee 3.0 and Thread. Matter compatible. PCB antenna
      8MB SPI flash
  • USB – 1x USB Type-C host port, 1x USB Type-C port via UART console
  • I/Os – 2x 16-pin headers with GPIO, UART, SPI, ADC, SDIO, USB, I2S, etc…
  • Misc – Reset and BOOT buttons, RGB LED, J5 header/jumper for current measurement
  • Power Supply (mutually exclusive options)
    • 5V via USB-UART port (recommended)
    • 5V and GND pin headers
    • 3V3 and GND pin headers
  • Dimensions – 51.8 x ~20 mm

image

image

The new ESP32-C6 module and development board work with the ESP-IDF v5.1, currently under development (see progress report), and some basic documentation can be found on read the docs.

If you can’t purchase an ESP32-C6 module or board just yet due to limited supplies, don’t despair as more are coming very soon as Espressif tells us to expect more products on Adafruit, Akizuki, Digikey, and Mouser.

@MiguelAngelLV
Copy link

The C6 board can be a perfect board for esphome. Wifi, BLE, Zigbee and Thread in only one board!

@Hedda
Copy link

Hedda commented Feb 18, 2023

The C6 board can be a perfect board for esphome. Wifi, BLE, Zigbee and Thread in only one board!

Well almost. I understand Zigbee and Thread are currently mutually exclusive, so can not use Zigbee and Thread at the same time.

At least it should allow having many separate ESPHome-based devices with different functions utilizing either Thread or Zigbee.

  • "WiFi to Thread Board Router" device as an OpenThread Border Router (OTBR) managed by ESPHome.
  • "Zigbee Router" device as a Zigbee repeater/extender managed by ESPHome.
  • "Zigbee End Device" device as a Zigbee sensor that can be managed by ESPHome.
  • "Zigbee Coordinator", ei.. a dumb remote radio adapter for Home Assistant's ZHA integration (requires radio library in zigpy).
  • "Zigbee Gateway" native bridge device (like the Zigbee 2 Tasmota project).

I especially think that ESPHome devices could be perfect as a "Thread Board Router" (for Matter) or as a "Zigbee Router" device.

@linkedupbits
Copy link

I am starting to work on at least getting native esphome support for the esp32-c6-DevKitC-1.
I have created a pull request to add support to espressive's esptool-js for this board - this library is used by esp-web-tools to flash the board.
I have successfuly uploaded a zigbee espressive sample firmware to the esp32-c6-DevKitC-1 via my local build of esptool-js (but binaries built via esp-idf).
Then I a local tar.gz of the esp-web-tools library, and dropped it into my local esp-web-tools , and was able to connect to the serial log output, but not able to upload a firmware built by ESPHome.

Where would I find an esp-idf project file for any of the "standard" new device firmwares eg esphome-web-esp32c3.bin or esphome-web-esp32s2.bin for bootstrapping into ESPHOme?
I could then adapt this to build a base new device firmware for this board.

@Hedda
Copy link

Hedda commented Mar 20, 2023

Where would I find an esp-idf project file for any of the "standard" new device firmwares eg esphome-web-esp32c3.bin or esphome-web-esp32s2.bin for bootstrapping into ESPHOme?

Probably best if you start a new dedicated issue for that question

https://github.com/esphome/feature-requests/

https://github.com/esphome/esp-web-tools/

https://esphome.github.io/esp-web-tools/

https://web.esphome.io/

@rotilho
Copy link

rotilho commented Mar 20, 2023

I am starting to work on at least getting native esphome support for the esp32-c6-DevKitC-1.
I have created a pull request to add support to espressive's esptool-js for this board - this library is used by esp-web-tools to flash the board.
I have successfuly uploaded a zigbee espressive sample firmware to the esp32-c6-DevKitC-1 via my local build of esptool-js (but binaries built via esp-idf).
Then I a local tar.gz of the esp-web-tools library, and dropped it into my local esp-web-tools , and was able to connect to the serial log output, but not able to upload a firmware built by ESPHome.

Where would I find an esp-idf project file for any of the "standard" new device firmwares eg esphome-web-esp32c3.bin or esphome-web-esp32s2.bin for bootstrapping into ESPHOme?
I could then adapt this to build a base new device firmware for this board.

You may be interested in this fork. @stintel managed to flash a C6.

https://github.com/stintel/esphome/tree/esp32c6

@Hedda
Copy link

Hedda commented Apr 5, 2023

FYI, 01Space is sell a tiny ESP32-C6 IoT dev board based on ESP32-C6-WROOM-1 wireless module with two 10-pin headers + USB-C for power:

https://www.aliexpress.us/item/3256805225446433.html

image

ESP32-C6 Arduino support will require ESP IDF 5.1 framework which is still under development:

espressif/arduino-esp32#7713

espressif/arduino-esp32#7852

@sandervandegeijn
Copy link

  • ZHA integration

Don't forget zigbee2mqtt, this is one of the most mature solutions when it comes to interface with zigbeestuff through mqtt :)

@Hedda
Copy link

Hedda commented Apr 17, 2023

Don't forget zigbee2mqtt

Zigbee2MQTT support is off-topic here as zboss adapter (esp-zboss) support would have to be implemented into the zigbee-herdsman library it depends on and that has nothing to do with ESPHome or Home Assistant, so you would instead have to post a request there instead -> https://github.com/Koenkk/zigbee-herdsman

@Hedda
Copy link

Hedda commented May 10, 2023

Espressif now looks to have released ESP ZBOSS 3.0 binary libraries supporting the Zboss Zigbee 3.0 stack for ESP32 series chips

FYI, indirectly related; you can now use a Nordic Semi nRF52840 dongle as a Zigbee Coordinator inside ZHA via zigpy-zboss:

https://github.com/kardia-as/zigpy-zboss

This ZBOSS radio library for zigpy is unofficial and still experimental so testers need to manually it to ZHA in Home Assistant:

zigpy/zigpy#394

That should for now at least make it usable to use either nRF52840 USB dongle or nRF52840 dev kits with the correct firmware.

https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dongle

nRF52840 Dongle only costs about $10 USD so great value for people looking to test Zigbee. nRF52840 DK cost about $60 USD:

https://www.nordicsemi.com/Products/Development-hardware/nrf52840-dk

Perhaps more interesting for ESPHome developers is that if and when this zigpy-zboss library gets developed further then it could possibly enable users to use an ESP32-C6 (or ESP32-H2) module with ESPHome as a remote Zigbee Coordinator adapter for ZHA.

https://www.home-assistant.io/integrations/zha

@wombat70
Copy link

Espressif announced their ESP Thread BR dev platform:
https://www.hackster.io/news/espressif-launches-a-kit-to-turn-its-esp32-modules-into-certified-thread-border-routers-for-matter-c61db0fce050

@Hedda
Copy link

Hedda commented Jun 20, 2023

Espressif announced their ESP Thread BR dev platform:
https://www.hackster.io/news/espressif-launches-a-kit-to-turn-its-esp32-modules-into-certified-thread-border-routers-for-matter-c61db0fce050

Nice! That is a new ESP32-H2 + ESP32-C3 combo development board kit and ESP Thread Boarder Router SDK which as been certified as a Thread Border Router (TBR) / OpenThread Border Router (OTBR) which can be used for Matter based on the Thread 1.3 standard, alternatively be used as an as Zigbee gateway/hub or bridge, and they also got an optional Ethernet Sub-Board

https://www.cnx-software.com/2023/06/20/espressif-esp-thread-border-router-board-combines-esp32-h2-esp32-c3-wireless-chips/

https://github.com/espressif/esp-thread-br

https://docs.espressif.com/projects/esp-thread-br/en/latest/esp32/

https://www.aliexpress.us/item/1005005688193617.html

PS: An earlier two-board ESP Thread Border Router solution was previously available as an example project for reference:

https://github.com/espressif/esp-idf/tree/master/examples/openthread/ot_br

https://openthread.io/guides/border-router/espressif-esp32

image

and optional Optional Ethernet Sub Board

image

@luar123
Copy link

luar123 commented Mar 25, 2024

I have created a simple esphome example of a zigbee sensor:
https://github.com/luar123/esphome_zb_sensor

The zigbee part is currently hard-coded and included as a custom component including a task. Changing this to an external component with more configuration possibilities would be the next step.

@lboue
Copy link

lboue commented Apr 8, 2024

@Hedda
We are still awaiting approval of this PR: Add support for ESP32-H2 and ESP32-C2 #1347 because ESPHome is based on this package.

See this ESP32 Platform for platform_version variable.

Perhaps it's possible to compile ESPHome manually with this PR's patches.

@Hedda
Copy link

Hedda commented Apr 15, 2024

FYI, upcoming ESP32-H4 and ESP32-C5 MCU SoC models announced with 802.15.4 radio for Thread and/or Zigbee (+ Bluetooth).

  • The existing ESP32-H2 is a single-core CPU model with 802.15.4 radio and no WiFi.
  • The new ESP32-H4 is a dual-core CPU model with 802.15.4 radio and no WiFi, plus optional support for PSRAM.
  • The new ESP32-C5 is a single-core CPU model with 802.15.4 radio and WiFi.
  • The existing ESP32-C6 is a dual-core CPU model with 802.15.4 radio and WiFi , plus optional support for PSRAM.

image

As I understand, these should in the future eventually all be fully supported by the ESP-IDF framework as well as the ESP-Zigbee-SDK and ESP-Matter-SDK to add more flexibility in choice of model options.

PS: Also announced is the new ESP32-P4 which a very powerful high-performance MCU SoC without any radios at all, so it is designed to act as a general purpose host MCU that in combination with above SoC to make a 2-SoC solution with Ethernet PHY (like for example a Zigbee Gateway).

https://www.cnx-software.com/2022/09/13/esp-hosted-helps-adds-wifi-connectivity-to-legacy-linux-or-mcu-based-products/

https://docs.espressif.com/projects/esp-at/en/latest/esp32/Get_Started/What_is_ESP-AT.html

@Hedda
Copy link

Hedda commented May 21, 2024

I've started porting esphome to nRF52840 a few weeks ago esphome/esphome#6075. It can be used with nrf-sdk which has some zigbee examples https://github.com/nrfconnect/sdk-nrf/tree/main/samples/zigbee. I've not looked in zigbee details. Maybe someone would be interested though.

It looks like tomaszduda23 work on basic support for nRF52840 for ESPHome progressing very nicely and just yesterday he marked his pull request as ready for review and testing by developers (or advanced testers if can help with code reviewing):

FYI, I started an end-user discussion about his nRF52840 development in Home Assistant's community forum to not spam here:

https://community.home-assistant.io/t/fyi-a-developer-has-begun-porting-esphome-to-a-nrf5-platform-for-nrf52840/683997

Note! That is only indirectly related to this because a nRF5 (nRF52 and nRF53) platform could also support Thread and Zigbee.

@xttlegendapi
Copy link

Hello everyone! It would be really cool if we can have esphome communication over zigbee with the new esp32 variants like H2 and C6.

@xttlegendapi
Copy link

I want to donate 50 eur to the person(s) that can get this working (with most components working and working with home assistant)

@Sunsurfer89
Copy link

I want to donate 50 eur to the person(s) that can get this working (with most components working and working with home assistant)

+50 €

@haplm
Copy link

haplm commented May 27, 2024

Interesting concept :-). +20€

@bo0tzz
Copy link

bo0tzz commented May 27, 2024

Bounties are generally a somewhat dangerous concept (see https://ondsel.com/blog/software-bounties-are-a-dumb-idea/ for a great writeup), so I would argue caution here.

That said, if the esphome maintainers are on board with a bounty being set and can coordinate it to prevent duplicate effort, I would like to add €50 as well.

@Hedda
Copy link

Hedda commented May 27, 2024

Bounties are generally a somewhat dangerous concept (see https://ondsel.com/blog/software-bounties-are-a-dumb-idea/ for a great writeup), so I would argue caution here.

I agree that trying to crowdfound open-source bounties in advance is generally a bad idea, better to donate to developers that are already contributing code/projects to the community. Regardless a funding campaign for open-source bounties does not belong here under issues on GitHub as it will just spam everyone until they be forced to close issue ruining for everyone else so it would be much appriciated if you guys wanting to fund such bounty efforts would do so on a different platform, just not here.

@Sunsurfer89
Copy link

I believe that @xttlegendapi had a positive mindset while posting, and juat wanted to emphasize the wish of the community to have Zigbee in ESPhome.

Yeah, maybe a bounty campaign is not the right mean, especially not in an Git issue, as @Hedda said. So yeah, let's stop that bounty topic here.

Nevertheless, if there is a way to incent for those development activities, I appreciate and support any centralized and coordinated campaign if it helps. 'Cause I have the same dream of having my own zigbee devices in future.

@micfogas
Copy link

Just want to chime in that I have all of these boards and was working on it, but real life took a priority and I haven't had a chance to get back into it yet. I'll be in court soon as the Plaintiff as well, and self representing, so it's eating a lot of time. If I have time and the urge, I'll get back into it sooner.

I definitely want to, and ESP-IDF seems to provide a good solid framework, but I believe that is the main part before much of anything else can happen. It's a new SDK for the newer devices, and it's a different structure as well.

There's a few ways to approach this but the most logical would be to select either IDF or legacy PlatformIO when creating a project. Due to things having to be done a different way, we'll have to create a middle layer framework (I'm not 100% sure that all the current integrations can be translated equally, which bring us to...) or port each integration.

There's definitely going to be some new features that can be integrated over time, but I think any full IDF implementation for the newer ESP32's will be experimental for quite a while.

If I can remember, I'll get back to tearing through the docs during toilet time instead of doom scrolling X 😂

Here's a page with some information about the structural differences that most people posting here should be able to follow, at least enough to get the idea. PlatformIo: ESP-IDF Structure

@Hedda
Copy link

Hedda commented May 31, 2024

FYI, Espressif released "stable" version 3.0.0 Arduino ESP32 Core based on ESP-IDF v5.1.4 with support for ESP32-H2 and ESP32-C6

https://github.com/espressif/arduino-esp32/releases/tag/3.0.0

(Arduino ESP32 core v3.0.0 was first announced over 7-months ago but this updated version is now finally been marked as stable).

However, we still need PlatformIO to add Arduino v3.0.0 support for it in platform-espressif32 too which might never happen?

There is already an open pull request but PlatformIO is refusing to merge it and claim that Espressif's lack of support is at fault:

Short term the only workaround for that drama is to fork platform-espressif32 from platformio and apply that patch yourself.

So for now all can do is report non-PlatformIO problems and feature requests related to ESP32-H2/ESP32-C6 as new issues here:

https://github.com/espressif/arduino-esp32/issues/

PS: Espressif has still not created a Arduino wrapper library on top of the Zigbee SDK, they are however at least providing libraries:

espressif/esp-zigbee-sdk#228

@P-R-O-C-H-Y
Copy link

Hello @Hedda and all others,

I just want to inform you all that I am now investigating/working on a wrapper for Zigbee to make it simple to use in Arduino. For now we have provided Zigbee libraries + 4 ported IDF examples, which are huge and not that easy to use for someone new to Zigbee.

The wrapper is still in early stage of development, when there are news or some draft, I will keep you updated and link the PR here in a comment :)

@MiguelAngelLV
Copy link

Hello @Hedda and all others,

I just want to inform you all that I am now investigating/working on a wrapper for Zigbee to make it simple to use in Arduino. For now we have provided Zigbee libraries + 4 ported IDF examples, which are huge and not that easy to use for someone new to Zigbee.

The wrapper is still in early stage of development, when there are news or some draft, I will keep you updated and link the PR here in a comment :)

With a few simples examples (light, switch...) anyone could be create a custom component for EspHome 👍

@Hedda
Copy link

Hedda commented May 31, 2024

FYI, also noticed their Zigbee examples in the arduino-esp32 repository looks updated to work with the latest libraires, check out:

https://github.com/espressif/arduino-esp32/tree/master/libraries/ESP32/examples/Zigbee

For reference, those exampled seems to have been cherry-picked and synchronized from a few of the esp-zigbee-sdk examples:

https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/

PS: For more simple Zigbee examples check out this directory for "Zigbee HA" profiles (ZHA profile specs) in the esp-zigbee-sdk:

https://github.com/espressif/esp-zigbee-sdk/tree/main/examples/esp_zigbee_HA_sample

@luar123
Copy link

luar123 commented Jun 8, 2024

Here is the first version of the external component: https://github.com/luar123/zigbee_esphome
For now support is limited to sensor/actor end devices and the whole zigbee structure needs to be defined in the yaml. Lambdas are used for setting or receiving attribute changes.

@P-R-O-C-H-Y: Also have a look at https://github.com/Muk911/esphome/blob/main/esp32c6/hello-zigbee

I want to donate 50 eur to the person(s) that can get this working (with most components working and working with home assistant)

To make this just work without any additional setup (like mqtt/HA api) there is a lot of work needed. For simple sensors or e.g. lights where we have support from default zigbee clusters it should be rather simple. But to support all types of components also custom clusters needs to be defined and integrated into the coordinator software (z2m, ZHA, etc).

@micfogas
Copy link

micfogas commented Jun 8, 2024

Here is the first version of the external component:

I haven't looked at your code yet but nice job creating something.

This made me realize an important detail though, which I think Jesse will have to answer on. Should efforts still be made to implement zigbee on this new hardware, or would time be better spent on creating the components for the Thread layer and Matter layer?

Obviously, the ESP32-H2, TBRG, and the thread-capable dev boards like the C6, will need the thread sublayer component. Matter can work over WiFi, Ethernet, Thread... Jesse is probably aware of the HA efforts with Matter (I haven't had time to keep up on it myself), and Matter will be able to replace the API (eventually ....).

Jesse would really be the one to comment about his plans and direction regarding Matter. With a Matter-compatible backend (whether he plans to add another layer under the API to translate to Matter, create a separate project that will use ESPHone yaml on the front end and Matter on the back end, or just ignore Matter). There's not much point in the Thread sublayer if there's no plans to use Matter.

Maybe it's best to find out what his plans are.

@Hedda
Copy link

Hedda commented Jun 8, 2024

Here is the first version of the external component: https://github.com/luar123/zigbee_esphome For now support is limited to sensor/actor end devices and the whole zigbee structure needs to be defined in the yaml. Lambdas are used for setting or receiving attribute changes.

@P-R-O-C-H-Y: Also have a look at https://github.com/Muk911/esphome/blob/main/esp32c6/hello-zigbee

@luar123 @Muk911 also check out Zigbee PoC for ESPHome on nRF52/nRF53 by @tomaszduda23 in tomaszduda23/esphome#2

What does this implement/fix?

zigbee support

Screenshot from 2024-06-05 21-12-08

Types of changes

Related issue or feature (if applicable): fixes esphome/feature-requests#1397

Example entry for config.yaml:

switch:
  - platform: zigbee
    output: gpio_15
    id: zigbee1
  - platform: zigbee
    output: gpio_15
    id: zigbee2

@tomaszduda23
Copy link

esphome is based on just only 17 different entity types. You could cover a lot of use cases with just those.

3.14.2 Analog Input (Basic)
3.14.3 Analog Output (Basic)
3.14.5 Binary Input (Basic)
3.14.6 Binary Output (Basic)

There is Description and ApplicationType which could be used to distinguish different entities. Probably it would be good enough for most people.

Matter sounds cool. It requires IPv6 though. If there is IPv6 you could also just use native API.

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

No branches or pull requests