local device = {} device.model = "TS0601_dimmer_knob" device.vendor = "Tuya" device.description = "Zigbee smart knob dimmer" device.exposes = { { type = "light", features = { { type = "binary", name = "state", property = "state", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of this light", }, { type = "numeric", name = "brightness", property = "brightness", access = 3, min = 0, max = 254, description = "Brightness of this light", }, { type = "numeric", name = "min_brightness", property = "min_brightness", access = 3, min = 1, max = 255, description = "Minimum light brightness", }, }, }, { type = "enum", name = "light_type", property = "light_type", access = 3, description = "Type of light attached to the device", values = { "led", "incandescent", "halogen" }, }, { type = "enum", name = "indicator_mode", property = "indicator_mode", access = 7, description = "Mode of the indicator light", category = "config", values = { "none", "relay", "pos" }, }, } device.tuyaDatapoints = { { dp = 1, name = "state", converter = "onOff" }, { dp = 2, name = "brightness", converter = "scale0_254to0_1000" }, { dp = 3, name = "min_brightness", converter = "scale0_254to0_1000" }, { dp = 4, name = "light_type", converter = "lightType" }, { dp = 21, name = "indicator_mode", converter = "lookup", lookup = { none = 0, relay = 1, pos = 2 } }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_p0gzbqct", }, } return device