local device = {} device.model = "TS0012_switch_module" device.vendor = "Tuya" device.description = "2 gang switch module - without neutral" device.zigbeeModel = { "TS0012" } device.fingerprint = { { model = "TS0012", manufacturer = "_TZ3000_yzr7jjuc" }, } device.exposes = { { type = "switch", endpoint = "left", features = { { type = "binary", name = "state", property = "state_left", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the left switch", endpoint = "left", }, }, }, { type = "switch", endpoint = "right", features = { { type = "binary", name = "state", property = "state_right", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the right switch", endpoint = "right", }, }, }, } device.tuya = { magicPacket = true, switchType = true, onOffCountdown = true, } table.insert(device.exposes, { type = "enum", name = "switch_type", property = "switch_type", access = 7, values = { "toggle", "state", "momentary" }, description = "External switch type", category = "config", }) device.fromZigbee = { "on_off" } device.toZigbee = { "on_off" } device.endpoint = { left = 1, right = 2, } device.configure = { bind = { "genOnOff" }, reporting = { { cluster = "genOnOff", attribute = "onOff", min = 0, max = 3600, change = 0, }, }, } device.meta = { multiEndpoint = true } return device