local device = {} device.model = "TE-1Z" device.vendor = "Tuya" device.description = "Floor heating thermostat" device.exposes = { { type = "binary", name = "state", property = "state", access = 3, value_on = "ON", value_off = "OFF", description = "Turn system on or standby mode", }, { type = "climate", features = { { 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 = "enum", name = "preset", property = "preset", access = 3, description = "Mode of this device (similar to system_mode)", values = { "auto", "manual", "mixed" }, }, { type = "numeric", name = "local_temperature_calibration", property = "local_temperature_calibration", access = 3, unit = "°C", min = -9, max = 9, value_step = 1, description = "Offset to add/subtract to the local temperature", }, { type = "numeric", name = "local_temperature", property = "local_temperature", access = 1, unit = "°C", description = "Current temperature measured on the device", }, }, }, { 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 = "enum", name = "sensor_mode", property = "sensor_mode", access = 1, description = "IN - internal sensor, no heat protection. OU - external sensor, no heat protection. AL - internal sensor for room temperature, external for heat protection", values = { "IN", "OU", "AL" }, }, { type = "binary", name = "high_temperature_protection_state", property = "high_temperature_protection_state", access = 3, value_on = "ON", value_off = "OFF", description = "If temperature hit the HIGH temperature limit, it will turn off heating until it drops for amount of deadzone/hysteresis degrees", }, { type = "binary", name = "low_temperature_protection_state", property = "low_temperature_protection_state", access = 3, value_on = "ON", value_off = "OFF", }, { type = "numeric", name = "high_temperature_protection_setting", property = "high_temperature_protection_setting", access = 3, unit = "°C", min = 20, max = 70, description = "Alarm temperature max", }, { type = "numeric", name = "low_temperature_protection_setting", property = "low_temperature_protection_setting", access = 3, unit = "°C", min = 1, max = 10, description = "Alarm temperature min", }, { type = "numeric", name = "temperature_sensor", property = "temperature_sensor", access = 1, unit = "°C", description = "Floor temperature from external sensor", }, { type = "numeric", name = "deadzone_temperature", property = "deadzone_temperature", access = 3, unit = "°C", min = 1, max = 9, value_step = 1, description = "Hysteresis", }, { type = "numeric", name = "max_temperature", property = "max_temperature", access = 3, unit = "°C", min = 20, max = 70, description = "Maximum temperature", }, { type = "numeric", name = "error_status", property = "error_status", access = 1, description = "Error status", }, } device.tuyaDatapoints = { { dp = 16, name = "local_temperature", converter = "divideBy10" }, { dp = 50, name = "current_heating_setpoint", converter = "divideBy10" }, { dp = 102, name = "running_state", converter = "lookup" }, { dp = 103, name = "temperature_sensor", converter = "divideBy10" }, { dp = 106, name = "high_temperature_protection_state", converter = "onOff" }, { dp = 107, name = "low_temperature_protection_state", converter = "onOff" }, { dp = 109, name = "local_temperature_calibration", converter = "localTempCalibration3" }, { dp = 110, name = "temperature_return_difference", converter = "raw" }, { dp = 111, name = "deadzone_temperature", converter = "raw" }, { dp = 112, name = "high_temperature_protection_setting", converter = "raw" }, { dp = 113, name = "low_temperature_protection_setting", converter = "raw" }, { dp = 114, name = "max_temperature", converter = "raw" }, { dp = 116, name = "sensor_mode", converter = "lookup", lookup = { IN = 0, OU = 1, AL = 2 } }, { dp = 125, name = "system_mode", converter = "onOff" }, { dp = 125, name = "state", converter = "onOff" }, { dp = 128, name = "preset", converter = "lookup", lookup = { manual = 0, auto = 1, mixed = 3 } }, { dp = 129, name = "child_lock", converter = "lockUnlock" }, { dp = 130, name = "error_status", converter = "raw" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE284_khah2lkr", }, } return device