espressif / arduino-esp32

Arduino core for the ESP32
GNU Lesser General Public License v2.1
13.31k stars 7.35k forks source link

Implement Zigbee in Arduino #10135

Open P-R-O-C-H-Y opened 1 month ago

P-R-O-C-H-Y commented 1 month ago

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:

PR: https://github.com/espressif/arduino-esp32/pull/10265

Good to have features:

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

elgerg commented 1 month ago

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!

P-R-O-C-H-Y commented 1 month ago

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

elgerg commented 1 month ago

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

P-R-O-C-H-Y commented 1 month ago

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 :)

P-R-O-C-H-Y commented 1 month ago

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

elgerg commented 1 month ago

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!

P-R-O-C-H-Y commented 1 month ago

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 1 month ago

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

elgerg commented 1 month ago

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!

P-R-O-C-H-Y commented 4 weeks ago

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 4 weeks ago

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

P-R-O-C-H-Y commented 4 weeks ago

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 4 weeks ago

Excellent. Thanks :)

P-R-O-C-H-Y commented 4 weeks ago

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

elgerg commented 3 weeks ago

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 :)

P-R-O-C-H-Y commented 2 weeks ago

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?

P-R-O-C-H-Y commented 2 weeks ago

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

elgerg commented 2 weeks ago

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? https://github.com/zigpy/zigpy/discussions/1162 Thanks

elgerg commented 2 weeks ago

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 1 week ago

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

P-R-O-C-H-Y commented 1 week ago

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.