local device = {} device.model = "TS0601_cover_5" device.vendor = "Tuya" device.description = "Curtain/blind 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 = "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 = 103, name = "child_lock", converter = "onOff" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_p6vz3wzt", }, { model = "TS0601", manufacturer = "_TZE284_uqfph8ah", }, { model = "TS0601", manufacturer = "_TZE284_waa352qv", }, } return device