Command Handlers Multi-component devices

I must be missing something: If I have a device with multiple components, each component containing a switch, for example - how do I know which switch was pressed in my handler?? I can find nothing documented that shows that a component ID is available either to my handler, or that can be specified in the driver template for capability handler declarations.

1 Like

Typing on my phone so apologies if there are syntax errors.

local function set_switch(driver,device,command)
  component = command.component
end
4 Likes

Thank you! Wouldn’t it be nice if that were documented?!..

2 Likes

There are some multi-endpoint z-wave drivers I’ve been perusing and then experimenting from, plus iterating through the various arguments that get passed to my capability and command class handlers.

1 Like

I was just about to put a table print in my code so I could see what was in the command argument, when your answer arrived and saved me the trouble! :+1:t3: Much appreciated!

2 Likes