Driver's lifecycle execution order

Hi,

I have done some quick tests with two cases:

  • Reinstalling a device by putting it in pairing mode and adding a device with search nearby, but without uninstalling the device beforehand. It is a reinstallation:
    In this case it is the same as in previous firmware versions, the init life cycle is not executed and the doConfigure life cycle is executed, which can result in incorrect configuration if the device needs a custom configuration.

This is usually done to reconfigure the devices without uninstalling them, as users will have to do when they receive the new firmware version and their devices that need a custom configuration were not done fine when installing them with the previous firmware versions.

Logs of device reinstall

Reinstall device without not uninstall device


2024-10-31T23:12:17.764750616Z DEBUG Zigbee Switch Power Mc driver device thread event handled
2024-10-31T23:12:47.781455578Z DEBUG Zigbee Switch Power Mc driver device thread event handled
2024-10-31T23:13:17.805160248Z DEBUG Zigbee Switch Power Mc driver device thread event handled
2024-10-31T23:13:26.411669155Z TRACE Zigbee Switch Power Mc Received event with handler device_lifecycle
2024-10-31T23:13:26.412897655Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received lifecycle event: infoChanged
2024-10-31T23:13:26.454840405Z TRACE Zigbee Switch Power Mc Received event with handler device_lifecycle
2024-10-31T23:13:26.460793780Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received lifecycle event: doConfigure
2024-10-31T23:13:26.466957697Z TRACE Zigbee Switch Power Mc Found DeviceLifecycleDispatcher handler in Zigbee_Switch_power
2024-10-31T23:13:26.487377155Z PRINT Zigbee Switch Power Mc Device ID <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)>
2024-10-31T23:13:26.494624238Z PRINT Zigbee Switch Power Mc Manufacturer >>> _TZ3000_okaz9tjs Manufacturer_Len >>> 16
2024-10-31T23:13:26.495669488Z PRINT Zigbee Switch Power Mc Model >>> TS011F Model_len >>> 6
2024-10-31T23:13:26.496725072Z PRINT Zigbee Switch Power Mc <<<<< Firmware Version >>>>> nil
2024-10-31T23:13:26.497723697Z PRINT Zigbee Switch Power Mc Memory >>>>>>> 1040.89453125 Kbytes
2024-10-31T23:13:26.498741863Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:26.565429322Z TRACE Zigbee Switch Power Mc Found DeviceLifecycleDispatcher handler in Zigbee_Switch_power
2024-10-31T23:13:26.566662447Z PRINT Zigbee Switch Power Mc <<< custom configure >>>
2024-10-31T23:13:26.567760405Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:26.568796072Z DEBUG Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> doConfigure callback did not fail, transitioning device to “PROVISIONED”
2024-10-31T23:13:26.607955863Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:27.715660072Z TRACE Zigbee Switch Power Mc Received event with handler device_lifecycle
2024-10-31T23:13:27.724625697Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received lifecycle event: infoChanged
2024-10-31T23:13:27.733642364Z TRACE Zigbee Switch Power Mc Found DeviceLifecycleDispatcher handler in Zigbee_Switch_power
2024-10-31T23:13:27.734786030Z PRINT Zigbee Switch Power Mc Device ID <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)>
2024-10-31T23:13:27.735859072Z PRINT Zigbee Switch Power Mc Manufacturer >>> _TZ3000_okaz9tjs Manufacturer_Len >>> 16
2024-10-31T23:13:27.736852447Z PRINT Zigbee Switch Power Mc Model >>> TS011F Model_len >>> 6
2024-10-31T23:13:27.737875030Z PRINT Zigbee Switch Power Mc <<<<< Firmware Version >>>>> nil
2024-10-31T23:13:27.739564114Z PRINT Zigbee Switch Power Mc Memory >>>>>>> 1033.2802734375 Kbytes
2024-10-31T23:13:27.741203822Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:27.765583322Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:27.766938614Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCC, rssi: -65, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xF4, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: false > > > >
2024-10-31T23:13:27.777010030Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:27.783044864Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCC, rssi: -65, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xF5, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x8000, DataType: Boolean, Boolean: false > > > >
2024-10-31T23:13:27.800780322Z TRACE Zigbee Switch Power Mc Found ZigbeeMessageDispatcher handler in Zigbee_Switch_power
2024-10-31T23:13:27.801901655Z INFO Zigbee Switch Power Mc Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2024-10-31T23:13:27.803448780Z PRINT Zigbee Switch Power Mc <<<<< Emit on_off >>>>>>
2024-10-31T23:13:27.804615405Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> emitting event: {“attribute_id”:“signalMetrics”,“capability_id”:“legendabsolute60149.signalMetrics”,“component_id”:“main”,“state”:{“value”:“2024/11/01 Time: 00:13, LQI: 204 … rssi: -65”},“visibility”:{“displayed”:false}}
2024-10-31T23:13:27.820724155Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“off”}}
2024-10-31T23:13:27.834844530Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:27.841725239Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:27.880451947Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:27.881580364Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCE, rssi: -65, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xF6, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x8001, DataType: Enum8, Enum8: 0x01 > > > >
2024-10-31T23:13:27.896657197Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:27.902354864Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xD0, rssi: -65, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xF7, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x8002, DataType: Enum8, Enum8: 0x02 > > > >
2024-10-31T23:13:27.918051822Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:27.923922197Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.013875155Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:28.056787614Z WARN Zigbee Switch Power Mc Error encountered parsing Zigbee message defaulting to generic body: [string “st/zigbee/data_types/ZigbeeDataType.lua”]:32: DataType value is
an unrecognized data type: 0x06
2024-10-31T23:13:28.060648197Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: 0xE000 >, lqi: 0xCC, rssi: -67, body_length: 0x0009, GenericBody: 18 F8 0A 01 D0 48 02 00 06 >
2024-10-31T23:13:28.076857614Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.144096447Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:28.161139989Z WARN Zigbee Switch Power Mc Error encountered parsing Zigbee message defaulting to generic body: [string “st/buf.lua”]:695: buffer too short
2024-10-31T23:13:28.165256822Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: 0xE000 >, lqi: 0xD0, rssi: -65, body_length: 0x0009, GenericBody: 18 F9 0A 02 D0 48 02 00 0A >
2024-10-31T23:13:28.180771530Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:28.198641155Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCE, rssi: -65, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xFA, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x4001, DataType: Uint16, OnTime: 0x0000 > > > >
2024-10-31T23:13:28.241980530Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.243122030Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.425113822Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:28.426422947Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCC, rssi: -65, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xFB, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x4002, DataType: Uint16, OffWaitTime: 0x0000 > > > >
2024-10-31T23:13:28.443134572Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.555089239Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:28.564691072Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, lqi: 0xCC, rssi: -65, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xFC, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0505, DataType: Uint16, RMSVoltage: 0x00DC > > > >
2024-10-31T23:13:28.577645364Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.695069739Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:28.704496072Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, lqi: 0xCA, rssi: -65, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xFD, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0508, DataType: Uint16, RMSCurrent: 0x0000 > > > >
2024-10-31T23:13:28.717994322Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.865085697Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:28.866377905Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, lqi: 0xCC, rssi: -64, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xFE, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x050B, DataType: Uint16, ActivePower: 0 > > > >
2024-10-31T23:13:28.883387197Z TRACE Zigbee Switch Power Mc Found ZigbeeMessageDispatcher handler in Zigbee_Switch_power
2024-10-31T23:13:28.885806447Z INFO Zigbee Switch Power Mc Executing ZclClusterAttributeValueHandler: cluster: ElectricalMeasurement, attribute: ActivePower
2024-10-31T23:13:28.889570905Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> emitting event: {“attribute_id”:“power”,“capability_id”:“powerMeter”,“component_id”:“main”,“state”:{“unit”:“W”,“value”:0.0}}
2024-10-31T23:13:28.904653155Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:29.221348489Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:13:29.237958905Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, lqi: 0xCE, rssi: -65, body_length: 0x000C, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0xFF, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Uint48, CurrentSummationDelivered: 0x000000000000 > > > >
2024-10-31T23:13:29.267693697Z TRACE Zigbee Switch Power Mc Found ZigbeeMessageDispatcher handler in Zigbee_Switch_power
2024-10-31T23:13:29.269895364Z INFO Zigbee Switch Power Mc Executing ZclClusterAttributeValueHandler: cluster: SimpleMetering, attribute: CurrentSummationDelivered
2024-10-31T23:13:29.272867905Z PRINT Zigbee Switch Power Mc SIMPLE_METERING_DIVISOR_KEY >>>> 1280
2024-10-31T23:13:29.275694655Z PRINT Zigbee Switch Power Mc ELECTRICAL_MEASUREMENT_DIVISOR_KEY >>>>> 1
2024-10-31T23:13:29.280309072Z PRINT Zigbee Switch Power Mc << Energy Offset: 0 Kwh
2024-10-31T23:13:29.283643072Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> emitting event: {“attribute_id”:“energy”,“capability_id”:“energyMeter”,“component_id”:“main”,“state”:{“unit”:“kWh”,“value”:0.0}}
2024-10-31T23:13:29.339332530Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> emitting event: {“attribute_id”:“powerConsumption”,“capability_id”:“powerConsumptionReport”,“component_id”:“main”,“state”:{“value”:{“deltaEnergy”:0.0,“energy”:0.0}}}
2024-10-31T23:13:29.360977405Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled

