local device = {} device.model = "THE01860A" device.vendor = "Tuya" device.description = "Temp & humidity flower sensor with illuminance" 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 = "illuminance", property = "illuminance", access = 5, unit = "lx", description = "Measured illuminance", }, } device.fromZigbee = { "humidity", "battery", "temperature", "illuminance" } device.configure = { bind = { "msRelativeHumidity", "genPowerCfg", "msTemperatureMeasurement", "msIlluminanceMeasurement" }, reporting = { { 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 = "msTemperatureMeasurement", attribute = "measuredValue", min = 10, max = 3600, change = 100, }, { cluster = "msIlluminanceMeasurement", attribute = "measuredValue", min = 10, max = 3600, change = 5, }, }, } device.fingerprint = { { model = "TS0222", manufacturer = "_TZ3000_t9qqxn70", }, } return device