Skip to content

Support Endpoint Identification from Multiple Zigbee Devices #11168

@kiansiong85

Description

@kiansiong85

Related area

Zigebee

Hardware specification

ESP32C6

Is your feature request related to a problem?

Current Zigbee library examples focus on one-to-one communication. In real use cases, like mine, we often connect multiple end devices (e.g. 5) to a single coordinator. No endpoint/device information is displayed when receiving data (e.g. temperature).

It is difficult to identify which device sent the data.

The existing temperature (I tried to modify 2 devices connected; the second one took a long time) example does not show how to scale to multiple devices.

Describe the solution you'd like

Suggested improvements:

Show the sender's endpoint or device address when receiving data.

Add an example of multiple devices sending data to one coordinator.

Describe alternatives you've considered

No response

Additional context

No response

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.

Activity

self-assigned this
on Mar 24, 2025
added this to the 3.3.0 milestone on Apr 14, 2025
P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 3, 2025

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

Hi @kiansiong85, please if you are able to test the changes in the linked PR. It adds the functionality to receive endpoint+address of the device that sends the temperature or you can directly ask for the temperature or configuration to specific device.

kiansionglau

kiansionglau commented on Jun 12, 2025

@kiansionglau

Thanks a lot for the update. I’ve tested the new functionality and can confirm that it now successfully receives the endpoint and address of the device sending the temperature — much appreciated!

However, I’m still encountering the same issue as before: it seems I’m unable to connect to more than one device at the same time. Just wondering — does the current implementation support multiple devices simultaneously, or is that still in progress, or you have any advice for guide able give to me?

Thanks again for your support!

kiansionglau

kiansionglau commented on Jun 12, 2025

@kiansionglau

Below some serial port test result, Even after all i re-uploading the entire program, it still seems to only connect to one device.

Serial Port Print:
Current status: Waiting for 101 seconds, 1 device connected
Network status:

Network open time remaining: 79 seconds

Devices currently connected: 1

Expected number of devices: 2
...Temperature sensor value: 28.76°C from endpoint 11, address 0xac82
...Temperature sensor value: 28.76°C from endpoint 11, address 0xac82

Current status: Waiting for 112 seconds, 1 device connected
Network status:

Network open time remaining: 68 seconds

Devices currently connected: 1

Expected number of devices: 2
...Temperature sensor value: 28.73°C from endpoint 11, address 0xac82
...

P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 12, 2025

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

Hi @kiansiong85 Thank you for the feedback. Can you share your code please?

kiansionglau

kiansionglau commented on Jun 12, 2025

@kiansionglau

Sure, need your help. sure can .

Code.zip

Appreciate your strong support and guide. I don't know how send to you, but i zip the file and add attachment. if you no received, welcome inform me anytime.

P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 12, 2025

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

I see the problem :) You need to add to the setup() where you are setting up the zbThermostat device zbThermostat.allowMultipleBinding(true); to allow multiple devices to bind to the Thermostat endpoint. Its just simple as this :) The multi-device binding have been improved in some last updates so it should work without any issues :)

kiansionglau

kiansionglau commented on Jun 12, 2025

@kiansionglau

Hi P-R-O-C-H-Y, Thank you so much — it's working now! I really appreciate your help

kiansionglau

kiansionglau commented on Jun 16, 2025

@kiansionglau

Dear P-R-O-C-H-Y,I would like to ask a question regarding the device binding functionality of the Thermostat.
I have already successfully bound two devices, but when I attempted to add more devices later, it did not work.
Have you encountered this issue before? Does the Thermostat only support binding all devices at once initially, or is it supposed to allow adding new bindings individually later on?

P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 16, 2025

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

Hi @kiansionglau, I see no issue why binding multiple devices should not work. The binding is done the same way as for on/off switch which I tested to be bounded with 7 on/off lights. Can you post any logs here?

kiansionglau

kiansionglau commented on Jun 16, 2025

@kiansionglau

During my testing, I found that binding multiple devices simultaneously (e.g., devices 1, 2, and 3) works as expected.
However, when I bind devices 1 and 2 first and attempt to add device 3 afterward, the new binding does not seem to take effect.

I would like to clarify:
Does the Thermostat only support binding all target devices at once, without allowing individual additions later?

For reference, I’ve attached my code below. I’d really appreciate it if you could take a look and let me know if there’s anything I should adjust or keep in mind when you have time.

