local device = {} device.model = "TS0601_smoke_mimdrg5y" device.vendor = "Tuya" device.description = "Smoke sensor" -- Not in zigbee-herdsman-converters. DP table from the Tuya thing model. -- Tuya enum DPs carry the 0-based index into the model's value list. device.exposes = { { type = "binary", name = "smoke", property = "smoke", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected smoke", }, { type = "enum", name = "self_test_result", property = "self_test_result", access = 1, description = "Result of the last self-test", values = { "checking", "check_success", "check_failure" }, }, { type = "enum", name = "battery_state", property = "battery_state", access = 1, description = "State of the battery", values = { "low", "medium", "high", "full" }, }, { type = "enum", name = "sensor_state", property = "sensor_state", access = 1, description = "Alarm device state", values = { "normal", "fault", "low_battery", "muted" }, category = "diagnostic", }, } device.tuyaDatapoints = { -- smoke_sensor_state: 0 = "1" alarm, 1 = "2" no smoke { dp = 1, name = "smoke", converter = "trueFalse0", access = "r" }, { dp = 9, name = "self_test_result", converter = "lookup", access = "r", lookup = { checking = 0, check_success = 1, check_failure = 2 } }, -- battery_state: like batteryState but with an extra "full" value { dp = 14, name = "battery_state", converter = "lookup", access = "r", lookup = { low = 0, medium = 1, high = 2, full = 3 } }, -- sensor_state: "01" normal, "02" fault, "03" low battery, "04" muted { dp = 101, name = "sensor_state", converter = "lookup", access = "r", lookup = { normal = 0, fault = 1, low_battery = 2, muted = 3 } }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_mimdrg5y", }, } return device