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

@blkwll Thank you for your replay.

Could you please clarify how supporting Tuya cluster can be possibly addressed by endpoint/component association? Tuya device will always report the same endpoint, the dispatch should be performed based on the ZCL Data, not ZCL header. I don’t think the current endpoint/component association API supports it.

Also, how integration with Aleksa will be performed? Aleksa is unaware of multi component devices. Does it mean that for each gang on multi gang switch there will be a need to create a virtual switch?

Thanks

That’s above my level of understanding, but I found the discussion of the subject, in general.

I hope you might find someone with the answer:

1 Like

Hi @nayelyz,
I have created a multi-component edge driver for a 3-socket Lidl zigbee strip, following the example in the documentation and have some errors.
https://developer-preview.smartthings.com/edge-device-drivers/zigbee/device.html#multi-component-devices
After many attempts and changes to the ini.lua file, I fixed that the profile file example is wrong:

name: three-outlet
components:

  • id: main
    capabilities:
    • id: switch
      Version 1
      categories:
    • name: Switch
  • id: switch1
    capabilities:
    • id: switch
      Version 1
      categories:
    • name: Switch
  • id: switch2
    capabilities:
    • id: switch
      Version 1
      categories:
    • name: Switch

The first component must be always the “main”, which after seeing a thousand logcat, corresponds to the endpoint 1.
And endpoints 2 and 3 have to be switch1 and switch2 by default.

In the ini.lua code, it assigns the endpoints by the component_id of the profile.yml file, so it is assigning the endpoint 1 two times and the third switch remains unassigned.

Solution the file of profile.yml it is necessary to change “switch1 by switch2” and “switch2 by switch3”.

On the other hand, it needs the capability refresh, also added to the file profile.yml and init.lua in the definition of capabilities of the driver_template.

profile.yml file:
name: three-outlet
components:

  • id: main
    capabilities:
    • id: switch
      version: 1
      - id: refresh
      version: 1
      categories:
    • name: Switch
  • id: switch2
    capabilities:
    • id: switch
      version: 1
      - id: refresh
      version: 1
      categories:
    • name: Switch
  • id: switch3
    capabilities:
    • id: switch
      version: 1
      - id: refresh
      version: 1
      categories:
    • name: Switch

init.lua:
local zigbee_outlet_driver_template = {
supported_capabilities = {
capabilities.switch,
capabilities.refresh
},
lifecycle_handlers = {
init = device_init
},
}

Everything works fine except:

  • Switches 2 and 3 after perform action, need to slide your finger on the device details for the status to be refreshed.
  • Quick controls are not individual. It is programmed and executed in all switches at the same time.
  • In the Automations it has the same problem of the multiple buttons, that I already put a ticket a long time ago, the actions to program appear without separation by switch.

Do you have any solutions or recommendations?
Thanks

Hey, @Mariano_Colmenarejo

It seems that your driver is communicating properly with your device, but is missing to push the capability event back to the platform once you send a switch command.

You can use the device:emit_event_for_endpoint to push the capability event according to the component that was updated (see reference).

I am not able to get switch 2 and 3 to update state.
If update the status, they do not execute the action.

I’m quite clumsy, hahaha :upside_down_face:
Sorry

@Mariano_Colmenarejo

Have you tried the following?

local function on_handler(_, device, command)
  -- capability reference
  local attr = capabilities.switch.switch

  -- parse component to endpoint
  local endpoint = device:get_endpoint_for_component_id(command.component)

  -- send zigbee event
  device:send(OnOff.server.commands.On(device):to_endpoint(endpoint))

  -- send platform event
  device:emit_event_for_endpoint(
    endpoint,
    attr.on())
end

Notice how the switch event is divided into two additional tasks:

  1. Send the Zigbee message to the device.
  2. Push platform event to confirm the device command.
1 Like

@erickv,
The device installed fine, but when you turn on or off any of the 3 plugs it gives this error:

