local device = {} device.model = "WSDCGQ01LM" device.vendor = "Xiaomi" device.description = "Mi temperature and humidity sensor" device.zigbeeModel = { "lumi.sens", "lumi.sensor_ht" } device.exposes = { { type = "numeric", name = "battery", property = "battery", access = 1, unit = "%", min = 0, max = 100, description = "Remaining battery in %, can take up to 24 hours before reported", category = "diagnostic", }, { type = "numeric", name = "temperature", property = "temperature", access = 1, unit = "°C", description = "Measured temperature value", }, { type = "numeric", name = "humidity", property = "humidity", access = 1, unit = "%", description = "Measured relative humidity", }, { type = "numeric", name = "voltage", property = "voltage", access = 1, unit = "mV", description = "Voltage of the battery in millivolts", category = "diagnostic", }, } device.fromZigbee = { "temperature", "humidity", "battery", "electrical" } device.configure = { bind = { "msTemperatureMeasurement", "msRelativeHumidity", "genPowerCfg", "haElectricalMeasurement" }, reporting = { { cluster = "msTemperatureMeasurement", attribute = "measuredValue", min = 10, max = 3600, change = 100, }, { cluster = "msRelativeHumidity", attribute = "measuredValue", min = 10, max = 3600, change = 100, }, { cluster = "genPowerCfg", attribute = "batteryPercentageRemaining", min = 3600, max = 65000, change = 0, }, { cluster = "genPowerCfg", attribute = "batteryVoltage", min = 3600, max = 65000, change = 0, }, { cluster = "haElectricalMeasurement", attribute = "activePower", min = 5, max = 3600, change = 1, }, { cluster = "haElectricalMeasurement", attribute = "rmsVoltage", min = 5, max = 3600, change = 5, }, { cluster = "haElectricalMeasurement", attribute = "rmsCurrent", min = 5, max = 3600, change = 100, }, }, } return device