local device = {} device.model = "ZS-TYG3-SM-61Z" device.vendor = "Tuya" device.description = "Smart switch (4 gang + 2 scene) with backlight and neutral wire" device.exposes = { { type = "switch", description = "All Switches", features = { { type = "binary", name = "state", property = "state", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", }, }, }, { type = "switch", endpoint = "l1", features = { { type = "binary", name = "state", property = "state_l1", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l1", }, }, }, { type = "switch", endpoint = "l2", features = { { type = "binary", name = "state", property = "state_l2", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l2", }, }, }, { type = "switch", endpoint = "l3", features = { { type = "binary", name = "state", property = "state_l3", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l3", }, }, }, { type = "switch", endpoint = "l4", features = { { type = "binary", name = "state", property = "state_l4", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l4", }, }, }, { type = "switch", endpoint = "l5", features = { { type = "binary", name = "state", property = "state_l5", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l5", }, }, }, { type = "switch", endpoint = "l6", features = { { type = "binary", name = "state", property = "state_l6", access = 3, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l6", }, }, }, { type = "binary", name = "backlight_mode", property = "backlight_mode", access = 3, value_on = "ON", value_off = "OFF", description = "Mode of the backlight", category = "config", }, { 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 = "numeric", name = "countdown", property = "countdown_l4", access = 3, unit = "s", min = 0, max = 43200, value_step = 1, description = "Countdown to turn device off after a certain time", endpoint = "l4", }, { type = "numeric", name = "countdown", property = "countdown_l5", access = 3, unit = "s", min = 0, max = 43200, value_step = 1, description = "Countdown to turn device off after a certain time", endpoint = "l5", }, { type = "numeric", name = "countdown", property = "countdown_l6", access = 3, unit = "s", min = 0, max = 43200, value_step = 1, description = "Countdown to turn device off after a certain time", endpoint = "l6", }, { 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" }, }, } device.tuyaDatapoints = { { dp = 1, name = "state_l1", converter = "onOff" }, { dp = 2, name = "state_l2", converter = "onOff" }, { dp = 3, name = "state_l3", converter = "onOff" }, { dp = 4, name = "state_l4", converter = "onOff" }, { dp = 5, name = "state_l5", converter = "onOff" }, { dp = 6, name = "state_l6", converter = "onOff" }, { dp = 7, name = "countdown_l1", converter = "countdown" }, { dp = 8, name = "countdown_l2", converter = "countdown" }, { dp = 9, name = "countdown_l3", converter = "countdown" }, { dp = 10, name = "countdown_l4", converter = "countdown" }, { dp = 11, name = "countdown_l5", converter = "countdown" }, { dp = 12, name = "countdown_l6", converter = "countdown" }, { dp = 13, name = "state", converter = "onOff" }, { dp = 14, name = "power_on_behavior", converter = "powerOnBehaviorEnum" }, { dp = 16, name = "backlight_mode", converter = "onOff" }, } device.meta = { multiEndpoint = true } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_0j5jma9b", }, { model = "TS0601", manufacturer = "_TZE200_h2rctifa", }, } return device