local device = {} device.model = "TS0601_smoke_3" device.vendor = "Tuya" device.description = "Photoelectric smoke detector" 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 = "battery_state", property = "battery_state", access = 1, description = "State of the battery", values = { "low", "medium", "high" }, }, } device.tuyaDatapoints = { { dp = 1, name = "smoke", converter = "trueFalse0" }, { dp = 14, name = "battery_state", converter = "batteryState" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_ux5v4dbd", }, } return device