local device = {} device.model = "SZR07U" device.vendor = "Tuya" device.description = "24GHz millimeter wave radar" device.exposes = { { type = "binary", name = "presence", property = "presence", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected presence", }, { type = "numeric", name = "detection_range", property = "detection_range", access = 3, unit = "m", min = 1.5, max = 6, value_step = 0.75, description = "Maximum range", }, { type = "numeric", name = "radar_sensitivity", property = "radar_sensitivity", access = 3, min = 68, max = 90, value_step = 1, description = "Sensitivity of the radar", }, { type = "numeric", name = "target_distance", property = "target_distance", access = 1, unit = "cm", min = 0, max = 1000, value_step = 1, description = "Distance of detected target", }, { type = "binary", name = "indicator", property = "indicator", access = 3, value_on = "ON", value_off = "OFF", description = "LED indicator", }, { type = "numeric", name = "fading_time", property = "fading_time", access = 3, unit = "s", min = 3, max = 1799, 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 = { "ias_zone", "occupancy" } device.tuyaDatapoints = { { dp = 1, name = "presence", converter = "trueFalse1" }, { dp = 13, name = "detection_range", converter = "divideBy100" }, { dp = 16, name = "radar_sensitivity", converter = "raw" }, { dp = 19, name = "target_distance", converter = "raw" }, { dp = 101, name = "indicator", converter = "onOff" }, { dp = 103, name = "fading_time", converter = "raw" }, } device.configure = { bind = { "ssIasZone", "msOccupancySensing" }, reporting = { { cluster = "msOccupancySensing", attribute = "occupancy", min = 0, max = 3600, change = 0, }, }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE204_muvkrjr5", }, } return device