local device = {} device.model = "ZG-WK-DA-Wh-Zigbee" device.vendor = "Tuya" device.description = "Wall thermostat with humidity sensor" device.exposes = { { type = "numeric", name = "humidity", property = "humidity", access = 1, unit = "%", description = "Measured relative humidity", }, { 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" }, }, { 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, max = 9, value_step = 1, description = "Offset to add/subtract to the local temperature", }, }, }, } device.fromZigbee = { "humidity" } 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 } }, { dp = 9, name = "child_lock", converter = "lockUnlock" }, { dp = 102, name = "running_state", converter = "lookup", lookup = { heat = 0, idle = 1 } }, } device.configure = { bind = { "msRelativeHumidity" }, reporting = { { cluster = "msRelativeHumidity", attribute = "measuredValue", min = 10, max = 3600, change = 100, }, }, } device.fingerprint = { { model = "TS0601", manufacturer = "_TZE204_atdqo4nj", }, } return device