2021-09-09T22:38:59.350998848+00:00 DEBUG Zigbee Multi Switch-v1  Lidl MultiPlug device thread event handled
2021-09-09T22:39:21.021951525+00:00 TRACE Zigbee Multi Switch-v1  Received event with handler capability
2021-09-09T22:39:21.031821525+00:00 INFO Zigbee Multi Switch-v1  <ZigbeeDevice: e689144b-94c6-4871-9da5-fd98fe2e8452 [0x6A13] (Lidl MultiPlug)> received command: {"component":"main","args":[],"command":"on","capability":"switch","positional_args":[]}
2021-09-09T22:39:21.038372191+00:00 TRACE Zigbee Multi Switch-v1  Found CapabilityCommandDispatcher handler in Zigbee_Multi_Switch
2021-09-09T22:39:21.044232858+00:00 PRINT Zigbee Multi Switch-v1  component_id: main
2021-09-09T22:39:21.050194525+00:00 ERROR Zigbee Multi Switch-v1  Lidl MultiPlug thread encountered error: [string "init.lua"]:70: attempt to index 
a nil value (global 'OnOff')

Driver does not send the command On or Off:
The variable OnOff is undefined.

  -- send zigbee event
  device:send(OnOff.server.commands.On(device):to_endpoint(endpoint))
-- send zigbee event
  device:send(OnOff.server.commands.Off(device):to_endpoint(endpoint))

If cancel these two instructions, the device status is updated correctly but the command is not sent to the device and not errors reported in log.

I think it is necessary to load some library.
In the documentation I cannot find references to these procedures.

I have only found those referring to the ZCL cluster command.
https://developer-preview.smartthings.com/edge-device-drivers/zigbee/zcl/zcl_clusters.html#cluster-command
I have tried to load that library:

local OnOffCluster = require "st.zigbee.generated.zcl_clusters.OnOffCluster"

But it gives a library not found error when installing the device.

Thanks

@Mariano_Colmenarejo

I apologize for the missing reference :face_with_hand_over_mouth:. Add the following lines above your handlers to make it work:

local zcl_clusters = require "st.zigbee.zcl.clusters"
local OnOff = zcl_clusters.OnOff
1 Like

I’ll try it as soon as I can, a couple of days.

I did the same, but with the wrong library, which I found in the documentation and which does not exist in reality.

by the way when you use the search in the documentation, all the links give error “page not found”. I don’t know if it happens to more people.

Thanks, I’ll tell you how it goes

Indeed :pensive:, but don’t worry, this is something that our documentation team keeps reviewing and will fix as soon as possible.

2 Likes

With this modification it already updates the app status of the 3 plugs.

After several tests, this is what I see that it does not work well or as expected:

  • This strip has a button that activates or deactivates all 3 plugs at the same time. When you press it, app only updates the state of the main socket (1).
    I am not able to capture these events from switch 2 and 3, only the event received from main is seen in the log.

  • The same happens with the configuration reports, they should send status every 300 sec and only the main component sends it.

  • If you send a “refresh” command, update the 3 plugs.

  • A solution that works is to program a timer every 300 sec that a refrech executes.

  • Automations are local if you only execute actions on the “main” socket. If you perform actions with plug 2 or 3, they are not local.

  • What I already commented in another post, in automation it does not show the names of the plugs. Shows all actions followed. This also happens now with multi button DTHs.

Thanks

Great! thanks for the heads up.


Moving forward:

If your device is not automatically sending the respective Zigbee messages, then you can perform this state-binding directly at the driver. This way the app will have the current state of your device, e.g.:

local ENDPOINTS = {1, 2, 3}

for _, ep in pairs(ENDPOINTS) do
  device:emit_event_for_endpoint(ep, attr.on())
end

And regarding the reports

I’ll keep an I on this, and as soon as I have an update, I’ll share it with you.


Also, can you please give us more details about this specific issue?

Well that has been fixed. Now automations work as local with all the combinations I have tried.
I do not know if will have related with update of the beta firmware to 39.05 that was made today.

