local device = {} device.model = "QAT42Z2B" device.vendor = "QA" device.description = "2 channel scene switch" device.exposes = { { type = "switch", endpoint = "l1", features = { { type = "binary", name = "state", property = "state_l1", access = 7, 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 = 7, value_on = "ON", value_off = "OFF", description = "On/off state of the switch", endpoint = "l2", }, }, }, { type = "numeric", name = "backlight_brightness", property = "backlight_brightness", access = 7, unit = "%", min = 0, max = 99, description = "Backlight brightness (0-99)", }, { type = "enum", name = "action", property = "action", access = 1, description = "Triggered action (e.g. a button click)", category = "diagnostic", values = { "scene_1", "scene_2" }, }, } device.tuyaDatapoints = { { dp = 24, name = "state_l1", converter = "onOff" }, { dp = 25, name = "state_l2", converter = "onOff" }, { dp = 101, name = "backlight_brightness", converter = "raw" }, } device.meta = { multiEndpoint = true } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE284_1aqlsquf", }, } return device