local device = {} device.model = "TS0601_motion_sensor" device.vendor = "Tuya" device.description = "Human presence sensor AIR" device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_auin8mzr", }, } device.exposes = { { type = "binary", name = "occupancy", property = "occupancy", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected occupancy", }, { type = "enum", name = "o_sensitivity", property = "o_sensitivity", access = 3, description = "O-Sensitivity mode", values = { "sensitive", "normal", "cautious" }, }, { type = "enum", name = "v_sensitivity", property = "v_sensitivity", access = 3, description = "V-Sensitivity mode", values = { "speed_priority", "normal_priority", "accuracy_priority" }, }, { type = "enum", name = "led_status", property = "led_status", access = 3, description = "Led status switch", values = { "ON", "OFF" }, }, { type = "numeric", name = "vacancy_delay", property = "vacancy_delay", access = 3, unit = "sec", min = 0, max = 1000, description = "Vacancy delay", }, { type = "numeric", name = "light_on_luminance_prefer", property = "light_on_luminance_prefer", access = 3, min = 0, max = 10000, description = "Light-On luminance prefer", }, { type = "numeric", name = "light_off_luminance_prefer", property = "light_off_luminance_prefer", access = 3, min = 0, max = 10000, description = "Light-Off luminance prefer", }, { type = "enum", name = "mode", property = "mode", access = 3, description = "Working mode", values = { "general_model", "temporaty_stay", "basic_detection", "sensor_test" }, }, { type = "numeric", name = "luminance_level", property = "luminance_level", access = 1, description = "Luminance level", }, { type = "numeric", name = "reference_luminance", property = "reference_luminance", access = 1, description = "Reference luminance", }, { type = "numeric", name = "vacant_confirm_time", property = "vacant_confirm_time", access = 1, description = "Vacant confirm time", }, { 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 = { "occupancy", "ias_zone" } device.tuyaDatapoints = { { dp = 1, name = "occupancy", converter = "trueFalse1" }, } device.configure = { bind = { "msOccupancySensing", "ssIasZone" }, reporting = { { cluster = "msOccupancySensing", attribute = "occupancy", min = 0, max = 3600, change = 0, }, }, } return device