Yesterday only the local icon appeared in the automations that only the main plug (1) was in the then part.
If you added one of the other two plugs or only 2 and / or 3, the local execution icon would disappear.

Well, Can be delete.

Where would you place this so that it only updates the status of the three plugs when the main switch is pressed?
I have a 240 sec timer that runs the refresh command and updates the status if it has changed

We can include that state-binding action at the example from above, so, when you get an on/off command from the endpoint #1 of device (i.e. “main” component), you update all the components at platform-level. For example:

local zcl_clusters = require "st.zigbee.zcl.clusters"
local OnOff = zcl_clusters.OnOff

local function on_handler(_, device, command)
  -- capability reference
  local attr = capabilities.switch.switch

  -- parse component to endpoint
  local endpoint = device:get_endpoint_for_component_id(command.component)

  -- handle global on from
  -- "main" main component
  if endpoint == 1 then
    for _, ep in pairs({1,2,3}) do
      -- send Zigbee message
      --
      -- this will be necessary in
      -- case your device doesn't
      -- apply the command by itself.
      device:send(OnOff.server.commands.On(device:to_endpoint(ep)))

      -- send platform event
      device:emit_event_for_endpoint(ep, attr.on())
    end
    return
  end
  -- send single events
  device:send(OnOff.server.commands.On(device):to_endpoint(endpoint))
  device:emit_event_for_endpoint(endpoint, attr.on())
end

A little offtopic, but I think

  1. it is better to have a single handler for both On and Off commands
  2. to create a command only once and reuse it for each send

Therefore, I propose something like that

-- create a command to be sent, either On or Off
local cmd = (command.command == "off") and OnOff.server.commands.Off(device) or OnOff.server.commands.On(device)

for _, ep in pairs({1,2,3}) do
    -- modify dest end point
	cmd.address_header.dest_endpoint.value = ep
	-- send command
	device:send(cmd)
end

Another note, if you notify the platform right after sending the command, the platform will show the new state, even if the command was lost in the network or the device was not able to process it.
This approach is prone to get the device and platform out of sync.

I would suggest to consider notifying the platform about the new change in zigbee handler not in platform/capability handlers

1 Like

Can you actually identify when the main switch has been used? If you can then I can see that @erickv is offering a workable solution. If you only know that switch 1 has turned on or off but not why then I don’t see how it helps.

However I really don’t like the idea of setting the status of a switch except in response to a report from the device itself. I think it would be better if you could do an immediate refresh to get switches 2 and 3 to report.

1 Like

I’m going to test it and tell you what I think happens.

For Aqara switch I have the following solution.
I have a switch under “main” component and in addition “switch” component for each gang.
Something like that:

components:
- id: main
  capabilities:
  - id: switch
    version: 1
...
- id: switch1
  capabilities:
  - id: switch
    version: 1
- id: switch2
  capabilities:
  - id: switch
    version: 1

The platform handler checks whether the event is received for “main” or for the child.
If it is received from “main” component it issues send command for all children.
If it is received from specific gang, then the component is parsed to retrieve the gang number. Then the command is sent to this specific gang.
As a side note, I personally prefer to call whatever comes from platform as ‘event’, not command.
I use ‘command’ only for communication with the device.

This is basically my code, but please use it as a reference, as I have a lot of utiity functions

local function event_handler_switch_on_off(driver, device, event)
    utils.log_debug(device, "event_handler_switch_on_off  DNI="  .. tostring(device.device_network_id) .. " event=" .. st_utils.stringify_table(event) )

    local command = (event.command == "off") and zcl_clusters.OnOff.server.commands.Off(device) or zcl_clusters.OnOff.server.commands.On(device)

    if event.component == "main" then
        -- Send the same command (either On or Off) to all gangs
        for i = 1, utils.get_switch_count(device) do
            command.address_header.dest_endpoint.value = i
            device:send(command)
        end
    else
        command.address_header.dest_endpoint.value = utils.component_name_to_ep(event.component)
        device:send(command)
    end
end

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