2024-10-31T23:15:35.890616087Z TRACE Zigbee Switch Power Mc Received event with handler zigbee
2024-10-31T23:15:36.086765212Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xBC, rssi: -74, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x08, seqno: 0x00, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: false > > > >
2024-10-31T23:15:36.314423754Z TRACE Zigbee Switch Power Mc Found ZigbeeMessageDispatcher handler in Zigbee_Switch_power
2024-10-31T23:15:36.358087046Z INFO Zigbee Switch Power Mc Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2024-10-31T23:15:36.360920837Z PRINT Zigbee Switch Power Mc <<<<< Emit on_off >>>>>>
2024-10-31T23:15:36.366977587Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> emitting event: {“attribute_id”:“signalMetrics”,“capability_id”:“legendabsolute60149.signalMetrics”,“component_id”:“main”,“state”:{“value”:“2024/11/01 Time: 00:15, LQI: 188 … rssi: -74”},“visibility”:{“displayed”:false}}
2024-10-31T23:15:36.444264254Z INFO Zigbee Switch Power Mc <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> emitting event: {“attribute_id”:“switch”,“capability_id”:“switch”,“component_id”:“main”,“state”:{“value”:“off”}}
2024-10-31T23:15:36.470213879Z DEBUG Zigbee Switch Power Mc LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:15:47.854596672Z DEBUG Zigbee Switch Power Mc driver device thread event handled
2024-10-31T23:16:17.860265384Z DEBUG Zigbee Switch Power Mc driver device thread event handled
2024-10-31T23:16:47.862536929Z DEBUG Zigbee Switch Power Mc driver device thread event handled
2024-10-31T23:16:49.655084763Z TRACE Zigbee Switch Power Mc Received event with handler zigbee

