[ST Edge] How to create child devices with edge?

The modification you sent does not work because of:

  • When press the button on the power strip, a status message is received in the logcat, not a command message and therefore it does not execute the function “on, off handler”. Only switch 1 status updated in app
***********  press general button in device ********************

2021-09-15T09:52:37.807858082+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T09:52:37.816951749+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xC174, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xAC, rssi: -57, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x4F, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: true > > > >
2021-09-15T09:52:37.832359749+00:00 TRACE Zigbee Multi Switch  Found ZigbeeMessageDispatcher handler in Zigbee_Multi_Switch
2021-09-15T09:52:37.837640416+00:00 INFO Zigbee Multi Switch  Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2021-09-15T09:52:37.844479082+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> emitting event: {"attribute_id":"switch","capability_id":"switch","state":{"value":"on"},"component_id":"main"}
2021-09-15T09:52:37.863571416+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled

  • When you press switch 1 or activate with a scene in the app, a command is sent and therefore the "on, off handler" function is executed and the three switches are turned on or off.
*********** pushed "switch 1" on in app ********************

2021-09-15T09:56:03.247370847+00:00 TRACE Zigbee Multi Switch  Received event with handler capability
2021-09-15T09:56:03.256782847+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> received command: {"positional_args":[],"component":"main","command":"on","capability":"switch","args":[]}
2021-09-15T09:56:03.262963847+00:00 TRACE Zigbee Multi Switch  Found CapabilityCommandDispatcher handler in Zigbee_Multi_Switch
2021-09-15T09:56:03.270443514+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xC174, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x01 >, < On ||  > > >     
2021-09-15T09:56:03.283406180+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> emitting event: {"attribute_id":"switch","capability_id":"switch","state":{"value":"on"},"component_id":"main"}
2021-09-15T09:56:03.319916514+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xC174, dest_endpoint: 0x02, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x01 >, < On ||  > > >     
2021-09-15T09:56:03.333332180+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> emitting event: {"attribute_id":"switch","capability_id":"switch","state":{"value":"on"},"component_id":"switch2"}
2021-09-15T09:56:03.375424514+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0xC174, dest_endpoint: 0x03, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x01, seqno: 0x00, ZCLCommandId: 0x01 >, < On ||  > > >     
2021-09-15T09:56:03.393597514+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> emitting event: {"attribute_id":"switch","capability_id":"switch","state":{"value":"on"},"component_id":"switch3"}
2021-09-15T09:56:03.442634514+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T09:56:03.450842847+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T09:56:03.461276181+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xC174, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC8, rssi: -50, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x57, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: true > > > >
2021-09-15T09:56:03.482010847+00:00 TRACE Zigbee Multi Switch  Found ZigbeeMessageDispatcher handler in Zigbee_Multi_Switch
2021-09-15T09:56:03.489218514+00:00 INFO Zigbee Multi Switch  Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2021-09-15T09:56:03.496397181+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> emitting event: {"attribute_id":"switch","capability_id":"switch","state":{"value":"on"},"component_id":"main"}
2021-09-15T09:56:03.511886847+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T09:56:03.518088847+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T09:56:03.526790181+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xC174, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC8, rssi: -50, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x7B, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x01, ZclStatus: SUCCESS > > >
2021-09-15T09:56:03.835019514+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T09:56:03.841309847+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T09:56:03.850178181+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xC174, src_endpoint: 0x02, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC8, rssi: -50, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x7C, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x01, ZclStatus: SUCCESS > > >
2021-09-15T09:56:03.865384514+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T09:56:03.871327514+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T09:56:03.880331847+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: faced48a-1d28-4a63-b543-7e08c5a182b8 [0xC174] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0xC174, src_endpoint: 0x03, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC8, rssi: -50, body_length: 0x0005, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x7D, ZCLCommandId: 0x0B >, < DefaultResponse || cmd: 0x01, ZclStatus: SUCCESS > > >