Also, I’ll review your switch on/off button code again. Thanks so much—I truly appreciate your support!

tempesensor_freertos_imu_zigbee3.zip
NewZigbee_Thermostat_ver2.zip

P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 17, 2025

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

There shouldn't be any issue adding binding new devices any time. Does it print anything when the device joins the network to the log? Please set for Thermostat before flashing in IDE Tools menu -> Zigbee mode: Zigbee ZCZR (coordinator/router) - Debug and also set Core Debug Level: Verbose and post logs when the 3rd device joins.

kiansionglau

kiansionglau commented on Jun 18, 2025

@kiansionglau

Dear P-R-O-C-H-Y, thanks a lot your advise, i use 2 device to test first. this is the logs from serial port. I think I can see the problem when using debug mode, but I'm not sure how to solve it yet.
All the temperature devices are using the same code, just with different endpoints.
I've already connected the device with endpoint 12. Now, I want to add another device with endpoint 13, and the thermostat allows connections for 180 seconds.
From the message below, it looks like the Zigbee device was added successfully, with short address: 0xEA90.

Serial port:
Temperature Device, TEMP_SENSOR_ENDPOINT_NUMBER 13

[ 49622][I][ZigbeeCore.cpp:271] esp_zb_app_signal_handler(): Start network steering
.............................[ 52450][I][ZigbeeCore.cpp:325] esp_zb_app_signal_handler(): Joined network successfully (Extended PAN ID: 40:4c:ca:ff:fe:5c:b9:e4, PAN ID: 0xa75b, Channel:11, Short Address: 0xea90)

Zigbee connected
[ 52599][D][ZigbeeTempSensor.cpp:81] setTemperature(): Setting temperature to 2551
Temperature: 25.58 
Temperature: 25.55 
Temperature: 25.61 

Serial port:
thermostat show New device commissioned or rejoined (short: 0xea90)

endpoint 12 is existing one. but no display the endpoint 13 temperature.

[  1357][I][ZigbeeCore.cpp:423] esp_zb_app_signal_handler(): Network(0xa75b) is open for 180 seconds
Temperature: 27.51°C from endpoint 12, address 0x6c3c
[  7069][I][ZigbeeCore.cpp:342] esp_zb_app_signal_handler(): New device commissioned or rejoined (short: 0xea90)
[  7069][D][ZigbeeCore.cpp:360] esp_zb_app_signal_handler(): Checking endpoint 1
[  7070][D][ZigbeeCore.cpp:370] esp_zb_app_signal_handler(): Device already bound to endpoint 1
[  7147][I][ZigbeeCore.cpp:423] esp_zb_app_signal_handler(): Network(0xa75b) is open for 180 seconds

Current device status:
Device 0x6c3c (Endpoint 12): Temp 27.51°C, Status: Online
Temperature: 27.51°C from endpoint 12, address 0x6c3c


Current device status:
Device 0x6c3c (Endpoint 12): Temp 27.48°C, Status: Online
Temperature: 27.42°C from endpoint 12, address 0x6c3c

Current device status:
Device 0x6c3c (Endpoint 12): Temp 27.42°C, Status: Online
Temperature: 27.42°C from endpoint 12, address 0x6c3c

Current device status:

ziptocheck.zip

kiansionglau

kiansionglau commented on Jun 18, 2025

@kiansionglau

For Reference.

Sometimes I reprogram everything — endpoint 12, endpoint 13, and the thermostat — at the same time, then can works.

[ 38397][I][ZigbeeThermostat.cpp:67] findCb(): Found temperature sensor
[ 38397][D][ZigbeeThermostat.cpp:74] findCb(): Temperature sensor found: short address(0x43b9), endpoint(12)
[ 38398][I][ZigbeeThermostat.cpp:85] findCb(): Request temperature sensor to bind us
[ 38398][I][ZigbeeThermostat.cpp:98] findCb(): Try to bind Temperature Measurement
[ 38398][D][ZigbeeThermostat.cpp:102] findCb(): Find callback on EP 1
[ 38400][D][ZigbeeCore.cpp:732] searchBindings(): Requesting binding table for address 0x0000
[ 38405][D][ZigbeeThermostat.cpp:51] bindCbWrapper(): bindCbWrapper on EP 1
[ 38406][I][ZigbeeThermostat.cpp:35] bindCb(): Bound successfully!
[ 38406][I][ZigbeeThermostat.cpp:38] bindCb(): The sensor originating from address(0x43b9) on endpoint(12)
[ 38406][D][ZigbeeThermostat.cpp:39] bindCb(): Sensor bound to thermostat on EP 1
[ 38407][D][ZigbeeCore.cpp:540] bindingTableCb(): Binding table callback for address 0x0000 with status 0
[ 38407][D][ZigbeeCore.cpp:544] bindingTableCb(): Binding table info: total 1, index 0, count 1
[ 38408][D][ZigbeeCore.cpp:589] bindingTableCb(): Processing record 0: src_endp 1, dst_endp 12, cluster_id 0x0402, dst_addr_mode 3
[ 38409][D][ZigbeeCore.cpp:604] bindingTableCb(): Processing final chunk of binding table, total records: 1
[ 38409][D][ZigbeeCore.cpp:625] bindingTableCb(): Processing endpoint 1
[ 38409][D][ZigbeeCore.cpp:671] bindingTableCb(): Processing binding record for EP 1
[ 38410][D][ZigbeeCore.cpp:711] bindingTableCb(): Device already exists, freeing allocated memory
[ 38410][D][ZigbeeCore.cpp:719] bindingTableCb(): Filling bounded devices finished
[ 38462][I][ZigbeeCore.cpp:423] esp_zb_app_signal_handler(): Network(0xc82d) is open for 180 seconds


收到温度上报: 26.89°C, endpoint 12, addr 0x43b9
Temperature: 26.89°C from endpoint 12, address 0x43b9
收到温度上报: 26.89°C, endpoint 12, addr 0x43b9
[ 68970][I][ZigbeeCore.cpp:342] esp_zb_app_signal_handler(): New device commissioned or rejoined (short: 0x24d5)
[ 68971][D][ZigbeeCore.cpp:360] esp_zb_app_signal_handler(): Checking endpoint 1
[ 68971][D][ZigbeeCore.cpp:375] esp_zb_app_signal_handler(): Device not bound to endpoint 1 and it is free to bound!
[ 68972][D][ZigbeeCore.cpp:377] esp_zb_app_signal_handler(): Endpoint 1 is searching for device
[ 68993][D][ZigbeeThermostat.cpp:59] findCbWrapper(): findCbWrapper on EP 1
[ 68993][I][ZigbeeThermostat.cpp:67] findCb(): Found temperature sensor
[ 68993][D][ZigbeeThermostat.cpp:74] findCb(): Temperature sensor found: short address(0x24d5), endpoint(13)
[ 68994][I][ZigbeeThermostat.cpp:85] findCb(): Request temperature sensor to bind us
[ 68994][I][ZigbeeThermostat.cpp:98] findCb(): Try to bind Temperature Measurement
[ 68995][D][ZigbeeThermostat.cpp:102] findCb(): Find callback on EP 1
[ 68997][D][ZigbeeCore.cpp:732] searchBindings(): Requesting binding table for address 0x0000
[ 69002][D][ZigbeeThermostat.cpp:51] bindCbWrapper(): bindCbWrapper on EP 1
[ 69002][I][ZigbeeThermostat.cpp:35] bindCb(): Bound successfully!
[ 69002][I][ZigbeeThermostat.cpp:38] bindCb(): The sensor originating from address(0x24d5) on endpoint(13)
[ 69003][D][ZigbeeThermostat.cpp:39] bindCb(): Sensor bound to thermostat on EP 1
[ 69004][D][ZigbeeCore.cpp:540] bindingTableCb(): Binding table callback for address 0x0000 with status 0
[ 69004][D][ZigbeeCore.cpp:544] bindingTableCb(): Binding table info: total 2, index 0, count 2
[ 69004][D][ZigbeeCore.cpp:589] bindingTableCb(): Processing record 0: src_endp 1, dst_endp 12, cluster_id 0x0402, dst_addr_mode 3
[ 69005][D][ZigbeeCore.cpp:589] bindingTableCb(): Processing record 1: src_endp 1, dst_endp 13, cluster_id 0x0402, dst_addr_mode 3
[ 69006][D][ZigbeeCore.cpp:604] bindingTableCb(): Processing final chunk of binding table, total records: 2
[ 69006][D][ZigbeeCore.cpp:625] bindingTableCb(): Processing endpoint 1
[ 69007][D][ZigbeeCore.cpp:671] bindingTableCb(): Processing binding record for EP 1
[ 69007][D][ZigbeeCore.cpp:711] bindingTableCb(): Device already exists, freeing allocated memory
[ 69008][D][ZigbeeCore.cpp:671] bindingTableCb(): Processing binding record for EP 1
[ 69008][D][ZigbeeCore.cpp:711] bindingTableCb(): Device already exists, freeing allocated memory
[ 69008][D][ZigbeeCore.cpp:719] bindingTableCb(): Filling bounded devices finished
[ 69097][I][ZigbeeCore.cpp:423] esp_zb_app_signal_handler(): Network(0xc82d) is open for 180 seconds


Device 0x43b9 (Endpoint 12): Temp 26.86°C, Status: Online
Temperature: 26.73°C from endpoint 12, address 0x43b9
收到温度上报: 26.73°C, endpoint 12, addr 0x43b9
Device 0x43b9 (Endpoint 12) disconnected
Temperature: 23.58°C from endpoint 13, address 0x24d5
收到温度上报: 23.58°C, endpoint 13, addr 0x24d5
Temperature: 26.67°C from endpoint 12, address 0x43b9
收到温度上报: 26.67°C, endpoint 12, addr 0x43b9
Temperature: 23.67°C from endpoint 13, address 0x24d5
收到温度上报: 23.67°C, endpoint 13, addr 0x24d5
Device 0x24d5 (Endpoint 13) disconnected

Current device status:
Device 0x24d5 (Endpoint 13): Status: Offline
Device 0x43b9 (Endpoint 12): Temp 26.67°C, Status: Online
Temperature: 26.79°C from endpoint 12, address 0x43b9
收到温度上报: 26.79°C, endpoint 12, addr 0x43b9
Temperature: 23.83°C from endpoint 13, address 0x24d5
收到温度上报: 23.83°C, endpoint 13, addr 0x24d5
Device 0x24d5 (Endpoint 13) disconnected
Temperature: 26.79°C from endpoint 12, address 0x43b9
收到温度上报: 26.79°C, endpoint 12, addr 0x43b9
Temperature: 23.89°C from endpoint 13, address 0x24d5
收到温度上报: 23.89°C, endpoint 13, addr 0x24d5

Current device status:
Device 0x24d5 (Endpoint 13): Temp 23.89°C, Status: Online
Device 0x43b9 (Endpoint 12): Temp 26.79°C, Status: Online
Temperature: 26.89°C from endpoint 12, address 0x43b9
收到温度上报: 26.89°C, endpoint 12, addr 0x43b9
Temperature: 23.95°C from endpoint 13, address 0x24d5
收到温度上报: 23.95°C, endpoint 13, addr 0x24d5
P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 18, 2025

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

I see no issue there why it should happen. The only thing if you are reprogramming some board, idk if you use erase_flash. So what may happen that if you don't remove the device from thermostat, but you are reflashing it so its connecting as new (from the temp sensor point of view), the Thermostat already knows this device so the binding is not processed as shown here in the log:
Device already bound to endpoint 1

[  7069][I][ZigbeeCore.cpp:342] esp_zb_app_signal_handler(): New device commissioned or rejoined (short: 0xea90)
[  7069][D][ZigbeeCore.cpp:360] esp_zb_app_signal_handler(): Checking endpoint 1
[  7070][D][ZigbeeCore.cpp:370] esp_zb_app_signal_handler(): Device already bound to endpoint 1
[  7147][I][ZigbeeCore.cpp:423] esp_zb_app_signal_handler(): Network(0xa75b) is open for 180 seconds
P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 18, 2025

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

Also you don't have to use different endpoint numbers. Use the same for all sensors, it will differ by the short and ieee address :)

P-R-O-C-H-Y

P-R-O-C-H-Y commented on Jun 18, 2025

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

Problem I see is that you are using the ShortAddress as the device identifier only. For example if you reboot the Thermostat, you will lost the shortAdresses and from getBoundDevices you will receive only ieee addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: ZigbeeIssues and Feature Request about ZigbeeType: Feature requestFeature request for Arduino ESP32

Type

No type

Projects

Status

Done

Relationships

None yet

    Participants

    @P-R-O-C-H-Y@kiansiong85@kiansionglau

    Issue actions

      Support Endpoint Identification from Multiple Zigbee Devices · Issue #11168 · espressif/arduino-esp32