Incorrect endpoint reference when refreshing parent component with parent/child Zigbee driver

Hi,
I am developing a Zigbee device with six thermostats.
This device has 6 identical Zigbee endpoints.

Also, I am creating a edge driver for this with parent/child devices using the link below.

When I tested it, I found that it is normal for the child component, but when I refresh the parent component, the child endpoint id is sent instead of parent endpoint 1.

The same problem occurs when using the default Zigbee thermostat edge driver, not the driver I created.

The following is the log from SmartThings Hub when using the default edge driver.

Zigbee Thermostat  <..., dest_endpoint: 0x06, cluster: Thermostat >, ...>, < ReadAttribute || AttributeId: 0x0011 > > >
Zigbee Thermostat  <..., dest_endpoint: 0x06, cluster: Thermostat >, ...>, < ReadAttribute || AttributeId: 0x0012 > > >
Zigbee Thermostat  <..., dest_endpoint: 0x06, cluster: Thermostat >, ...>, < ReadAttribute || AttributeId: 0x0000 > > >
Zigbee Thermostat  <..., dest_endpoint: 0x06, cluster: Thermostat >, ...>, < ReadAttribute || AttributeId: 0x001B > > >
Zigbee Thermostat  <..., dest_endpoint: 0x06, cluster: Thermostat >, ...>, < ReadAttribute || AttributeId: 0x0029 > > >
Zigbee Thermostat  <..., dest_endpoint: 0x06, cluster: Thermostat >, ...>, < ReadAttribute || AttributeId: 0x001C > > >
Zigbee Thermostat  <..., dest_endpoint: 0x01, cluster: FanControl >, ...>, < ReadAttribute || AttributeId: 0x0001 > > >
Zigbee Thermostat  <..., dest_endpoint: 0x01, cluster: FanControl >, ...>, < ReadAttribute || AttributeId: 0x0000 > > >
Zigbee Thermostat  <..., dest_endpoint: 0x01, cluster: PowerConfiguration >, ...>, < ReadAttribute || AttributeId: 0x0020 > > >
Zigbee Thermostat  <..., dest_endpoint: 0x01, cluster: PowerConfiguration >, ...>, < ReadAttribute || AttributeId: 0x003E > > >

The device FW provides only Thermostat cluster in ZCL, FanControl and PowerConfiguration clusters are not defined. According to the logs, the dest_endpoint of undefined FanControl and PowerConfiguration is normal as 0x01, but thermostat has the wrong endpoint as 0x06.

If you delete and reconnect the device, the endpoint is determined to be one of 2~6.

do_refresh() function defined in the file below actually uses device:send(), I’m not sure why the dest endpoint is different like above.

  • drivers/SmartThings/zigbee-thermostat/src/init.lua
local do_refresh = function(self, device)
  local attributes = {
    Thermostat.attributes.OccupiedCoolingSetpoint,
    Thermostat.attributes.OccupiedHeatingSetpoint,
    Thermostat.attributes.LocalTemperature,
    Thermostat.attributes.ControlSequenceOfOperation,
    Thermostat.attributes.ThermostatRunningState,
    Thermostat.attributes.SystemMode,
    FanControl.attributes.FanModeSequence,
    FanControl.attributes.FanMode,
    PowerConfiguration.attributes.BatteryVoltage,
    PowerConfiguration.attributes.BatteryAlarmState
  }
  for _, attribute in pairs(attributes) do
    device:send(attribute:read(device))
  end
end

Here is full log.

2023-11-21T11:28:57.422539718+00:00 TRACE Zigbee Thermostat  Received event with handler capability
2023-11-21T11:28:57.465544385+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> received command: {"component":"main","args":{},"positional_args":{},"capability":"refresh","command":"refresh"}
2023-11-21T11:28:57.491810051+00:00 TRACE Zigbee Thermostat  Found CapabilityCommandDispatcher handler in zigbee-thermostat
2023-11-21T11:28:57.517750718+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x06, profile: 0x0104, cluster: Thermostat >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0011 > > >
2023-11-21T11:28:57.588620385+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x06, profile: 0x0104, cluster: Thermostat >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0012 > > >
2023-11-21T11:28:57.606111718+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x06, profile: 0x0104, cluster: Thermostat >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-11-21T11:28:57.717119718+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x06, profile: 0x0104, cluster: Thermostat >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x001B > > >
2023-11-21T11:28:57.778468051+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x06, profile: 0x0104, cluster: Thermostat >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0029 > > >
2023-11-21T11:28:57.834867051+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x06, profile: 0x0104, cluster: Thermostat >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x001C > > >
2023-11-21T11:28:57.911676385+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x01, profile: 0x0104, cluster: FanControl >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0001 > > >
2023-11-21T11:28:57.988763052+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x01, profile: 0x0104, cluster: FanControl >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2023-11-21T11:28:58.073128052+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x01, profile: 0x0104, cluster: PowerConfiguration >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0020 > > >
2023-11-21T11:28:58.143790052+00:00 INFO Zigbee Thermostat  <ZigbeeDevice: 61e5244e-d0fb-4f7a-9d5f-5ee37a4c5d3f [0x510E] (Zigbee Thermostat)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x510E, dest_endpoint: 0x01, profile: 0x0104, cluster: PowerConfiguration >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x003E > > >
2023-11-21T11:28:58.292087718+00:00 DEBUG Zigbee Thermostat  Zigbee Thermostat device thread event handled