-
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
How to integrate multiple gang switches with ESP32-C6 Arduino Zigbee_On_Off_Switch? #10867
Comments
Hi @luxert, I have been playing with this today and for now without any changes needed to the Zigbee library you can use approach of single Switch endpoint (Coordinator) + multiple light connected to it (end devices). You just need to set the zbSwitch.allowMultipleBinding to true.
After that all the lights can connect and will be bound to the switch. Use any of the control function void lightToggle(); To control lights individually, you need to specify the void lightToggle(uint8_t endpoint, uint16_t short_addr);
void lightToggle(uint8_t endpoint, esp_zb_ieee_addr_t ieee_addr); You can get the endpoints and addresses from the list of bound devices, which you can get by calling Let me know if you need any help. I have also in progress the 2nd approach of having multiple Switch endpoints where each switch endpoint can have 1 light bounded. This approach needs changes in the Zigbee library and is in progress. |
Thank you very much for the detailed answer. @P-R-O-C-H-Y I registered two wall light switches using zbSwitch.allowMultipleBinding(true) and successfully controlled the switches individually through the endpoint and Short_addr. I have a few more questions: After registering the device, the Short_Addr is displayed correctly in getBoundDevices(). However, after rebooting the ESP32-C6, the Short_Addr is displayed as 0x0. While the display shows 0x0, I can still control the device individually with the previously recorded short_addr. (When a signal is sent, the response shows the correct Short_addr). Is this a bug? `----Register First 09:44:07.121 -> Device on endpoint 1, short address: 0x9a5f ----After Reboot 09:48:21.556 -> Device on endpoint 1, short address: 0x0 I connected two wall light switches for testing. Can I unpair only one of the connected devices using its Short_addr and IEEE addr, etc.? In other words, can I unpair a specific device using Short_addr, etc.? Currently, I am performing a factory reset to unpair all devices and then registering them individually again. Can I check the state of the wall light switch? I can use LightOn() and LightOff() to turn the switches on and off. However, I would like to know the state when the user turns the wall light switch on or off manually. I believe the off-the-shelf product might provide a response, but nothing is reported in the handler. I’m wondering if there is a way to know the state, either via an event or polling. Can I check the connection status of the wall light switch? I turned off the power of one of the two connected wall light switches. When calling LightOn(), the following happens:
The switch that is still on works normally and the response appears, while the switch that is off shows the NLME Status. I’m wondering if I can detect the device's connection status (e.g., Connected, Joined, or Disconnected) or any state without sending a control signal. Do you have an estimate of when support for Tuya-style 3Gang wall light switches, such as Top_Button, Center_Button, and Bottom_Button, will be available? Can the current control state not be feedback in the Zigbee_On_Off_Switch.ino through the zb_cmd_default_resp_handler()? Once again, I am very, very, very grateful for your help! |
You are welcome, I am glad that worked well for you @luxert.
Thing is that only the ieee address + endpoint is stored in the binding table, which is recalled when you reset(reboot) the device. The devices still have the same short addresses, so you can use that to control it. It's not bug tho.
Currently no, but I will take a look and add API to do this. It should be possible for sure. Good feature request there.
I was not testing that, as I most of time use HomeAssistant which does this exact thing. I will take a look on the correct approach.
Not sure, as the device did not leave the network, it's just offline. I can take a look on this also.
Can you please provide more info about this? I was assuming you are now doing exactly this, so there is not much needed to add some kind of support for this.
I will take a look :) |
Question 5. Test.. For Tuya-style multi-gang light switches, I tested by changing the Endpoint to 1, 2, and 3 using zbSwitch.lightOn(Endpoint, Short_addr), and both the second and third buttons worked properly. if (command == "on11") {
Serial.println(" --> SIG Input : Light ON");
zbSwitch.lightOn(1, 0x59d1);
}else if (command == "on12") {
Serial.println(" --> SIG Input : Light ON");
zbSwitch.lightOn(2, 0x59d1);
}
|
Board
ESP32-C6
Device Description
Dev module
Hardware Configuration
Base setting
Version
v3.1.0
IDE Name
Arduino IDE 2.3.4
Operating System
Windows11
Flash frequency
80Mhz
PSRAM enabled
no
Upload speed
115200
Description
Hello,
I am using the Zigbee_On_Off_Switch example for Arduino with the ESP32-C6 module.
I successfully integrated the wall light switches from Tuya and other manufacturers, and the switch On/Off works fine. However, the wall light switch I have is a 3-gang switch.
The first switch works well with Zigbee_On_Off_Switch, but how should I get the second and third switches to work?
I am new to Zigbee and am having difficulty understanding how to set it up.
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: