-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Need Multiple light examples for HA on off light #10240
Comments
Hi @sonirohit3, I am now working on the Zigbee library for ESP Arduino. Follow issue #10135 for more details. |
Hi Prochy, Thanks for the information. I will keep track of this. It would be really nice if somehow, I can get the sample code for multiple endpoints early. I have the hardware ready. Regards, |
FIY: Those deleted comments have been from some bot with suspicious content. |
Hi @P-R-O-C-H-Y , |
@sonirohit3 Can you please format the code in the comment so its readable? Thanks |
Certainly! Edited my previous comment and attached the INO file in compressed zip. I am also trying to see how a fan type device can be implemented in this. The device has rotary encoder which can we used to increase / decrease fan speed. Any suggestion on this? |
Hi @P-R-O-C-H-Y , Any suggestion on above? Please suggest how to modify the light bulb example code to add a switch and send back the updated status to HA when toggled. |
Hi @sonirohit3, you will need to set the attribute value using
For more info take a look here |
Hi @sonirohit3, you may want to try the Zigbee Library as the multiple lights should work and the code will be much easier for you. You can start with this example and extend it with multiple light with unique endpoint numbers. If you need any help with this let me know there and feel free to reopen the issue. I am closing it as I have tested that and it was working fine. |
Hi @P-R-O-C-H-Y , Thanks for the example. I am now able to implement multiple lights and works great. In my device I have physical switches as well from which I can turn on and off the lights. I need to report this updated state back to HA. Can I have an example or a snippet of the code to do so? |
Hi @sonirohit3, I am happy to hear it's working great! Thanks for the feedback. For ColorDimmableLight there are more APIs for that:
The approach is the same, you just call one of those or multiple, and it will trigger the callback You can check both examples, it is implemented: arduino-esp32/libraries/Zigbee/examples/Zigbee_On_Off_Light/Zigbee_On_Off_Light.ino Line 99 in 9660e66
ColorDimm Light: arduino-esp32/libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light/Zigbee_Color_Dimmable_Light.ino Line 121 in 9660e66
Also There is option to get the state, level or color from the device before changing it. Check the examples :) The get functions :
|
Hi @P-R-O-C-H-Y , Everything is working. I called in the function internals directly in my code. Thanks for the great examples. Do you have any suggestion on timesync? I know on wifi it's easy but on Zigbee have no idea. |
The Time cluster is planned to be added. I can't say it will be done until the end of the year as its close, but it will be added for sure. |
Board
ESP32-C6
Device Description
Hardware Configuration
Custom Board
Version
latest master (checkout manually)
IDE Name
Arduino IDE
Operating System
Windows 11
Flash frequency
80 MHz
PSRAM enabled
no
Upload speed
115200
Description
I am trying to create multiple endpoints on Zigbee but only 1st endpoints are detected.
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: