local device = {} device.model = "TS0501B_dimmer" device.vendor = "Tuya" device.description = "Zigbee dimmer" device.exposes = { { type = "light", features = { { type = "binary", name = "state", property = "state", access = 7, value_on = "ON", value_off = "OFF", description = "On/off state of this light", }, { type = "numeric", name = "brightness", property = "brightness", access = 7, min = 0, max = 254, description = "Brightness of this light", }, { type = "numeric", name = "color_temp", property = "color_temp", access = 7, unit = "mired", min = 153, max = 500, description = "Color temperature of this light", }, }, }, { type = "binary", name = "do_not_disturb", property = "do_not_disturb", access = 3, value_on = true, value_off = false, description = "Do not disturb mode, when enabled this function will keep the light OFF after a power outage", category = "config", }, } device.fromZigbee = { "on_off", "brightness", "color_temp", "color_hs", "color_xy" } device.configure = { bind = { "genOnOff", "genLevelCtrl", "lightingColorCtrl" }, reporting = { { cluster = "genOnOff", attribute = "onOff", min = 0, max = 3600, change = 0, }, { cluster = "genLevelCtrl", attribute = "currentLevel", min = 1, max = 3600, change = 1, }, { cluster = "lightingColorCtrl", attribute = "colorTemperatureMireds", min = 1, max = 3600, change = 1, }, }, } device.fingerprint = { { model = "TS0501B", manufacturer = "_TZB210_rkgngb5o", }, } return device