local device = {} device.model = "E1525/E1745" device.vendor = "IKEA" device.description = "TRADFRI motion sensor" device.zigbeeModel = { "TRADFRI motion sensor" } device.exposes = { { type = "binary", name = "occupancy", property = "occupancy", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected occupancy", }, { type = "binary", name = "illuminance_above_threshold", property = "illuminance_above_threshold", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected bright light (works only in night mode)", category = "diagnostic", }, { type = "numeric", name = "requested_brightness_level", property = "requested_brightness_level", access = 1, min = 76, max = 254, category = "diagnostic", }, { type = "numeric", name = "requested_brightness_percent", property = "requested_brightness_percent", access = 1, min = 30, max = 100, category = "diagnostic", }, { type = "enum", name = "identify", property = "identify", access = 2, description = "Initiate device identification. This device is asleep by default.You may need to wake it up first before sending the identify command.", category = "config", values = { "identify" }, }, { type = "numeric", name = "battery", property = "battery", access = 5, unit = "%", min = 0, max = 100, description = "Remaining battery in %", category = "diagnostic", }, { 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 = { "on_off", "brightness", "battery", "occupancy", "ias_zone" } device.configure = { bind = { "genOnOff", "genLevelCtrl", "genPowerCfg", "msOccupancySensing", "ssIasZone" }, reporting = { { cluster = "genOnOff", attribute = "onOff", min = 0, max = 3600, change = 0, }, { cluster = "genLevelCtrl", attribute = "currentLevel", min = 1, max = 3600, change = 1, }, { cluster = "genPowerCfg", attribute = "batteryPercentageRemaining", min = 3600, max = 65000, change = 0, }, { cluster = "genPowerCfg", attribute = "batteryVoltage", min = 3600, max = 65000, change = 0, }, { cluster = "msOccupancySensing", attribute = "occupancy", min = 0, max = 3600, change = 0, }, }, } return device