What I think happens:

  • When the device is installed you see in the logcat the following steps:
  • I don´t see in log “init”: the endpoints are assigned to the 3 components
  • "added" is executed
  • "doCofigure" is executed: attribute configuration and reports of the 3 components are sent, with min = 0 and max 0x12C (300sec)
***** doConfigure ********
2021-09-15T10:31:47.059171109+00:00 TRACE Zigbee Multi Switch  Received event with handler device_lifecycle
2021-09-15T10:31:47.065263775+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received lifecycle event: doConfigure
2021-09-15T10:31:47.074557109+00:00 TRACE Zigbee Multi Switch  Found DeviceLifecycleDispatcher handler in Zigbee_Multi_Switch
2021-09-15T10:31:47.080569109+00:00 TRACE Zigbee Multi Switch  Found CapabilityCommandDispatcher handler in Zigbee_Multi_Switch
2021-09-15T10:31:47.099199442+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || 
AttributeId: 0x0000 > > >
2021-09-15T10:31:47.140569775+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x02, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || 
AttributeId: 0x0000 > > >
2021-09-15T10:31:47.158773775+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x03, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || 
AttributeId: 0x0000 > > >
2021-09-15T10:31:47.190206109+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest || src_address: EC1BBDFFFEAED9B9, src_endpoint: 0x01, cluster: OnOff, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2021-09-15T10:31:47.219830109+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x0000, DataType: Boolean, minimum_reporting_interval: 0x0000, minimum_reporting_interval: 0x012C > > > >
2021-09-15T10:31:47.257891442+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x02, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest || src_address: EC1BBDFFFEAED9B9, src_endpoint: 0x01, cluster: OnOff, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2021-09-15T10:31:47.279568109+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x02, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x0000, DataType: Boolean, minimum_reporting_interval: 0x0000, minimum_reporting_interval: 0x012C > > > >
2021-09-15T10:31:47.301488775+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x03, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest || src_address: EC1BBDFFFEAED9B9, src_endpoint: 0x01, cluster: OnOff, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2021-09-15T10:31:47.328362775+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x00DB, dest_endpoint: 0x03, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x0000, DataType: Boolean, minimum_reporting_interval: 0x0000, minimum_reporting_interval: 0x012C > > > >
2021-09-15T10:31:47.410642776+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:47.501988442+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled

  • The 3 components respond as ConfigureReportingReponse || ZclStatus: SUCCESS>>> and emit event "off"
***** devices response ***********

2021-09-15T10:31:47.536992776+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:47.621316776+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC0, rssi: -52, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x52, ZCLCommandId: 0x01 >, < ReadAttributeReponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Boolean, OnOff: false > > > >
2021-09-15T10:31:47.762498109+00:00 TRACE Zigbee Multi Switch  Found ZigbeeMessageDispatcher handler in Zigbee_Multi_Switch
2021-09-15T10:31:47.888910109+00:00 INFO Zigbee Multi Switch  Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2021-09-15T10:31:47.949163442+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> emitting event: {"component_id":"main","capability_id":"switch","state":{"value":"off"},"attribute_id":"switch"}
2021-09-15T10:31:48.260512776+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:48.326244109+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee        
2021-09-15T10:31:48.356318443+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x02, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC0, rssi: -52, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x53, ZCLCommandId: 0x01 >, < ReadAttributeReponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Boolean, OnOff: false > > > >
2021-09-15T10:31:48.419551443+00:00 TRACE Zigbee Multi Switch  Found ZigbeeMessageDispatcher handler in Zigbee_Multi_Switch
2021-09-15T10:31:48.477431776+00:00 INFO Zigbee Multi Switch  Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2021-09-15T10:31:48.498398776+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> emitting event: {"component_id":"switch2","capability_id":"switch","state":{"value":"off"},"attribute_id":"switch"}
2021-09-15T10:31:48.570318109+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:48.589026109+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:48.609388109+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x03, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC0, rssi: -52, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x54, ZCLCommandId: 0x01 >, < ReadAttributeReponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Boolean, OnOff: false > > > 
>
2021-09-15T10:31:48.683783776+00:00 TRACE Zigbee Multi Switch  Found ZigbeeMessageDispatcher handler in Zigbee_Multi_Switch
2021-09-15T10:31:48.699154109+00:00 INFO Zigbee Multi Switch  Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2021-09-15T10:31:48.713321109+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> emitting event: {"component_id":"switch3","capability_id":"switch","state":{"value":"off"},"attribute_id":"switch"}
2021-09-15T10:31:48.750909110+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:48.758937443+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:48.768531776+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x00, dest_addr: 0x0000, dest_endpoint: 0x00, profile: 0x0000, cluster: 0x8021 >, lqi: 0xC0, rssi: -52, body_length: 0x0002, < ZDOMessageBody || < ZDOHeader || seqno: 0x4A >, < BindRequestResponse || status: 0x00 > > >
2021-09-15T10:31:48.799564110+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:48.813861110+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:48.844891776+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC0, rssi: -52, body_length: 0x0004, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x55, ZCLCommandId: 0x07 >, < ConfigureReportingReponse || ZclStatus: SUCCESS > > >
2021-09-15T10:31:48.873594776+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:48.879943110+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:48.896269110+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x00, dest_addr: 0x0000, dest_endpoint: 0x00, profile: 0x0000, cluster: 0x8021 >, lqi: 0xC0, rssi: -52, body_length: 0x0002, < ZDOMessageBody || < ZDOHeader || seqno: 0x4B >, < BindRequestResponse || status: 0x00 > > >
2021-09-15T10:31:48.924352776+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:48.930160110+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:48.960146110+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x02, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC0, rssi: -52, body_length: 0x0004, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x56, ZCLCommandId: 0x07 >, < ConfigureReportingReponse || ZclStatus: SUCCESS > > >
2021-09-15T10:31:48.976503776+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:48.982416110+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:48.990866776+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x00, dest_addr: 0x0000, dest_endpoint: 0x00, profile: 0x0000, cluster: 0x8021 >, lqi: 0xC0, rssi: -52, body_length: 0x0002, < ZDOMessageBody || < ZDOHeader || seqno: 0x4C >, < BindRequestResponse || status: 0x00 > > >
2021-09-15T10:31:49.009021776+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:49.015726110+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee
2021-09-15T10:31:49.024145110+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x00DB, src_endpoint: 0x03, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC0, rssi: -52, body_length: 0x0004, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x57, ZCLCommandId: 0x07 >, < ConfigureReportingReponse || ZclStatus: SUCCESS > > >
2021-09-15T10:31:49.041858110+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:31:49.048334443+00:00 TRACE Zigbee Multi Switch  Received event with handler device_lifecycle
2021-09-15T10:31:49.071655776+00:00 INFO Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received lifecycle event: infoChanged
2021-09-15T10:31:49.081005776+00:00 TRACE Zigbee Multi Switch  Found DeviceLifecycleDispatcher handler in Zigbee_Multi_Switch
2021-09-15T10:31:49.086969776+00:00 TRACE Zigbee Multi Switch  <ZigbeeDevice: 10db2658-dd39-44ce-8ae4-2997e4312430 [0x00DB] (Lidl MultiPlug)> received unhandled lifecycle event: infoChanged
2021-09-15T10:31:49.097885443+00:00 DEBUG Zigbee Multi Switch  Lidl MultiPlug device thread event handled
2021-09-15T10:32:16.915652790+00:00 TRACE Zigbee Multi Switch  Received event with handler zigbee health poll
  • But only the main switch (1) sends the status changes messages according to the configuration sent.

  • I believe that this is the whole problem: The configuration has not been done correctly, since originallycode, without functions “on, off Handler”, driver execute the commands, but only the main switch respond to the state changes and reports configurated .

When you send a refrechs command, all 3 switches answer and update the status

I put the logs in case you see something that clarifies what is wrong.

I see something strange in the cluster 0x0021, cluster OnOff configuration, but I don’t have the knowledge to analyze if it is correct:

  • In the configuration messages sent, at the ZDOMessageBody || < ZDOHeader the endpoint is always 0x01, although in addressHeader it puts enpoint 0x02 and 0x03.
    It could be because it is always endpoint 1 that receives and transmits

Thanks

What library do you load for utils and st_utils, st.utils?

Thanks

How do you assign the endpoints to the components?
main → 1
switch1 → 2
switch2 → 3.?

@Mariano_Colmenarejo This is my custom library, because I plan to reuse it for different switches of different vendors.
However, it is very easy to implement

utils.log_debug

is basically checks the preferences of the device and prints the message using log, if debug prints are enabled

utils.component_name_to_ep

converts component name to ep number as described in ZigbeeDevice Class — SmartThings Edge Device Drivers documentation
Similar to that:

local function component_to_endpoint(device, component_id)
  if component_id == "main" then
    return device.fingerprinted_endpoint_id
  else
    local ep_num = component_id:match("switch(%d)")
    return ep_num and tonumber(ep_num) or device.fingerprinted_endpoint_id
  end
end

Since different devices have different number of channels (gangs), I have a code in each sub driver that puts the number of channels into persistent storage of the device.

utils.get_switch_count(device)

merely retrieves whatever value stored in the persistent storage of that device

My schema is as follows:
“main” → EP 0
switch 1 → EP1
switch 2 → EP2

However, I do not use default handlers, as they are not helpful in general case. Tuya devices have their specific protocol on top of Zigbee and always send messages for EP==1. Therefore, my base driver sends commands as described above for any device, implementing Cluster 006, but might have different handling in each specific subdriver. Some Tuya devices support a single command for all channels (on or off).
The challenge is actually to dispatch responses from the device, not to send them. For each command Aqara responses with the new status, but not all devices would do it. Some devices will need to be queried for the new state, using read attribute for example.

Yes, so I have it done and assign:

  • main: 1
  • switch2: 2
  • switch3: 3

@erickv,

I have done the configuration manually instead of by default and in the logs, it looks the same and the result is identical.
Therefore the configuration seems correct and the fact that the components 2 and 3 do not emit the message of state change for OnOff attribute, could be a problem of the device.

I have captured the message received from the OnOff attribute of the main component, with “zigbee_handlers” in the device template and then be able to emit the events of the three components.

I have managed to send a command to read the OnOff attribute to the 3 components and they reply with the value of the current state of the attribute.

The problem is that I am not able to identify the “src_endpoint” from the “false: off” or “true: on” value of the message.

In the documentation there is no or I find almost nothing to handle the components of the device. I give pretty clumsy.

Please could you tell me how to capture the src_endpoint of the message? and then emit the events to the platform.

Thanks

@Mariano_Colmenarejo

The ZigbeeMessageRx is being parsed into a table and passed as the fourth argument into your attribute handler so you can interact with it and you’ll find the src_endpoint into the address_header nested table.

Ok, thanks I got it.

2021-09-17T18:33:25.632968317+00:00 PRINT Zigbee Multi Switch  src_endpoint , value:    1       false

2021-09-17T18:33:25.708062317+00:00 PRINT Zigbee Multi Switch  src_endpoint , value:    2       false

2021-09-17T18:33:25.782696650+00:00 PRINT Zigbee Multi Switch  src_endpoint , value:    3       false

I had been testing it with zb_rx.AddressHeader.src_endpoint.value, which is how it reads in the message instead of zb_rx.address_header.src_endpoint.value.

It would be good to have documentation where to find these things or the source code of the libraries.

I’m going to see if I finish the driver and it works or not.
Thanks again

1 Like

@erickv,

The 3 socket strip is working well now, it detects the general button press and updates the status of the 3 components.
There is only one case in which if switch 1 is off and the other 2 are on, when you press the button, no attribute change message is generated on switch 1 and therefore the status of 2 and 3 is not updated until arrives the configured report every 5 minutes maximum.

To automate whether using a 2, 3 or 4 component profile, I needed to count the components in the profile with component_count (), but I am not able to do it.
Sorry I’m very clumsy. :woozy_face:

Thanks