local device = {} device.model = "TS0601_dimmer_1_gang_1" device.vendor = "Tuya" device.description = "1 gang smart 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 = "numeric", name = "max_brightness", property = "max_brightness", access = 3, min = 1, max = 255, description = "Maximum light brightness", }, }, }, { type = "numeric", name = "countdown", property = "countdown", access = 3, unit = "s", min = 0, max = 43200, value_step = 1, description = "Countdown to turn device off after a certain time", }, { type = "enum", name = "power_on_behavior", property = "power_on_behavior", access = 3, description = "Controls the behavior when the device is powered on after power loss", category = "config", values = { "off", "previous", "on" }, }, { 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 = "backlight_mode", property = "backlight_mode", access = 3, description = "Mode of the backlight", category = "config", values = { "off", "normal", "inverted" }, }, } 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 = 5, name = "max_brightness", converter = "scale0_254to0_1000" }, { dp = 6, name = "countdown", converter = "countdown" }, { dp = 14, name = "power_on_behavior", converter = "powerOnBehavior" }, { dp = 21, name = "backlight_mode", converter = "backlightModeOffNormalInverted" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_ip2akl4w", }, { model = "TS0601", manufacturer = "_TZE200_1agwnems", }, { model = "TS0601", manufacturer = "_TZE200_la2c2uo9", }, { model = "TS0601", manufacturer = "_TZE200_579lguh2", }, { model = "TS0601", manufacturer = "_TZE200_vucankjx", }, { model = "TS0601", manufacturer = "_TZE200_4mh6tyyo", }, { model = "TS0601", manufacturer = "_TZE204_hlx9tnzb", }, { model = "TS0601", manufacturer = "_TZE204_n9ctkb6j", }, { model = "TS0601", manufacturer = "_TZE204_9qhuzgo0", }, { model = "TS0601", manufacturer = "_TZE200_9cxuhakf", }, { model = "TS0601", manufacturer = "_TZE200_a0syesf5", }, { model = "TS0601", manufacturer = "_TZE200_3p5ydos3", }, { model = "TS0601", manufacturer = "_TZE200_swaamsoy", }, { model = "TS0601", manufacturer = "_TZE200_ojzhk75b", }, { model = "TS0601", manufacturer = "_TZE200_w4cryh2i", }, { model = "TS0601", manufacturer = "_TZE200_dfxkcots", }, { model = "TS0601", manufacturer = "_TZE204_68utemio", }, { model = "TS0601", manufacturer = "_TZE200_9i9dt8is", }, { model = "TS0601", manufacturer = "_TZE200_ctq0k47x", }, { model = "TS0601", manufacturer = "_TZE200_ebwgzdqq", }, { model = "TS0601", manufacturer = "_TZE204_vevc4c6g", }, { model = "TS0601", manufacturer = "_TZE200_0nauxa0p", }, { model = "TS0601", manufacturer = "_TZE200_ykgar0ow", }, { model = "TS0601", manufacturer = "_TZE284_m1cvyneb", }, { model = "TS0601", manufacturer = "_TZE200_0hb4rdnp", }, { model = "TS0601", manufacturer = "_TZE200_gne0e6mk", }, { model = "TS0601", manufacturer = "_TZE284_68utemio", }, } return device