local device = {} device.model = "THS317-ET-TY" device.vendor = "Tuya" device.description = "Temperature sensor with probe" device.exposes = { { type = "numeric", name = "temperature", property = "temperature", access = 1, unit = "°C", description = "Measured temperature value", }, { 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", }, } device.fromZigbee = { "temperature", "battery" } device.tuyaDatapoints = { { dp = 1, name = "temperature", converter = "divideBy10" }, { dp = 4, name = "battery", converter = "raw" }, } device.configure = { bind = { "msTemperatureMeasurement", "genPowerCfg" }, reporting = { { cluster = "msTemperatureMeasurement", 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, }, }, } device.fingerprint = { { model = "TS0201", manufacturer = "_TZE200_iq4ygaai", }, { model = "TS0201", manufacturer = "_TZE200_01fvxamo", }, } return device