So you’re saying that if it doesn’t match these 3 parameters, then the device is not created. Is that right?
I will recheck mine. Thanks.
local metadata = {
type = "LAN",
profile = "child-smart-plug.v1",
manufacturer = device:get_manufacturer(),
model = device:get_model(),
vendor_provided_label = "Child Smart Plug",
device_network_id = device.device_network_id .. ":0" .. index,
parent_device_id = device.id,
label = "Child Smart Plug " .. index,
}
index
comes from a for-loop
.
Due to the LAN limitation, I tried 2 approaches, both being called at init
lifecycle handler of the zigbee device:
zbDriver:try_create_device(metadata)
lanDriver:try_create_device(metadata)
I think doesn’t matter zbDriver
or lanDriver
as both will end up at the same implementation mentioned in the first post of the thread.
The second approach, I am doing something similar to this:
init.lua
local zigbee_driver = ZigbeeDriver("zigbee-smart-plug", driver_template)
local lan_driver = Driver("child-smart-plug", require('child'))
zigbee_driver:run()
lan_driver:run()
config.yaml
name: 'Zigbee Smart Plug'
packageKey: 'br.com.wesley.zigbee-smart-plug'
permissions:
zigbee: {}
lan: {}
discovery: {}
In other words, due to this LAN limitation, I am trying to do a mix.