local device = {} device.model = "ZY-M100-S_2" device.vendor = "Tuya" device.description = "Mini human breathe sensor" device.exposes = { { type = "numeric", name = "illuminance", property = "illuminance", access = 1, unit = "lx", description = "Measured illuminance", }, { type = "binary", name = "presence", property = "presence", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected presence", }, { type = "numeric", name = "target_distance", property = "target_distance", access = 1, unit = "m", description = "Distance to target", }, { type = "numeric", name = "radar_sensitivity", property = "radar_sensitivity", access = 3, min = 0, max = 9, value_step = 1, description = "sensitivity of the radar", }, { type = "numeric", name = "minimum_range", property = "minimum_range", access = 3, unit = "m", min = 0, max = 9.5, value_step = 0.15, description = "Minimum range", }, { type = "numeric", name = "maximum_range", property = "maximum_range", access = 3, unit = "m", min = 0, max = 9.5, value_step = 0.15, description = "Maximum range", }, { type = "numeric", name = "detection_delay", property = "detection_delay", access = 3, unit = "s", min = 0, max = 10, value_step = 0.1, description = "Detection delay", }, { type = "numeric", name = "fading_time", property = "fading_time", access = 3, unit = "s", min = 0.5, max = 1500, value_step = 1, description = "Fading time", }, { 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", }, { type = "binary", name = "tamper", property = "tamper", access = 1, value_on = true, value_off = false, description = "Indicates whether the device is tampered", }, { type = "binary", name = "battery_low", property = "battery_low", access = 1, value_on = true, value_off = false, description = "Indicates if the battery of this device is almost empty", category = "diagnostic", }, } device.fromZigbee = { "illuminance", "ias_zone", "occupancy" } device.tuyaDatapoints = { { dp = 9, name = "target_distance", converter = "divideBy100" }, { dp = 12, name = "illuminance", converter = "raw" }, { dp = 104, name = "illuminance", converter = "raw" }, { dp = 2, name = "radar_sensitivity", converter = "raw" }, { dp = 4, name = "maximum_range", converter = "divideBy100" }, { dp = 3, name = "minimum_range", converter = "divideBy100" }, { dp = 102, name = "fading_time", converter = "divideBy10" }, { dp = 101, name = "detection_delay", converter = "divideBy10" }, } device.configure = { bind = { "msIlluminanceMeasurement", "ssIasZone", "msOccupancySensing" }, reporting = { { cluster = "msIlluminanceMeasurement", attribute = "measuredValue", min = 10, max = 3600, change = 5, }, { cluster = "msOccupancySensing", attribute = "occupancy", min = 0, max = 3600, change = 0, }, }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE204_qasjif9e", }, { model = "TS0601", manufacturer = "_TZE200_qasjif9e", }, { model = "TS0601", manufacturer = "_TZE204_ztqnh5cg", }, { model = "TS0601", manufacturer = "_TZE204_iadro9bf", }, { model = "TS0601", manufacturer = "_TZE284_iadro9bf", }, } return device