local device = {} device.model = "ZG-225Z" device.vendor = "Tuya" device.description = "Gas sensor" device.zigbeeModel = { "ZG-225Z" } device.exposes = { { type = "binary", name = "gas", property = "gas", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected gas", }, { type = "numeric", name = "gas_value", property = "gas_value", access = 1, unit = "ppm", description = "Measured gas concentration", }, { type = "enum", name = "sensitivity", property = "sensitivity", access = 3, description = "Gas sensor sensitivity", values = { "low", "medium", "high" }, }, { type = "enum", name = "ring", property = "ring", access = 3, description = "Ring", values = { "ring1", "ring2" }, }, } device.tuyaDatapoints = { { dp = 1, name = "gas", converter = "trueFalse0" }, { dp = 2, name = "gas_value", converter = "raw" }, { dp = 101, name = "sensitivity", converter = "lookup", lookup = { low = 0, medium = 1, high = 2 } }, { dp = 6, name = "ring", converter = "lookup", lookup = { ring1 = 0, ring2 = 1 } }, } return device