local device = {} device.model = "TS0601_thermostat_3" device.vendor = "Tuya" device.description = "Thermostatic radiator valve" 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 = "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 = "climate", features = { { type = "numeric", name = "current_heating_setpoint", property = "current_heating_setpoint", access = 3, unit = "°C", min = 5, max = 35, value_step = 1, description = "Temperature setpoint", }, { type = "numeric", name = "local_temperature", property = "local_temperature", access = 1, unit = "°C", description = "Current temperature measured on the device", }, { type = "enum", name = "system_mode", property = "system_mode", access = 3, description = "Mode of this device", values = { "auto", "heat", "off" }, }, { type = "enum", name = "running_state", property = "running_state", access = 1, description = "The current running state", values = { "idle", "heat" }, }, { type = "numeric", name = "pi_heating_demand", property = "pi_heating_demand", access = 1, unit = "%", min = 0, max = 100, description = "Position of the valve (= demanded heat) where 0% is fully closed and 100% is fully open", }, { type = "numeric", name = "local_temperature_calibration", property = "local_temperature_calibration", access = 3, unit = "°C", min = -20, max = 20, value_step = 1, description = "Offset to add/subtract to the local temperature", }, }, }, { 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 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 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 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 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 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 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 HH:MM/C HH:MM/C\"", }, { type = "binary", name = "scale_protection", property = "scale_protection", access = 3, value_on = "ON", value_off = "OFF", description = "If the heat sink is not fully opened within two weeks or is not used for a long time, the valve will be blocked due to silting up and the heat sink will not be able to be used. To ensure normal use of the heat sink, the controller will automatically open the valve fully every two weeks. It will run for 30 seconds per time with the screen displaying \"Ad\", then return to its normal working state again.", }, { type = "binary", name = "frost_protection", property = "frost_protection", access = 3, value_on = "ON", value_off = "OFF", description = "When the room temperature is lower than 5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes.", }, { type = "numeric", name = "error", property = "error", access = 1, description = "If NTC is damaged, \"Er\" will be on the TRV display.", }, { 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 = 2, name = "system_mode", converter = "lookup", lookup = { auto = 0, heat = 1, off = 2 } }, { dp = 3, name = "running_state", converter = "lookup", lookup = { heat = 0, idle = 1 } }, { dp = 4, name = "current_heating_setpoint", converter = "divideBy10" }, { dp = 5, name = "local_temperature", converter = "divideBy10" }, { dp = 7, name = "child_lock", converter = "lockUnlock" }, { dp = 36, name = "frost_protection", converter = "onOff" }, { dp = 39, name = "scale_protection", converter = "onOff" }, { dp = 47, name = "local_temperature_calibration", converter = "localTempCalibration2" }, { dp = 101, name = "pi_heating_demand", converter = "raw" }, } device.configure = { bind = { "ssIasZone" }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE200_bvu2wnxz", }, { model = "TS0601", manufacturer = "_TZE200_6rdj8dzm", }, { model = "TS0601", manufacturer = "_TZE200_9xfjixap", }, { model = "TS0601", manufacturer = "_TZE200_jkfbph7l", }, { model = "TS0601", manufacturer = "_TZE200_rxntag7i", }, { model = "TS0601", manufacturer = "_TZE200_4utwozi2", }, { model = "TS0601", manufacturer = "_TZE200_yqgbrdyo", }, { model = "TS0601", manufacturer = "_TZE284_p3dbf6qs", }, { model = "TS0601", manufacturer = "_TZE200_rxq4iti9", }, { model = "TS0601", manufacturer = "_TZE204_ogx8u5z6", }, { model = "TS0601", manufacturer = "_TZE200_4utwoz2", }, { model = "TS0601", manufacturer = "_TZE284_ogx8u5z6", }, { model = "TS0601", manufacturer = "_TZE284_o3x45p96", }, { model = "TS0601", manufacturer = "_TZE284_c6wv4xyo", }, { model = "TS0601", manufacturer = "_TZE204_o3x45p96", }, { model = "TS0601", manufacturer = "_TZE200_ow09xlxm", }, { model = "TS0601", manufacturer = "_TZE284_rv6iuyxb", }, { model = "TS0601", manufacturer = "_TZE200_rv6iuyxb", }, { model = "TS0601", manufacturer = "_TZE200_suxywabt", }, { model = "TS0601", manufacturer = "_TZE200_d3z1ukqw", }, } return device