local device = {} device.model = "TS0601_gas_sensor_1" device.vendor = "Tuya" device.description = "Gas sensor" device.exposes = { { type = "binary", name = "gas", property = "gas", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected gas", }, { type = "binary", name = "self_test", property = "self_test", access = 3, value_on = true, value_off = false, description = "Indicates whether the device is being self-tested", }, { type = "enum", name = "self_test_result", property = "self_test_result", access = 1, description = "Result of the self-test", values = { "checking", "success", "failure", "others" }, }, { type = "binary", name = "fault_alarm", property = "fault_alarm", access = 1, value_on = true, value_off = false, description = "Indicates whether a fault was detected", }, { type = "binary", name = "silence", property = "silence", access = 3, value_on = true, value_off = false, description = "Silence the alarm", }, } device.tuyaDatapoints = { { dp = 1, name = "gas", converter = "trueFalse0" }, { dp = 8, name = "self_test", converter = "raw" }, { dp = 9, name = "self_test_result", converter = "selfTestResult" }, { dp = 11, name = "fault_alarm", converter = "trueFalse1" }, { dp = 16, name = "silence", converter = "raw" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_ggev5fsl", }, { model = "TS0601", manufacturer = "_TZE200_u319yc66", }, { model = "TS0601", manufacturer = "_TZE200_kvpwq8z7", }, { model = "TS0601", manufacturer = "_TZE204_kvpwq8z7", }, } return device