4 Likes

(Need two post due to excessive characters)

  • Installing a device from scratch in a driver in which there are already other paired devices:

Here, although in the logs you can see in logs the life cycle doConfigure before the init, in reality init is executed before doConfigure, so it has been fine.

Logs device install from scratch
*****************************************************
install  new device
*****************************************************

2024-10-31T23:20:17.968728228Z DEBUG Zigbee Switch Power Mc  driver device thread event handled
2024-10-31T23:20:29.798464021Z TRACE Zigbee Switch Power Mc  Received event with handler device_lifecycle
2024-10-31T23:20:29.913727730Z TRACE Zigbee Switch Power Mc  Zigbee Device: e328650a-4f5b-410f-9cbb-ff838f390166
Manufacturer: _TZ3000_okaz9tjs Model: TS011F
        [1]: server: Basic, OnOff, Identify, Groups, Scenes, TouchlinkCommissioning, Time, 0xE001, 0xE000, SimpleMetering, ElectricalMeasurement | client
2024-10-31T23:20:29.915241021Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received lifecycle event: added
2024-10-31T23:20:29.957575896Z TRACE Zigbee Switch Power Mc  Received event with handler device_lifecycle
2024-10-31T23:20:29.959508271Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received lifecycle event: doConfigure
2024-10-31T23:20:29.961604230Z TRACE Zigbee Switch Power Mc  Found DeviceLifecycleDispatcher handler in Zigbee_Switch_power
2024-10-31T23:20:29.962825813Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: Basic >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0001 > > >
2024-10-31T23:20:29.974557438Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:29.975655230Z DEBUG Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> added callback did not fail, executing init handler    
2024-10-31T23:20:29.976816230Z TRACE Zigbee Switch Power Mc  Found DeviceLifecycleDispatcher handler in Zigbee_Switch_power
2024-10-31T23:20:29.977894646Z PRINT Zigbee Switch Power Mc  <<< device_init >>>
2024-10-31T23:20:29.978895855Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0000 > > >
2024-10-31T23:20:29.987213646Z PRINT Zigbee Switch Power Mc  <<< random.do_init >>>
2024-10-31T23:20:29.994510313Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> emitting event: {"attribute_id":"randomOnOff","capability_id":"legendabsolute60149.randomOnOff2","component_id":"main","state":{"value":"Inactive"}}
2024-10-31T23:20:30.012773521Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> emitting event: {"attribute_id":"randomNext","capability_id":"legendabsolute60149.randomNextStep2","component_id":"main","state":{"value":"Inactive"}}
2024-10-31T23:20:30.085185646Z TRACE Zigbee Switch Power Mc  Found DeviceLifecycleDispatcher handler in Zigbee_Switch_power
2024-10-31T23:20:30.086775646Z PRINT Zigbee Switch Power Mc  <<< custom configure >>>
2024-10-31T23:20:30.094175146Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:30.095277188Z DEBUG Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> doConfigure callback did not fail, transitioning device to "PROVISIONED"
2024-10-31T23:20:30.099368396Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:30.108301146Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:30.681758438Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:30.839569896Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: Basic >, lqi: 0xCC, rssi: -63, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x7B, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0001, ZclStatus: SUCCESS, DataType: Uint8, ApplicationVersion: 0x70 > > > > 
2024-10-31T23:20:30.854694855Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:30.855782688Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCC, rssi: -63, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x05, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x0000, DataType: Boolean, OnOff: false > > > >
2024-10-31T23:20:31.060713855Z TRACE Zigbee Switch Power Mc  Found ZigbeeMessageDispatcher handler in Zigbee_Switch_power
2024-10-31T23:20:31.061876938Z INFO Zigbee Switch Power Mc  Executing ZclClusterAttributeValueHandler: cluster: Basic, attribute: ApplicationVersion
2024-10-31T23:20:31.063878771Z PRINT Zigbee Switch Power Mc  Firmware >>>>>>>>> 112
2024-10-31T23:20:31.084667021Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:31.085755563Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:31.086765521Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC6, rssi: -63, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x06, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x8000, DataType: Boolean, Boolean: false > > > >
2024-10-31T23:20:31.192263605Z TRACE Zigbee Switch Power Mc  Found ZigbeeMessageDispatcher handler in Zigbee_Switch_power
2024-10-31T23:20:31.209500688Z INFO Zigbee Switch Power Mc  Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2024-10-31T23:20:31.275207771Z PRINT Zigbee Switch Power Mc  <<<<< Emit on_off >>>>>>
2024-10-31T23:20:31.277935688Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> emitting event: {"attribute_id":"signalMetrics","capability_id":"legendabsolute60149.signalMetrics","component_id":"main","state":{"value":"2024/10/31 Time: 23:20, LQI: 204 ... rssi: -63"},"visibility":{"displayed":false}}
2024-10-31T23:20:31.307824021Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> emitting event: {"attribute_id":"switch","capability_id":"switch","component_id":"main","state":{"value":"off"}}
2024-10-31T23:20:31.406811313Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:31.408710438Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:31.547106146Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC8, rssi: -63, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x07, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x8001, DataType: Enum8, Enum8: 0x01 > > > >
2024-10-31T23:20:31.564635313Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:31.565753021Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:31.566751813Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xC8, rssi: -65, body_length: 0x0007, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x08, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x8002, DataType: Enum8, Enum8: 0x02 > > > >
2024-10-31T23:20:34.520793105Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:34.641614188Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:34.644854688Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xD2, rssi: -64, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x7C, ZCLCommandId: 0x01 >, < ReadAttributeResponse || < AttributeRecord || AttributeId: 0x0000, ZclStatus: SUCCESS, DataType: Boolean, OnOff: false > > > >
2024-10-31T23:20:34.669421897Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:34.704266063Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:34.706936688Z TRACE Zigbee Switch Power Mc  Found ZigbeeMessageDispatcher handler in Zigbee_Switch_power
2024-10-31T23:20:34.709267772Z INFO Zigbee Switch Power Mc  Executing ZclClusterAttributeValueHandler: cluster: OnOff, attribute: OnOff
2024-10-31T23:20:34.741784272Z PRINT Zigbee Switch Power Mc  <<<<< Emit on_off >>>>>>
2024-10-31T23:20:35.175437439Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> emitting event: {"attribute_id":"signalMetrics","capability_id":"legendabsolute60149.signalMetrics","component_id":"main","state":{"value":"2024/10/31 Time: 23:20, LQI: 210 ... rssi: -64"},"visibility":{"displayed":false}}
2024-10-31T23:20:35.230989439Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> emitting event: {"attribute_id":"switch","capability_id":"switch","component_id":"main","state":{"value":"off"}}
2024-10-31T23:20:35.251533772Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:35.252710439Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:35.303488480Z WARN Zigbee Switch Power Mc  Error encountered parsing Zigbee message defaulting to generic body: [string "st/zigbee/data_types/ZigbeeDataType.lua"]:32: DataType value is 
an unrecognized data type: 0x06
2024-10-31T23:20:35.305788897Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: 0xE000 >, lqi: 0xCA, rssi: -63, body_length: 0x0009, GenericBody:  18 09 0A 01 D0 48 02 00 06 >
2024-10-31T23:20:35.314695980Z PRINT Zigbee Switch Power Mc  <<< do_configure >>>
2024-10-31T23:20:35.315896689Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0605 > > >
2024-10-31T23:20:35.326096022Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0604 > > >
2024-10-31T23:20:35.409661105Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0302 > > >
2024-10-31T23:20:35.419763355Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0301 > > >
2024-10-31T23:20:35.648857980Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest 
|| src_address: 70B3D52B60098B14, src_endpoint: 0x01, cluster: ElectricalMeasurement, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2024-10-31T23:20:35.767596147Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x050B, DataType: Uint16, minimum_reporting_interval: 0x001E, maximum_reporting_interval: 0x01A4, reportable_change: 0x0005 > > > >
2024-10-31T23:20:36.079939355Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest 
|| src_address: 70B3D52B60098B14, src_endpoint: 0x01, cluster: SimpleMetering, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2024-10-31T23:20:36.096080939Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x0000, DataType: Uint48, minimum_reporting_interval: 0x0005, maximum_reporting_interval: 0x0E10, reportable_change: 0x000000000001 > > > >
2024-10-31T23:20:36.232877105Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x0400, DataType: Int24, minimum_reporting_interval: 0x0001, maximum_reporting_interval: 0x0E10, reportable_change: 5 > > > >
2024-10-31T23:20:36.246268730Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest 
|| src_address: 70B3D52B60098B14, src_endpoint: 0x01, cluster: OnOff, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2024-10-31T23:20:36.259339647Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, 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, maximum_reporting_interval: 0x012C > > > >
2024-10-31T23:20:36.510737855Z PRINT Zigbee Switch Power Mc  doConfigure performed, transitioning device to PROVISIONED
2024-10-31T23:20:36.535839855Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:36.536979022Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:36.537910272Z WARN Zigbee Switch Power Mc  Error encountered parsing Zigbee message defaulting to generic body: [string "st/buf.lua"]:695: buffer too short
2024-10-31T23:20:36.653677564Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: 0xE000 >, lqi: 0xC8, rssi: -64, body_length: 0x0009, GenericBody:  18 0A 0A 02 D0 48 02 00 0A >
2024-10-31T23:20:36.664576980Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:36.665653647Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:36.834673355Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCA, rssi: -65, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x0B, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x4001, DataType: Uint16, OnTime: 0x0000 > > > >
2024-10-31T23:20:36.910561564Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:36.911777897Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:36.912854272Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled
2024-10-31T23:20:37.664124147Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:20:37.667168272Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x948A, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: OnOff >, lqi: 0xCA, rssi: -64, body_length: 0x0008, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x18, seqno: 0x0C, ZCLCommandId: 0x0A >, < ReportAttribute || < AttributeRecord || AttributeId: 0x4002, DataType: Uint16, OffWaitTime: 0x0000 > > > >
2024-10-31T23:20:37.843047022Z PRINT Zigbee Switch Power Mc  <<< do_configure >>>
2024-10-31T23:20:37.874803272Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0605 > > >
2024-10-31T23:20:37.967532647Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0604 > > >
2024-10-31T23:20:38.286191439Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0302 > > >
2024-10-31T23:20:38.314848939Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x00 >, < ReadAttribute || AttributeId: 0x0301 > > >
2024-10-31T23:20:38.445528564Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest 
|| src_address: 70B3D52B60098B14, src_endpoint: 0x01, cluster: ElectricalMeasurement, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2024-10-31T23:20:38.458246564Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: ElectricalMeasurement >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x050B, DataType: Uint16, minimum_reporting_interval: 0x001E, maximum_reporting_interval: 0x01A4, reportable_change: 0x0005 > > > >
2024-10-31T23:20:38.578622897Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest 
|| src_address: 70B3D52B60098B14, src_endpoint: 0x01, cluster: SimpleMetering, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2024-10-31T23:20:38.669120647Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x0000, DataType: Uint48, minimum_reporting_interval: 0x0005, maximum_reporting_interval: 0x0E10, reportable_change: 0x000000000001 > > > >
2024-10-31T23:20:38.681733022Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0104, cluster: SimpleMetering >, < ZCLMessageBody || < ZCLHeader || frame_ctrl: 0x00, seqno: 0x00, ZCLCommandId: 0x06 >, < ConfigureReporting || < AttributeReportingConfiguration || direction: 0x00, attr_id: 0x0400, DataType: Int24, minimum_reporting_interval: 0x0001, maximum_reporting_interval: 0x0E10, reportable_change: 5 > > > >
2024-10-31T23:20:38.868339439Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, dest_endpoint: 0x01, profile: 0x0000, cluster: 0x0021 >, < ZDOMessageBody || < ZDOHeader || seqno: 0x00 >, < BindRequest 
|| src_address: 70B3D52B60098B14, src_endpoint: 0x01, cluster: OnOff, dest_addr_mode: 0x03, dest_address: 286D97000204B680, dest_endpoint: 0x01 > > >
2024-10-31T23:20:38.881280689Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: e328650a-4f5b-410f-9cbb-ff838f390166 [0x948A] (LSPA9ZB20 TS011F Plug)> sending Zigbee message: < ZigbeeMessageTx || Uint16: 0x0000, < AddressHeader || src_addr: 0x0000, src_endpoint: 0x01, dest_addr: 0x948A, 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, maximum_reporting_interval: 0x012C > > > >
2024-10-31T23:20:38.970824606Z PRINT Zigbee Switch Power Mc  doConfigure performed, transitioning device to PROVISIONED
2024-10-31T23:20:38.984587939Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug device thread event handled

