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

Implement Zigbee in Arduino #10135

Open
13 of 17 tasks
P-R-O-C-H-Y opened this issue Aug 9, 2024 · 21 comments
Open
13 of 17 tasks

Implement Zigbee in Arduino #10135

P-R-O-C-H-Y opened this issue Aug 9, 2024 · 21 comments
Assignees
Labels
Area: Libraries Issue is related to Library support. Status: In Progress Issue is in progress Type: Feature request Feature request for Arduino ESP32
Milestone

Comments

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

P-R-O-C-H-Y commented Aug 9, 2024

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)

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.
@P-R-O-C-H-Y P-R-O-C-H-Y added Type: Feature request Feature request for Arduino ESP32 Area: Libraries Issue is related to Library support. labels Aug 9, 2024
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Aug 9, 2024
@elgerg
Copy link

elgerg commented Aug 9, 2024

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
Copy link
Member Author

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
Copy link

elgerg commented Aug 12, 2024

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

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

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
Copy link
Member Author

P-R-O-C-H-Y commented Aug 14, 2024

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
Copy link

elgerg commented Aug 14, 2024

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
Copy link
Member Author

P-R-O-C-H-Y commented Aug 14, 2024

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
Copy link

elgerg commented Aug 14, 2024

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
Copy link

elgerg commented Aug 15, 2024

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
Copy link
Member Author

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
Copy link

elgerg commented Aug 16, 2024

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
Copy link
Member Author

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
Copy link

elgerg commented Aug 16, 2024

Excellent. Thanks :)

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

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

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

@elgerg
Copy link

elgerg commented Aug 18, 2024

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
Copy link
Member Author

P-R-O-C-H-Y commented Aug 28, 2024

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
Copy link
Member Author

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
Copy link

elgerg commented Aug 28, 2024

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
Copy link

elgerg commented Aug 28, 2024

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 🙏

@VojtechBartoska VojtechBartoska added the Status: In Progress Issue is in progress label Sep 2, 2024
@VojtechBartoska VojtechBartoska added this to the 3.2.0 milestone Sep 2, 2024
@VojtechBartoska VojtechBartoska pinned this issue Sep 2, 2024
@Hedda
Copy link

Hedda commented Sep 2, 2024

@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
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Libraries Issue is related to Library support. Status: In Progress Issue is in progress Type: Feature request Feature request for Arduino ESP32
Projects
Status: In Progress
Development

No branches or pull requests

4 participants