local device = {} device.model = "BOT-R15W" device.vendor = "Tuya" device.description = "Beok wall thermostat (battery powered)" device.exposes = { { type = "binary", name = "child_lock", property = "child_lock", access = 3, value_on = "LOCK", value_off = "UNLOCK", description = "Enables/disables physical input on the device", }, { type = "climate", features = { { type = "enum", name = "system_mode", property = "system_mode", access = 3, description = "Mode of this device", values = { "off", "heat" }, }, { type = "enum", name = "preset", property = "preset", access = 3, description = "Mode of this device (similar to system_mode)", values = { "manual", "auto", "mixed", "away" }, }, { type = "numeric", name = "current_heating_setpoint", property = "current_heating_setpoint", access = 3, unit = "°C", min = 5, max = 35, value_step = 0.5, description = "Temperature setpoint", }, { type = "enum", name = "running_state", property = "running_state", access = 1, description = "The current running state", values = { "idle", "heat" }, }, { type = "numeric", name = "local_temperature", property = "local_temperature", access = 1, unit = "°C", description = "Current temperature measured on the device", }, { type = "numeric", name = "local_temperature_calibration", property = "local_temperature_calibration", access = 3, unit = "°C", min = -9.9, max = 9.9, value_step = 0.1, description = "Offset to add/subtract to the local temperature", }, }, }, { type = "binary", name = "frost_protection", property = "frost_protection", access = 3, value_on = "ON", value_off = "OFF", description = "Antifreeze function", }, { type = "numeric", name = "max_temperature_limit", property = "max_temperature_limit", access = 3, unit = "°C", min = 15, max = 90, value_step = 0.5, description = "Maximum upper temperature", }, { type = "numeric", name = "temperature_delta", property = "temperature_delta", access = 3, unit = "°C", min = 0.5, max = 10, value_step = 0.5, description = "Delta between local temp and setpoint to trigger heat", }, { type = "binary", name = "factory_reset", property = "factory_reset", access = 3, value_on = "ON", value_off = "OFF", description = "Full factory reset, use with caution!", }, { 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 = { "battery" } device.tuyaDatapoints = { { dp = 1, name = "system_mode", converter = "lookup" }, { dp = 2, name = "current_heating_setpoint", converter = "divideBy10" }, { dp = 3, name = "local_temperature", converter = "divideBy10" }, { dp = 4, name = "preset", converter = "lookup", lookup = { manual = 0, auto = 1, mixed = 2, away = 3 } }, { dp = 9, name = "child_lock", converter = "lockUnlock" }, { dp = 15, name = "max_temperature_limit", converter = "divideBy10" }, { dp = 19, name = "local_temperature_calibration", converter = "localTempCalibration3" }, { dp = 101, name = "running_state", converter = "lookup", lookup = { idle = 0, heat = 1 } }, { dp = 102, name = "frost_protection", converter = "onOff" }, { dp = 103, name = "factory_reset", converter = "onOff" }, { dp = 107, name = "temperature_delta", converter = "divideBy10" }, { dp = 113, name = "battery", converter = "raw" }, } device.configure = { bind = { "genPowerCfg" }, reporting = { { cluster = "genPowerCfg", attribute = "batteryPercentageRemaining", min = 3600, max = 65000, change = 0, }, { cluster = "genPowerCfg", attribute = "batteryVoltage", min = 3600, max = 65000, change = 0, }, }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE284_agcxaw3f", }, } return device