local device = {} device.model = "gq8b1uv" device.vendor = "Tuya" device.description = "Zigbee smart dimmer" device.zigbeeModel = { "gq8b1uv" } 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", }, }, }, } device.tuya = { magicPacket = true, } device.tuyaDatapoints = { { dp = 1, name = "state", converter = "onOff" }, { dp = 2, name = "brightness", converter = "mapNumberRange", range = { 10, 1000, 0, 254 } }, } return device