local device = {} device.model = "TS0601_water_valve_1" device.vendor = "Tuya" device.description = "Water valve" device.exposes = { { type = "switch", features = { { type = "binary", name = "state", property = "state", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", }, }, }, { type = "numeric", name = "position", property = "position", access = 3, unit = "%", min = 0, max = 100, value_step = 10, description = "Target valve position", }, { type = "numeric", name = "position_current", property = "position_current", access = 1, unit = "%", min = 0, max = 100, value_step = 10, description = "Current valve position (feedback, steps of 10%)", }, } device.tuyaDatapoints = { { dp = 1, name = "state", converter = "onOff" }, { dp = 101, name = "position", converter = "raw" }, { dp = 102, name = "position_current", converter = "raw" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_hbnfokum", }, } return device