local device = {} device.model = "TS0601_cover_with_2_switch" device.vendor = "Tuya" device.description = "Curtain/blind switch with 2 Gang switch" device.exposes = { { type = "cover", features = { { type = "enum", name = "state", property = "state", access = 3, values = { "OPEN", "CLOSE", "STOP" }, }, { type = "numeric", name = "position", property = "position", access = 3, unit = "%", min = 0, max = 100, description = "Position of this cover", }, }, }, { 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 = "enum", name = "calibration", property = "calibration", access = 3, description = "Calibration", values = { "START", "END" }, }, { type = "binary", name = "backlight_mode", property = "backlight_mode", access = 3, value_on = "ON", value_off = "OFF", description = "Backlight", }, { type = "enum", name = "motor_steering", property = "motor_steering", access = 3, description = "Motor Steering", values = { "FORWARD", "BACKWARD" }, }, { type = "binary", name = "child_lock", property = "child_lock", access = 3, value_on = "ON", value_off = "OFF", description = "Child Lock", }, } device.tuyaDatapoints = { { dp = 1, name = "state", converter = "lookup", lookup = { OPEN = 0, STOP = 1, CLOSE = 2 } }, { dp = 2, name = "position", converter = "coverPosition" }, { dp = 3, name = "calibration", converter = "lookup", lookup = { START = 0, END = 1 } }, { dp = 7, name = "backlight_mode", converter = "onOff" }, { dp = 8, name = "motor_steering", converter = "lookup", lookup = { FORWARD = 0, BACKWARD = 1 } }, { dp = 101, name = "state_l2", converter = "onOff" }, { dp = 102, name = "state_l1", converter = "onOff" }, { dp = 103, name = "child_lock", converter = "onOff" }, } device.meta = { multiEndpoint = true } device.endpoint = { l1 = 1, l2 = 1, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_5nldle7w", }, } return device