local device = {} device.model = "TS0601_thermostat_2" device.vendor = "Tuya" device.description = "Thermostat radiator valve" device.exposes = { { type = "binary", name = "battery_low", property = "battery_low", access = 1, value_on = true, value_off = false, description = "Indicates if the battery of this device is almost empty", category = "diagnostic", }, { 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 = "binary", name = "open_window", property = "open_window", access = 3, value_on = "ON", value_off = "OFF", description = "Enables/disables the status on the device", }, { type = "binary", name = "frost_protection", property = "frost_protection", access = 3, value_on = "ON", value_off = "OFF", description = "When Anti-Freezing function is activated, the temperature in the house is kept at 8 °C.", }, { type = "numeric", name = "error_status", property = "error_status", access = 1, description = "Error status", }, { 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", "holiday", "program" }, }, { type = "numeric", name = "local_temperature_calibration", property = "local_temperature_calibration", access = 3, unit = "°C", min = -5, max = 5, value_step = 0.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 = "numeric", name = "current_heating_setpoint", property = "current_heating_setpoint", access = 3, unit = "°C", min = 5, max = 30, value_step = 0.5, description = "Temperature setpoint", }, }, }, { type = "text", name = "schedule_monday", property = "schedule_monday", access = 3, description = "Schedule for monday, example: \"HH:MM/C HH:MM/C HH:MM/C HH:MM/C\"", }, { type = "text", name = "schedule_tuesday", property = "schedule_tuesday", access = 3, description = "Schedule for tuesday, example: \"HH:MM/C HH:MM/C HH:MM/C HH:MM/C\"", }, { type = "text", name = "schedule_wednesday", property = "schedule_wednesday", access = 3, description = "Schedule for wednesday, example: \"HH:MM/C HH:MM/C HH:MM/C HH:MM/C\"", }, { type = "text", name = "schedule_thursday", property = "schedule_thursday", access = 3, description = "Schedule for thursday, example: \"HH:MM/C HH:MM/C HH:MM/C HH:MM/C\"", }, { type = "text", name = "schedule_friday", property = "schedule_friday", access = 3, description = "Schedule for friday, example: \"HH:MM/C HH:MM/C HH:MM/C HH:MM/C\"", }, { type = "text", name = "schedule_saturday", property = "schedule_saturday", access = 3, description = "Schedule for saturday, example: \"HH:MM/C HH:MM/C HH:MM/C HH:MM/C\"", }, { type = "text", name = "schedule_sunday", property = "schedule_sunday", access = 3, description = "Schedule for sunday, example: \"HH:MM/C HH:MM/C HH:MM/C HH:MM/C\"", }, { type = "binary", name = "occupancy", property = "occupancy", access = 1, value_on = true, value_off = false, description = "Indicates whether the device detected occupancy", }, { type = "binary", name = "contact", property = "contact", access = 1, value_on = false, value_off = true, description = "Indicates if the contact is closed or open", }, { type = "binary", name = "tamper", property = "tamper", access = 1, value_on = true, value_off = false, description = "Indicates whether the device is tampered", }, } device.fromZigbee = { "ias_zone" } device.tuyaDatapoints = { { dp = 1, name = "system_mode", converter = "lookup" }, { dp = 2, name = "preset", converter = "lookup", lookup = { manual = 0, holiday = 1, program = 2 } }, { dp = 8, name = "open_window", converter = "onOff" }, { dp = 10, name = "frost_protection", converter = "onOff" }, { dp = 16, name = "current_heating_setpoint", converter = "divideBy10" }, { dp = 24, name = "local_temperature", converter = "divideBy10" }, { dp = 27, name = "local_temperature_calibration", converter = "localTempCalibration1" }, { dp = 35, name = "battery_low", converter = "trueFalse0" }, { dp = 40, name = "child_lock", converter = "lockUnlock" }, { dp = 45, name = "error_status", converter = "raw" }, { dp = 101, name = "schedule_monday", converter = "thermostatScheduleDayMultiDP" }, { dp = 102, name = "schedule_tuesday", converter = "thermostatScheduleDayMultiDP" }, { dp = 103, name = "schedule_wednesday", converter = "thermostatScheduleDayMultiDP" }, { dp = 104, name = "schedule_thursday", converter = "thermostatScheduleDayMultiDP" }, { dp = 105, name = "schedule_friday", converter = "thermostatScheduleDayMultiDP" }, { dp = 106, name = "schedule_saturday", converter = "thermostatScheduleDayMultiDP" }, { dp = 107, name = "schedule_sunday", converter = "thermostatScheduleDayMultiDP" }, } device.configure = { bind = { "ssIasZone" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_0hg58wyk", }, } return device