local device = {} device.model = "MIR-HE200-TY" device.vendor = "Tuya" device.description = "Human presence sensor with fall function" 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 = "binary", name = "occupancy", property = "occupancy", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected occupancy", }, { type = "numeric", name = "motion_speed", property = "motion_speed", access = 1, description = "Speed of movement", }, { type = "enum", name = "motion_direction", property = "motion_direction", access = 1, description = "direction of movement from the point of view of the radar", values = { "standing_still", "moving_forward", "moving_backward" }, }, { type = "numeric", name = "radar_sensitivity", property = "radar_sensitivity", access = 3, min = 0, max = 10, value_step = 1, description = "Sensitivity of the radar", }, { type = "enum", name = "radar_scene", property = "radar_scene", access = 3, description = "Presets for sensitivity for presence and movement", values = { "default", "area", "toilet", "bedroom", "parlour", "office", "hotel", }, }, { type = "enum", name = "tumble_switch", property = "tumble_switch", access = 3, description = "Tumble status switch", values = { "ON", "OFF" }, }, { type = "numeric", name = "fall_sensitivity", property = "fall_sensitivity", access = 3, min = 1, max = 10, value_step = 1, description = "Fall sensitivity of the radar", }, { type = "numeric", name = "tumble_alarm_time", property = "tumble_alarm_time", access = 3, unit = "min", min = 1, max = 5, value_step = 1, description = "Tumble alarm time", }, { type = "enum", name = "fall_down_status", property = "fall_down_status", access = 1, description = "Fall down status", values = { "none", "maybe_fall", "fall" }, }, { type = "text", name = "static_dwell_alarm", property = "static_dwell_alarm", access = 1, description = "Static dwell alarm", }, { 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 = 1, name = "presence", converter = "trueFalse1" }, { dp = 2, name = "radar_sensitivity", converter = "raw" }, { dp = 102, name = "occupancy", converter = "trueFalse1" }, { dp = 103, name = "illuminance", converter = "raw" }, { dp = 105, name = "tumble_switch", converter = "plus1" }, { dp = 106, name = "tumble_alarm_time", converter = "raw" }, { dp = 112, name = "radar_scene", converter = "lookup", lookup = { default = 0, area = 1, toilet = 2, bedroom = 3, parlour = 4, office = 5, hotel = 6 } }, { dp = 114, name = "motion_direction", converter = "lookup", lookup = { standing_still = 0, moving_forward = 1, moving_backward = 2 } }, { dp = 115, name = "motion_speed", converter = "raw" }, { dp = 116, name = "fall_down_status", converter = "lookup", lookup = { none = 0, maybe_fall = 1, fall = 2 } }, { dp = 117, name = "static_dwell_alarm", converter = "raw" }, { dp = 118, name = "fall_sensitivity", converter = "raw" }, } 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 = "_TZE200_lu01t0zl", }, { model = "TS0601", manufacturer = "_TZE200_vrfecyku", }, { model = "TS0601", manufacturer = "_TZE200_ypprdwsl", }, { model = "TS0601", manufacturer = "_TZE200_jkbljri7", }, { model = "TS0601", manufacturer = "_TZE204_bvfld3xc", }, } return device