local device = {} device.model = "SWS6TZ-WHITE" device.vendor = "Tuya" device.description = "6 gang wall 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 = "switch", endpoint = "l3", features = { { type = "binary", name = "state", property = "state_l3", access = 7, 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 = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l4", }, }, }, { type = "switch", endpoint = "l5", features = { { type = "binary", name = "state", property = "state_l5", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l5", }, }, }, { type = "switch", endpoint = "l6", features = { { type = "binary", name = "state", property = "state_l6", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l6", }, }, }, { type = "numeric", name = "current", property = "current", access = 1, unit = "A", description = "Instantaneous measured electrical current", }, { type = "numeric", name = "power", property = "power", access = 1, unit = "W", description = "Instantaneous measured power", }, { type = "numeric", name = "voltage", property = "voltage", access = 1, unit = "V", description = "Measured electrical potential value", }, } device.fromZigbee = { "electrical" } 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" }, { dp = 5, name = "state_l5", converter = "onOff" }, { dp = 6, name = "state_l6", converter = "onOff" }, { dp = 21, name = "current", converter = "divideBy1000" }, { dp = 22, name = "power", converter = "divideBy10" }, { dp = 23, name = "voltage", converter = "divideBy10" }, } device.configure = { bind = { "haElectricalMeasurement" }, reporting = { { cluster = "haElectricalMeasurement", attribute = "activePower", min = 5, max = 3600, change = 1, }, { cluster = "haElectricalMeasurement", attribute = "rmsVoltage", min = 5, max = 3600, change = 5, }, { cluster = "haElectricalMeasurement", attribute = "rmsCurrent", min = 5, max = 3600, change = 100, }, }, } device.meta = { multiEndpoint = true } device.endpoint = { l1 = 1, l2 = 1, l3 = 1, l4 = 1, l5 = 1, l6 = 1, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_8eazvzo6", }, } return device