local device = {} device.model = "RD24G01" device.vendor = "Tuya" device.description = "24GHz human presence sensor" device.exposes = { { type = "enum", name = "presence_state", property = "presence_state", access = 1, description = "Presence state: none, motion, or stationary", values = { "none", "motion", "stationary" }, }, { type = "numeric", name = "target_distance_closest", property = "target_distance_closest", access = 1, unit = "m", description = "Closest target distance", }, { type = "numeric", name = "near_detection", property = "near_detection", access = 3, unit = "m", min = 0.1, max = 6, description = "Minimum detection range", }, { type = "numeric", name = "far_detection", property = "far_detection", access = 3, unit = "m", min = 0.1, max = 6, description = "Maximum detection range", }, { type = "numeric", name = "static_sensitivity", property = "static_sensitivity", access = 3, min = 0, max = 10, description = "Static presence sensitivity", }, { type = "numeric", name = "motion_sensitivity", property = "motion_sensitivity", access = 3, min = 0, max = 10, description = "Motion sensitivity", }, } device.tuyaDatapoints = { { dp = 1, name = "presence_state", converter = "lookup", lookup = { none = 0, motion = 1, stationary = 2 } }, { dp = 3, name = "near_detection", converter = "divideBy100" }, { dp = 4, name = "far_detection", converter = "divideBy100" }, { dp = 9, name = "target_distance_closest", converter = "divideBy100" }, { dp = 101, name = "static_sensitivity", converter = "raw" }, { dp = 102, name = "motion_sensitivity", converter = "raw" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE204_no6qtgtl", }, } return device