local device = {} device.model = "SZT06 V2.0" device.vendor = "Tuya" device.description = "Smart mini temperature and humidity sensor" device.exposes = { { type = "numeric", name = "temperature", property = "temperature", access = 5, unit = "°C", description = "Measured temperature value", }, { type = "numeric", name = "humidity", property = "humidity", access = 5, unit = "%", description = "Measured relative humidity", }, { 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 = "numeric", name = "voltage", property = "voltage", access = 5, unit = "mV", description = "Reported battery voltage 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, }, }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZ3000_kkerjand", }, } return device