In both cases I have detected a WARN:
WARN Zigbee Switch Power Mc Error encountered parsing Zigbee message defaulting to generic body: [string "st/buf.lua"]:695: buffer too short

I don’t know if it has to do with the previous error that the device sends an unknown data_type

2024-10-31T23:13:28.056787614Z WARN Zigbee Switch Power Mc  Error encountered parsing Zigbee message defaulting to generic body: [string "st/zigbee/data_types/ZigbeeDataType.lua"]:32: DataType value is 
an unrecognized data type: 0x06
2024-10-31T23:13:28.060648197Z INFO Zigbee Switch Power Mc  <ZigbeeDevice: b35219fd-ae73-4d69-815d-20f942c14e46 [0x75F9] (LSPA9ZB20 TS011F Plug 1)> received Zigbee message: < ZigbeeMessageRx || type: 0x00, < AddressHeader || src_addr: 0x75F9, src_endpoint: 0x01, dest_addr: 0x0000, dest_endpoint: 0x01, profile: 0x0104, cluster: 0xE000 >, lqi: 0xCC, rssi: -67, body_length: 0x0009, GenericBody:  18 F8 0A 01 D0 48 02 00 06 >
2024-10-31T23:13:28.076857614Z DEBUG Zigbee Switch Power Mc  LSPA9ZB20 TS011F Plug 1 device thread event handled
2024-10-31T23:13:28.144096447Z TRACE Zigbee Switch Power Mc  Received event with handler zigbee
2024-10-31T23:13:28.161139989Z WARN Zigbee Switch Power Mc  Error encountered parsing Zigbee message defaulting to generic body: [string "st/buf.lua"]:695: buffer too short
2 Likes

