local device = {} device.model = "TS0601_dimmer_3" device.vendor = "Tuya" device.description = "3 gang smart dimmer" device.exposes = { { type = "light", endpoint = "l1", features = { { type = "binary", name = "state", property = "state_l1", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of this light", endpoint = "l1", }, { type = "numeric", name = "brightness", property = "brightness_l1", access = 3, min = 0, max = 254, description = "Brightness of this light", endpoint = "l1", }, { type = "numeric", name = "min_brightness", property = "min_brightness_l1", access = 3, min = 1, max = 255, description = "Minimum light brightness", endpoint = "l1", }, { type = "numeric", name = "max_brightness", property = "max_brightness_l1", access = 3, min = 1, max = 255, description = "Maximum light brightness", endpoint = "l1", }, }, }, { type = "light", endpoint = "l2", features = { { type = "binary", name = "state", property = "state_l2", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of this light", endpoint = "l2", }, { type = "numeric", name = "brightness", property = "brightness_l2", access = 3, min = 0, max = 254, description = "Brightness of this light", endpoint = "l2", }, { type = "numeric", name = "min_brightness", property = "min_brightness_l2", access = 3, min = 1, max = 255, description = "Minimum light brightness", endpoint = "l2", }, { type = "numeric", name = "max_brightness", property = "max_brightness_l2", access = 3, min = 1, max = 255, description = "Maximum light brightness", endpoint = "l2", }, }, }, { type = "light", endpoint = "l3", features = { { type = "binary", name = "state", property = "state_l3", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of this light", endpoint = "l3", }, { type = "numeric", name = "brightness", property = "brightness_l3", access = 3, min = 0, max = 254, description = "Brightness of this light", endpoint = "l3", }, { type = "numeric", name = "min_brightness", property = "min_brightness_l3", access = 3, min = 1, max = 255, description = "Minimum light brightness", endpoint = "l3", }, { type = "numeric", name = "max_brightness", property = "max_brightness_l3", access = 3, min = 1, max = 255, description = "Maximum light brightness", endpoint = "l3", }, }, }, { type = "numeric", name = "countdown", property = "countdown_l1", access = 3, unit = "s", min = 0, max = 43200, value_step = 1, description = "Countdown to turn device off after a certain time", endpoint = "l1", }, { type = "numeric", name = "countdown", property = "countdown_l2", access = 3, unit = "s", min = 0, max = 43200, value_step = 1, description = "Countdown to turn device off after a certain time", endpoint = "l2", }, { type = "numeric", name = "countdown", property = "countdown_l3", access = 3, unit = "s", min = 0, max = 43200, value_step = 1, description = "Countdown to turn device off after a certain time", endpoint = "l3", }, { type = "enum", name = "light_type", property = "light_type_l1", access = 3, description = "Type of light attached to the device", endpoint = "l1", values = { "led", "incandescent", "halogen" }, }, { type = "enum", name = "light_type", property = "light_type_l2", access = 3, description = "Type of light attached to the device", endpoint = "l2", values = { "led", "incandescent", "halogen" }, }, { type = "enum", name = "light_type", property = "light_type_l3", access = 3, description = "Type of light attached to the device", endpoint = "l3", values = { "led", "incandescent", "halogen" }, }, { 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 = "backlight_mode", property = "backlight_mode", access = 3, description = "Mode of the backlight", category = "config", values = { "off", "normal", "inverted" }, }, { type = "enum", name = "backlight_color", property = "backlight_color", access = 7, description = "Backlight color", values = { "red", "blue", "green", "white", "yellow", "magenta", "cyan", "warm_white", }, }, { type = "numeric", name = "backlight_brightness", property = "backlight_brightness", access = 7, unit = "%", min = 0, max = 100, value_step = 1, description = "Backlight brightness", }, } device.tuyaDatapoints = { { dp = 1, name = "state_l1", converter = "onOff" }, { dp = 2, name = "brightness_l1", converter = "scale0_254to0_1000" }, { dp = 3, name = "min_brightness_l1", converter = "scale0_254to0_1000" }, { dp = 4, name = "light_type_l1", converter = "lightType" }, { dp = 5, name = "max_brightness_l1", converter = "scale0_254to0_1000" }, { dp = 6, name = "countdown_l1", converter = "countdown" }, { dp = 7, name = "state_l2", converter = "onOff" }, { dp = 8, name = "brightness_l2", converter = "scale0_254to0_1000" }, { dp = 9, name = "min_brightness_l2", converter = "scale0_254to0_1000" }, { dp = 10, name = "light_type_l2", converter = "lightType" }, { dp = 11, name = "max_brightness_l2", converter = "scale0_254to0_1000" }, { dp = 12, name = "countdown_l2", converter = "countdown" }, { dp = 14, name = "power_on_behavior", converter = "powerOnBehaviorEnum" }, { dp = 15, name = "state_l3", converter = "onOff" }, { dp = 16, name = "brightness_l3", converter = "scale0_254to0_1000" }, { dp = 17, name = "min_brightness_l3", converter = "scale0_254to0_1000" }, { dp = 18, name = "light_type_l3", converter = "lightType" }, { dp = 19, name = "max_brightness_l3", converter = "scale0_254to0_1000" }, { dp = 20, name = "countdown_l3", converter = "countdown" }, { dp = 21, name = "backlight_mode", converter = "backlightModeOffNormalInverted" }, { dp = 101, name = "backlight_color", converter = "lookup", lookup = { red = 0, blue = 1, green = 2, white = 3, yellow = 4, magenta = 5, cyan = 6, warm_white = 7 } }, { dp = 103, name = "backlight_brightness", converter = "raw" }, } device.meta = { multiEndpoint = true } device.endpoint = { l1 = 1, l2 = 1, l3 = 1, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_vm1gyrso", }, { model = "TS0601", manufacturer = "_TZE204_1v1dxkck", }, { model = "TS0601", manufacturer = "_TZE204_znvwzxkq", }, { model = "TS0601", manufacturer = "_TZE284_znvwzxkq", }, { model = "TS0601", manufacturer = "_TZE200_vizxbhco", }, } return device