espressif/arduino-esp32

Implement Zigbee in Arduino

P-R-O-C-H-Y opened this issue ยท 107 comments

Related area

Create an API for Zigbee within Arduino

Hardware specification

ESP32-C6 and ESP32-H2 as Standalone Nodes. Other SoC can be used as radio co-processor attached to a RPC (802.15.4 radio layer).

Is your feature request related to a problem?

This is an issue to track the progress of developing Zigbee library, a new API for Arduino.

Describe the solution you'd like

Initial tasks:

Zigbee library (wrapper) tasks:

  • Create Zigbee classes and implement all Zigbee roles
  • Implement Zigbee network scanning
  • Allow multiple endpoints on same Zigbee device (test needed)
  • Implement basic HA devices (lights, switches, sensors, etc..)
    • On/off light + switch
    • Color Dimmable light + switch
    • Temperature sensor + Thermostat
  • Implement setting Manufacturer and model name
  • Update ported examples to use the Zigbee Library
  • Documentation (will be handled in separate PR)

PR: #10265

Good to have features:

  • Zigbee identify handling (user can for example blink LED of EP) -> comment
  • Zigbee sleepy device
  • Power source/battery level info

more tasks will be added while in progress.
Development branch

Describe alternatives you've considered

No other usable Zigbee wrapper around.

Additional context

Related issues:
#8807 #9156 #9962 #9480

I have checked existing list of Feature requests and the Contribution Guide

  • I confirm I have checked existing list of Feature requests and Contribution Guide.
elgerg commented

Hi, love the work so far. I'm so excited to get this running. It looks like it's going to be the next best thing since sliced bread!

Are there any intentions to add power source/battery level into the config?

If mains powered could it act as a router as well or is that too much for a H2? Maybe ok for the C6..

Many thanks and appreciate the hard work!

Dev update 12/08/2024 pushed to the dev branch:

  • Implemented Factory reset of Zigbee device, in order to connect to new network without reflashing/erasing flash
  • Implemented optional setting for Manufacturer and Model names
  • Added option to allow endpoint to have multiple endpoint connected -> switch - 2 lights (tested)
  • Implemented easy transfer from device it to Device type (0x0000 = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID -> "General On/Off switch".
  • Minor sketches update
elgerg commented

Oh wow, that looks amazing! So easy, I'm going to love this. Thanks!

Hi, love the work so far. I'm so excited to get this running. It looks like it's going to be the next best thing since sliced bread!

Are there any intentions to add power source/battery level into the config?

If mains powered could it act as a router as well or is that too much for a H2? Maybe ok for the C6..

Many thanks and appreciate the hard work!

Thank you for your feedback ๐Ÿ‘ I really appreciate it.

About the power source/baterry level I will add it on the list as good to have, so I will look after having the main part done :)

Dev Update 14/08/2024 pushed to dev branch:

  • Implemented Color Dimmable Light and Colour Dimmer Switch endpoints, working in RGB colour space (automatically convert to/from XYZ).
  • Added examples: Zigbee_Color_Dimmable_Light, Zigbee_Color_Dimmer_Switch
  • Printing of bound devices (endpoints)
  • Minor code updates
elgerg commented

Nice,
Any chance you can take a look at adding temp sensor and light sensor?
They are the 2 I'm most eager to try, I'm currently using the temp sensor and it works great (even if the code is way difficult to understand).
Thanks!

Nice, Any chance you can take a look at adding temp sensor and light sensor? They are the 2 I'm most eager to try, I'm currently using the temp sensor and it works great (even if the code is way difficult to understand). Thanks!

@elgerg The temperature sensor + thermostat are on the list of upcoming tasks.
The light sensor device type is not present in the list in esp32-zigbee-sdk, it should have value 0x106, which is not present.
Can you open a feature request to the esp-zigbee-sdk repository please? Seems that the main part is already there which contains all the clusters and attributes for luminance sensor.

Edit: found your issue you opened. Added a comment.

elgerg commented

Thanks for adding to espressif/esp-zigbee-sdk#401
I'm quite excited about being able to create my own Temp/Lumin Zigbee sensors :D
Thanks for the continued effort!

elgerg commented