Hi, @Mariano_Colmenarejo
So, when you reinstall the device and only doConfigure is executed, the code you set in init like add_monitored_attribute is not considered?

1 Like

Hi,
Indeed, all the add configure and monitoring attributes code, which is in the init lifecycle, is not executed and the device is configured incorrectly in these cases of custom configuration, which are many in the stock drivers.

In the first installation now with 54.14 works fine

I have added code in doConfigure in my drivers to avoid this until it is fixed.

2 Likes

Hi, @Mariano_Colmenarejo
The engineering team asked if you could share your driver’s code for them to check.
Can you add it to a .zip file and send it to build@smartthings.com, please?

Hi @nayelyz
Sorry, I don’t understand anything!

It’s not a problem with my driver
It’s a problem with all the drivers that have code that runs in the init lifecycle to make different configurations than the default or set endpoints-components mapping function

They have all their drivers to see it, zigbee-switch, zigbee-contact, zigbee-motion, zigbee-humidity-sensor and more

This is the case of zigbee-switch

local device_init = function(self, device)
  device:set_component_to_endpoint_fn(component_to_endpoint)
  device:set_endpoint_to_component_fn(endpoint_to_component)

  local configuration = configurationMap.get_device_configuration(device)
  if configuration ~= nil then
    for _, attribute in ipairs(configuration) do
      device:add_configured_attribute(attribute)
      device:add_monitored_attribute(attribute)
    end
  end

  local ias_zone_config_method = configurationMap.get_ias_zone_config_method(device)
  if ias_zone_config_method ~= nil then
    device:set_ias_zone_config_method(ias_zone_config_method)
  end
