local device = {} device.model = "PA-44Z" 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 = "numeric", name = "battery", property = "battery", access = 1, unit = "%", min = 0, max = 100, description = "Remaining battery in %, can take up to 24 hours before reported", category = "diagnostic", }, { type = "binary", name = "silence", property = "silence", access = 3, value_on = true, value_off = false, description = "Silence the alarm", }, { type = "binary", name = "test", property = "test", access = 1, value_on = true, value_off = false, description = "Indicates whether the device is being tested", }, { type = "numeric", name = "smoke_concentration", property = "smoke_concentration", access = 1, unit = "ppm", description = "Parts per million of smoke detected", }, { type = "binary", name = "device_fault", property = "device_fault", access = 1, value_on = true, value_off = false, description = "Indicates a fault with the device", }, } device.fromZigbee = { "battery" } device.tuyaDatapoints = { { dp = 1, name = "smoke", converter = "trueFalse0" }, { dp = 2, name = "smoke_concentration", converter = "divideBy10" }, { dp = 11, name = "device_fault", converter = "raw" }, { dp = 15, name = "battery", converter = "raw" }, { dp = 16, name = "silence", converter = "raw" }, { dp = 101, name = "test", converter = "raw" }, } device.configure = { bind = { "genPowerCfg" }, reporting = { { cluster = "genPowerCfg", attribute = "batteryPercentageRemaining", min = 3600, max = 65000, change = 0, }, { cluster = "genPowerCfg", attribute = "batteryVoltage", min = 3600, max = 65000, change = 0, }, }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_m9skfctm", }, { model = "TS0601", manufacturer = "_TZE200_rccxox8p", }, { model = "TS0601", manufacturer = "_TZE284_rccxox8p", }, } return device