zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Tuya TRV603-WZ thermostat problems with Z2M 2.7.1

Open StefanDierkes opened this issue 11 months ago • 5 comments

What happened?

I use four Tuya TRV603-WZ radiator thermostats. With Zigbee2MQTT version 2.7.1 the following new problems occur:

  • entity "mode selection (auto, manual)" does not exist any more
  • the thermostats do not react to changes of the target temperature
  • the heating-on-button is missing in the HA thermostat card
  • one thermostat lost connection.

Restoring the backup to version 2.7.0 solved these problems.

What did you expect to happen?

No changes of my running devices.

How to reproduce it (minimal and precise)

Install Z2M 2.7.1 coming from 2.7.0

Zigbee2MQTT version

2.7.1

Adapter firmware version

Sorry, no such field; where can I find it in HA 2025.12.3?

Adapter

EZSP v13 Revision: 7.4.4.5 build 0

Setup

  • Home Assistant Yellow
  • Z2M add-on via HACS

Device database.db entry

Where can I find it?

Debug log

No response

Notes

No response

StefanDierkes avatar Dec 16 '25 11:12 StefanDierkes

Tuya TS0601 is generic name,well need the exact model or string

badr-ctrl avatar Dec 16 '25 14:12 badr-ctrl

Sorry, my fault. I copied the wrong field ('Zigbee Model' instead of 'Model') from the device info. The model name should be Tuya TRV603-WZ, which is this thermostat: https://www.zigbee2mqtt.io/devices/TRV603-WZ.html#tuya-trv603-wz

I have corrected it in my text and the title above.

StefanDierkes avatar Dec 16 '25 15:12 StefanDierkes

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] avatar Feb 15 '26 00:02 github-actions[bot]

Hi @StefanDierkes,

I noticed the changes in the 2.7.1 update as well.

The new logic changed how the device controls are exposed. While this might be intended, I personally prefer the previous behavior with strictly Off / Heat / Auto modes and standard Presets.

I created a custom external converter to restore that specific workflow, as it fits my daily usage better.

Feel free to try it if you prefer this setup too.

Note: To get the Schedule reading correctly (and fix the weird values), you will likely need to delete the device and re-pair it once after loading this converter.

Save this as TRV603_fix.js in your external_converters folder:

const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE284_ymldrmzx'}],
    model: 'TRV603-WZ',
    vendor: 'Tuya',
    description: 'TRV603 Fixed (Holiday, Off, Virtual Eco/Comfort, Boost)',
    
    fromZigbee: [tuya.fz.datapoints],
    
    toZigbee: [
        {
            key: ['system_mode'],
            convertSet: async (entity, key, value, meta) => {
                // Safety: Turn off boost when changing mode
                await tuya.sendDataPointBool(entity, 101, false);

                if (value === 'off') {
                    // Real OFF via DP 113
                    await tuya.sendDataPointBool(entity, 113, true);
                    return {state: {system_mode: 'off'}};
                }
                
                // Ensure device is ON (DP 113 = false)
                await tuya.sendDataPointBool(entity, 113, false);
                
                if (value === 'auto') {
                    // Auto = Schedule (DP 2 = 0)
                    await tuya.sendDataPointEnum(entity, 2, 0);
                    return {state: {system_mode: 'auto', preset: 'schedule'}};
                } 
                else if (value === 'heat') {
                    // Heat = Manual (DP 2 = 2)
                    await tuya.sendDataPointEnum(entity, 2, 2);
                    return {state: {system_mode: 'heat', preset: 'manual'}};
                }
            }
        },
        {
            key: ['preset'],
            convertSet: async (entity, key, value, meta) => {
                // 1. BOOST HANDLER
                if (value === 'boost') {
                    await tuya.sendDataPointBool(entity, 113, false);
                    await tuya.sendDataPointBool(entity, 101, true);
                    return {state: {preset: 'boost', system_mode: 'heat', boost_heating: 'ON'}};
                }

                // Cleanup Boost & Off
                await tuya.sendDataPointBool(entity, 101, false);
                await tuya.sendDataPointBool(entity, 113, false);

                // 2. VIRTUAL ECO / COMFORT (Write-only logic)
                // Device displays icon if Manual Mode + Setpoint matches internal Eco/Comfort temp
                if (value === 'eco' || value === 'comfort') {
                    await tuya.sendDataPointEnum(entity, 2, 2); // Force Manual
                    
                    const tempKey = value === 'eco' ? 'eco_temperature' : 'comfort_temperature';
                    const defaultTemp = value === 'eco' ? 18 : 22;
                    // Get temp from state or fallback
                    const targetTemp = (meta.state && meta.state[tempKey]) ? meta.state[tempKey] : defaultTemp;
                    
                    await tuya.sendDataPointValue(entity, 4, targetTemp * 10);

                    return {
                        state: {
                            preset: value, 
                            system_mode: 'heat', 
                            current_heating_setpoint: targetTemp,
                            boost_heating: 'OFF'
                        }
                    };
                }

                // 3. STANDARD PRESETS
                const lookup = {'schedule': 0, 'holiday': 1, 'manual': 2};
                if (lookup[value] !== undefined) {
                    await tuya.sendDataPointEnum(entity, 2, lookup[value]);
                    const newMode = value === 'schedule' ? 'auto' : 'heat';
                    return {state: {preset: value, system_mode: newMode, boost_heating: 'OFF'}};
                }
            }
        },
        {
            key: ['boost_heating'],
            convertSet: async (entity, key, value, meta) => {
                await tuya.sendDataPointBool(entity, 101, value === 'ON');
                return {state: {boost_heating: value, preset: value === 'ON' ? 'boost' : 'manual'}};
            }
        },
        tuya.tz.datapoints
    ],
    
    onEvent: tuya.onEventSetLocalTime,
    
    exposes: [
        e.battery(), e.child_lock(), e.window_detection_bool(), e.window_open(),
        e.climate()
            .withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
            .withLocalTemperature(ea.STATE)
            .withLocalTemperatureCalibration(-7, 7, 0.5, ea.STATE_SET)
            .withSystemMode(['off', 'heat', 'auto'], ea.STATE_SET)
            .withPreset(['schedule', 'manual', 'holiday', 'comfort', 'eco', 'boost'], ea.STATE_SET),
        e.comfort_temperature().withValueMin(15).withValueMax(35),
        e.eco_temperature().withValueMin(5).withValueMax(22),
        e.holiday_temperature().withValueMin(5).withValueMax(35),
        e.text('holiday_time', ea.STATE_SET).withDescription('Format: YYYY/MM/DD HH:MM | YYYY/MM/DD HH:MM'),
        e.binary('boost_heating', ea.STATE_SET, 'ON', 'OFF'),
        e.numeric('boost_time', ea.STATE_SET).withUnit('min').withValueMin(0).withValueMax(30),
        e.binary('frost_protection', ea.STATE_SET, 'ON', 'OFF'),
        ...['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'].map((day) => e.text(`schedule_${day}`, ea.STATE_SET)),
        e.enum('screen_orientation', ea.STATE_SET, ['up', 'right', 'down', 'left']),
        e.numeric('fault_code', ea.STATE)
    ],
    
    meta: {
        tuyaDatapoints: [
            // DP 2: Standard mapping for reading
            [
                2, 
                null, 
                tuya.valueConverter.thermostatSystemModeAndPresetMap({
                    fromMap: {
                        0: {systemMode: 'auto', preset: 'schedule'},
                        1: {systemMode: 'auto', preset: 'holiday'},
                        2: {systemMode: 'heat', preset: 'manual'},
                        5: {systemMode: 'heat', preset: 'boost'}
                    }
                })
            ],
            // DP 101: Boost Status reading
            [101, 'boost_heating', { 
                from: (v) => { return { boost_heating: v ? 'ON' : 'OFF', preset: v ? 'boost' : undefined } } 
            }],
            // DP 113: Off Status reading
            [113, 'system_mode', { from: (v) => v ? 'off' : 'heat' }],
            
            [4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
            [5, 'local_temperature', tuya.valueConverter.divideBy10],
            [6, 'battery', tuya.valueConverter.raw],
            [7, 'child_lock', tuya.valueConverter.lockUnlock],
            [14, 'window_detection', tuya.valueConverter.onOff],
            [15, 'window_open', tuya.valueConverter.trueFalseEnum1],
            [21, 'holiday_temperature', tuya.valueConverter.divideBy10],
            [36, 'frost_protection', tuya.valueConverter.onOff],
            [47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration1],
            [102, 'boost_time', tuya.valueConverter.countdown],
            [103, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
            [104, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
            [105, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
            [106, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
            [107, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
            [108, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
            [109, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDP_TRV603WZ],
            // FIX: Use Unix Timestamp for Holiday Time to avoid garbage characters
            [110, 'holiday_time', tuya.valueConverter.thermostatHolidayStartStopUnixTS],
            [111, 'screen_orientation', tuya.valueConverterBasic.lookup({up: tuya.enum(0), right: tuya.enum(1), down: tuya.enum(2), left: tuya.enum(3)})],
            [112, 'antifrost_temperature', tuya.valueConverter.divideBy10],
            [114, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration1],
            [116, 'eco_temperature', tuya.valueConverter.divideBy10],
            [117, 'comfort_temperature', tuya.valueConverter.divideBy10],
            [118, 'fault_code', tuya.valueConverter.raw]
        ]
    }
};

module.exports = definition;

ff12 avatar Feb 22 '26 07:02 ff12

Hi @ff12,

Thank you for your workaround!

I have now updated Zigbee2MQTT and gotten used to the new operating logic. Therefore I close this issue.

StefanDierkes avatar Mar 01 '26 16:03 StefanDierkes