local device = {} device.model = "TS0601_switch" device.vendor = "Tuya" device.description = "1, 2, 3 or 4 gang switch" device.zigbeeModel = { "qnazj70", "kjintbl" } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_oisqyl4o", }, { model = "TS0601", manufacturer = "_TZ3000_uim07oem", }, { model = "TS0601", manufacturer = "_TZE200_js3mgbjb", }, { model = "TS0601", manufacturer = "_TZE200_7deq70b8", }, { model = "TS0601", manufacturer = "_TZE204_ptaqh9tk", }, } device.exposes = { { type = "switch", endpoint = "l1", features = { { type = "binary", name = "state", property = "state_l1", access = 3, 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 = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l2", }, }, }, { type = "switch", endpoint = "l3", features = { { type = "binary", name = "state", property = "state_l3", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l3", }, }, }, { type = "switch", endpoint = "l4", features = { { type = "binary", name = "state", property = "state_l4", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l4", }, }, }, } device.tuya = { magicPacket = true, } device.tuyaDatapoints = { { dp = 1, name = "state_l1", converter = "onOff" }, { dp = 2, name = "state_l2", converter = "onOff" }, { dp = 3, name = "state_l3", converter = "onOff" }, { dp = 4, name = "state_l4", converter = "onOff" }, } device.meta = { multiEndpoint = true } device.endpoint = { l1 = 1, l2 = 1, l3 = 1, l4 = 1, } return device