local device = {} device.model = "_TZ3000_h1ipgkwn" device.vendor = "Tuya" device.description = "2 channel USB switch" device.exposes = { { type = "switch", endpoint = "l1", features = { { type = "binary", name = "state", property = "state_l1", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l1", }, }, }, { type = "switch", endpoint = "l2", features = { { type = "binary", name = "state", property = "state_l2", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l2", }, }, }, { type = "enum", name = "power_on_behavior", property = "power_on_behavior_l1", access = 7, description = "Controls the behavior when the device is powered on after power loss", category = "config", endpoint = "l1", values = { "off", "on", "toggle", "previous" }, }, { type = "enum", name = "power_on_behavior", property = "power_on_behavior_l2", access = 7, description = "Controls the behavior when the device is powered on after power loss", category = "config", endpoint = "l2", values = { "off", "on", "toggle", "previous" }, }, } device.fromZigbee = { "on_off" } device.toZigbee = { "on_off" } device.configure = { bind = { "genOnOff" }, reporting = { { cluster = "genOnOff", attribute = "onOff", min = 0, max = 3600, change = 0, }, }, } device.meta = { multiEndpoint = true } device.fingerprint = { { model = "TS0002", manufacturer = "_TZ3000_h1ipgkwn", }, { model = "TS0002", manufacturer = "_TZ3000_tas0zemd", }, } return device