Hi @P-R-O-C-H-Y

Any chance I can add this to the "Nice to have" list?

In the current Temp sensor version there is an identify cluster (?) added:

    esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(&(temperature_sensor->identify_cfg)), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE)

Any chance you can add something like that to the list so we can blink an LED when triggered? No idea how to do that at the moment..

Thanks!

Hi @P-R-O-C-H-Y

Any chance I can add this to the "Nice to have" list?

In the current Temp sensor version there is an identify cluster (?) added:

    esp_zb_cluster_list_add_identify_cluster(cluster_list, esp_zb_identify_cluster_create(&(temperature_sensor->identify_cfg)), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE)

Any chance you can add something like that to the list so we can blink an LED when triggered? No idea how to do that at the moment..

Thanks!

Hi @elgerg,

Can you explain a bit more? I am not sure if I got it correctly.
What would be "Nice to have"? Option to customise identify cluster? I don't also get the LED blink.

elgerg commented

Hi @P-R-O-C-H-Y
I should have been more specific.

If you have a look at this:
image

There is an identify button. In theory this should allow for the device to identify itself by blinking an LED or something when the button is pressed so you can figure out which device is which.

This article explains really well on what identify is:
https://medium.com/@omaslyuchenko/hello-zigbee-part-22-identify-cluster-90cf12680306

So what would be good to have is a simple way of using this just like you are doing with the rest of the wrapper.

Does that make a little more sense?

Thanks

Hi @P-R-O-C-H-Y I should have been more specific.

If you have a look at this: image

There is an identify button. In theory this should allow for the device to identify itself by blinking an LED or something when the button is pressed so you can figure out which device is which.

This article explains really well on what identify is: https://medium.com/@omaslyuchenko/hello-zigbee-part-22-identify-cluster-90cf12680306

So what would be good to have is a simple way of using this just like you are doing with the rest of the wrapper.

Does that make a little more sense?

Thanks

Thanks for explaining. That can be really helpful. Adding it to the list :)

elgerg commented

Excellent. Thanks :)

Dev Update 16/08/2024 pushed to dev branch:

  • Implemented Zigbee network scanning (mostly match WiFi scan API)
  • Added Zigbee_Network_Scan example
elgerg commented

If you're taking requests I'd also like to implement some kind of way of getting the current time from the coordinator to display on a screen. Do you know if it's possible to get the time into some sort of callback?

Thanks :)

If you're taking requests I'd also like to implement some kind of way of getting the current time from the coordinator to display on a screen. Do you know if it's possible to get the time into some sort of callback?

Thanks :)

@elgerg Do you have any example of this feature?

Dev Update 28/08/2024 pushed to dev branch:

  • Implemented Temperature sensor and Thermostat endpoints.
  • Added examples: Zigbee_Temperature_Sensor, Zigbee_Thermostat
  • Implemented configure report handler.
  • Updated READMEs and description of examples.
  • Minor code updates
elgerg commented

If you're taking requests I'd also like to implement some kind of way of getting the current time from the coordinator to display on a screen. Do you know if it's possible to get the time into some sort of callback?
Thanks :)

@elgerg Do you have any example of this feature?

How is this?
zigpy/zigpy#1162
Thanks

elgerg commented

Dev Update 28/08/2024 pushed to dev branch:

  • Implemented Temperature sensor and Thermostat endpoints.
  • Added examples: Zigbee_Temperature_Sensor, Zigbee_Thermostat
  • Implemented configure report handler.
  • Updated READMEs and description of examples.
  • Minor code updates

This looks awesome!

Do you know when it'll end up in the next release?
Thanks ๐Ÿ™

Hedda commented

@P-R-O-C-H-Y Tip; here is a other Arduino library for creating Zigbee Home Automation devices (with links to some examples):

Dev Update 28/08/2024 pushed to dev branch:

  • Implemented Temperature sensor and Thermostat endpoints.
  • Added examples: Zigbee_Temperature_Sensor, Zigbee_Thermostat
  • Implemented configure report handler.
  • Updated READMEs and description of examples.
  • Minor code updates

This looks awesome!

Do you know when it'll end up in the next release?

Thanks ๐Ÿ™

I am doing the best that the first version can be released soon.