local device = {} device.model = "SM0212" device.vendor = "Tuya" device.description = "Gas sensor" device.zigbeeModel = { "SM0212" } device.exposes = { { type = "binary", name = "gas_alarm_1", property = "gas_alarm_1", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected gas (alarm_1)", }, { type = "binary", name = "gas_alarm_2", property = "gas_alarm_2", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected gas (alarm_2)", }, { type = "binary", name = "tamper", property = "tamper", access = 1, value_on = true, value_off = false, description = "Indicates whether the device is tampered", category = "diagnostic", }, { type = "binary", name = "battery_low", property = "battery_low", access = 1, value_on = true, value_off = false, description = "Indicates whether the battery of the device is almost empty", category = "diagnostic", }, { type = "binary", name = "occupancy", property = "occupancy", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected occupancy", }, { type = "binary", name = "contact", property = "contact", access = 1, value_on = false, value_off = true, description = "Indicates if the contact is closed or open", }, } device.fromZigbee = { "ias_zone" } device.configure = { bind = { "ssIasZone" }, } return device