end

The only thing I have done in my drivers is duplicate this code in the doConfigure lifecycle and if the int cycle is not performed it does not matter, until they fix it, since I do not see any sense in not performing the init lifecycle when a device is reinstalled.

1 Like

I guess it depends on what is really happening when a device is ‘reinstalled’ as we see it.

Question: If a driver has both init and doConfigure handlers, is there any reason at all for not putting add_configured_attribute() in the doConfigure handler? It seems the obvious place for it. Sticking it in init seems like a less robust solution. Are the stock handlers really doing the best thing or are they compromising?

Update: Every time I think about this I come to a different conclusion. In the last few hours since writing the above I’ve flipped to thinking that actually init is the better place because configured attributes also affect refresh.

Comment: On the legacy platform the Configuration capability made the configure() command available, as well as causing it to be called automatically when devices were installed or significantly updated. The doConfigure lifecycle has removed the need for the latter feature, but the configure() capability command still seems like it could be useful.

Update: I would envisage the configure() capability command doing the same as init with monitored and configured attributes and then doing the same as doConfigure.

Question: As I understand it add_monitored_attribute() does really need to be in the init handler. However does it actually need to be executed after a ‘reinstall’? The same with anything else that might be in init. I guess what I am asking is, is init actually needed after a reinstall, or is it just the add_configured_attribute() that is the issue?

Update: It just seems to me that a ‘reinstall’ might be transparent to the driver and it could still be running with the same device object and monitored and configured attributes.

There is also the question of to what degree a ‘reinstall’ is supported. At what point should users be expected to delete a device and start again?

Update: It seems the issue is that a ‘reinstall’ is being used as a way of updating the configuration of the hardware in the expectation the init and doConfigure would be called, but only the latter is. Is it a reasonable expectation?

Of course just because the lack of an init could be quite reasonable, that doesn’t mean having one would do any harm.

Update: It wouldn’t make it ‘right’ though.

1 Like

If smartthings has put them there in all their stock drivers since the beginning of edge it will be because they believe they should be in init, but they will be the ones who have to answer that question.

The way the stock drivers are written and the way the initialization of a device works, the stock drivers are doing it wrong.
As written, whenever a doConfigure is executed, an init must be executed beforehand, that’s obvious.

The add_monitired and configured attribute functions are linked. If you are going to perform a configuration, you have to save the configuration intervals for monitoring and control the execution of the healt_check.
These values ​​are not saved in permanent memory and I don’t know if they would be lost in a reinstallation.

If when device was first installed it had custom configuration intervals, when it is reinstalled now it would have default configuration and monitoring intervals.

At the moment it is supported and I think it is useful and therefore if it is supported it should work well.

But as they often do, instead of fixing what doesn’t work they remove it, it is usually easier to destroy than to redo.

2 Likes