zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support]: Tuya thermostat TS0601 _TZE204_pcdmj88b

Open Tilt7238 opened this issue 3 years ago • 53 comments

Link

https://de.aliexpress.com/item/1005006066560400.html

Database entry

{"id":7,"type":"EndDevice","ieeeAddr":"0xa4c138c059067de9","nwkAddr":46572,"manufId":4417,"manufName":"_TZE204_pcdmj88b","powerSource":"Battery","modelId":"TS0601","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65506":56,"65508":0,"appVersion":73,"modelId":"TS0601","manufacturerName":"_TZE204_pcdmj88b","powerSource":3,"zclVersion":3,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":73,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1698512485137,"defaultSendRequestWhen":"immediate"}

Comments

I bought 2 of these thermostats and tried it with the existing TV02-Zigbee external converter in Tuya.ts , but it didn't work. I also tried the converter below which I found in another issue

External converter

const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const legacy = require('zigbee-herdsman-converters/lib/legacy');
const extend = require('zigbee-herdsman-converters/lib/extend');
const ota = require('zigbee-herdsman-converters/lib/ota');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const utils = require('zigbee-herdsman-converters/lib/utils');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    fingerprint: [
        {modelID: 'TS0601', manufacturerName: '_TZE200_a4bpgplm'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_dv8abrrz'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_z1tyspqw'},
        {modelID: 'TS0601', manufacturerName: '_TZE200_rtrmfadk'},
    ],
    model: 'TS0601_thermostat_1',
    vendor: 'TuYa',
    description: 'Thermostatic radiator valve',
    whiteLabel: [
        {vendor: 'Unknown/id3.pl', model: 'GTZ06'},
    ],
    onEvent: tuya.onEventSetLocalTime,
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    configure: tuya.configureMagicPacket,
    exposes: [
        e.battery(), e.child_lock(), e.max_temperature(), e.min_temperature(),
        e.position(), e.window_detection(),
        e.binary('window', ea.STATE, 'CLOSED', 'OPEN').withDescription('Window status closed or open '),
        e.binary('alarm_switch', ea.STATE, 'ON', 'OFF').withDescription('Thermostat in error state'),
        e.climate()
            .withLocalTemperature(ea.STATE).withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
            .withLocalTemperatureCalibration(-30, 30, 0.1, ea.STATE_SET)
            .withPreset(['auto', 'manual', 'off', 'on'],
                'MANUAL MODE ☝ - In this mode, the device executes manual temperature setting. ' +
            'When the set temperature is lower than the "minimum temperature", the valve is closed (forced closed). ' +
            'AUTO MODE ⏱ - In this mode, the device executes a preset week programming temperature time and temperature. ' +
            'ON - In this mode, the thermostat stays open ' +
            'OFF - In this mode, the thermostat stays closed')
            .withSystemMode(['auto', 'heat', 'off'], ea.STATE)
            .withRunningState(['idle', 'heat'], ea.STATE),
        ...tuya.exposes.scheduleAllDays(ea.STATE_SET, 'HH:MM/C HH:MM/C HH:MM/C HH:MM/C'),
        e.binary('boost_heating', ea.STATE_SET, 'ON', 'OFF')
            .withDescription('Boost Heating: press and hold "+" for 3 seconds, ' +
            'the device will enter the boost heating mode, and the ▷╵◁ will flash. The countdown will be displayed in the APP'),
        e.numeric('boost_time', ea.STATE_SET).withUnit('min').withDescription('Countdown in minutes')
            .withValueMin(0).withValueMax(1000),
    ],
    meta: {
        tuyaDatapoints: [
            [1, null,
                {
                    from: (v) => {
                        utils.assertNumber(v, 'system_mode');
                        const presetLookup = {0: 'auto', 1: 'manual', 2: 'off', 3: 'on'};
                        const systemModeLookup = {0: 'auto', 1: 'auto', 2: 'off', 3: 'heat'};
                        return {preset: presetLookup[v], system_mode: systemModeLookup[v]};
                    },
                },
            ],
            [1, 'system_mode', tuya.valueConverterBasic.lookup({'auto': tuya.enum(1), 'off': tuya.enum(2), 'heat': tuya.enum(3)})],
            [1, 'preset', tuya.valueConverterBasic.lookup(
                {'auto': tuya.enum(0), 'manual': tuya.enum(1), 'off': tuya.enum(2), 'on': tuya.enum(3)})],
            [2, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
            [3, 'local_temperature', tuya.valueConverter.divideBy10],
            [4, 'boost_heating', tuya.valueConverter.onOff],
            [5, 'boost_time', tuya.valueConverter.countdown],
            [6, 'running_state', tuya.valueConverterBasic.lookup({'heat': 1, 'idle': 0})],
            [7, 'window', tuya.valueConverterBasic.lookup({'OPEN': 1, 'CLOSE': 0})],
            [8, 'window_detection', tuya.valueConverter.onOff],
            [12, 'child_lock', tuya.valueConverter.lockUnlock],
            [13, 'battery', tuya.valueConverter.raw],
            [14, 'alarm_switch', tuya.valueConverter.onOff],
            [15, 'min_temperature', tuya.valueConverter.divideBy10],
            [16, 'max_temperature', tuya.valueConverter.divideBy10],
            [17, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1)],
            [18, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2)],
            [19, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3)],
            [20, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4)],
            [21, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5)],
            [22, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6)],
            [23, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7)],
            [101, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration1],
            [102, 'position', tuya.valueConverter.divideBy10],
        ],
    },
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

Tilt7238 avatar Oct 28 '23 17:10 Tilt7238

Same issue, I ordered the zigbee gateway so I can map the correct data. The expected delivery will be by the end of next week.

If I find time and the correct mapping data i will try to contribute it so others can use is too.

ha-jos avatar Nov 01 '23 13:11 ha-jos

I'm very much intersted as I bought multiple of these radiator valves and can't use them right now :( I'd love to help in any way but I don't have a tuya gateway nor the knowledge to developp an adapter for new devices.

I'll follow this thread with care though!

T0ytoy avatar Nov 07 '23 00:11 T0ytoy

I'm interested too ! Thanks in advance if you find the way to bring compatibility !

Erwsaym avatar Nov 07 '23 18:11 Erwsaym

I have a tuya zigbee gateway and followed the steps outlined in the zigbee2mqtt wiki to Find Tuya Datapoints

Through this I obtained the following data points for _TZE204_pcdmj88b thermostat:

{
  "2": "Mode",
  "4": "Set temperature",
  "5": "Current temperature",
  "6": "Battery capacity",
  "7": "Child lock",
  "8": "Temperature scale",
  "9": "Set temperature ceiling",
  "10": "The lower limit of temperature",
  "14": "Window check",
  "16": "Window temp",
  "17": "Window time",
  "18": "Backlight brightness",
  "19": "Factory data reset",
  "21": "Holiday temperature",
  "24": "Home temp",
  "25": "Leave temp",
  "28": "Week program",
  "29": "Week program Tuesday",
  "30": "Week program Wednesday",
  "31": "Week program Thursday",
  "32": "Week program Friday",
  "33": "Week program Saturday",
  "34": "Week program Sunday",
  "35": "Fault alarm",
  "36": "Frost protection",
  "37": "Rapid warming",
  "38": "Rapid heating countdown",
  "39": "Switch Scale",
  "47": "Temperature correction",
  "48": "Valve testing",
  "49": "State of the valve",
  "101": "111"
}

I will try to write an external converter myself, but I am not sure if i can do it :)

jim-fx avatar Nov 08 '23 22:11 jim-fx

Thanks a lot for spending time on this, I'm really glad! I'll try and look how to make a converter, but I welcome anyone more experimented to beat me to it!

T0ytoy avatar Nov 08 '23 23:11 T0ytoy

Here is mine

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: '_TZE204_pcdmj88b'},
        ],
        model: 'TS0601_thermostat_3',
        vendor: 'TuYa',
        description: 'Thermostatic radiator valve',
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        onEvent: tuya.onEventSetTime,
        configure: tuya.configureMagicPacket,
        exposes: [
            e.child_lock(), e.battery_low(),
            e.climate()
                .withSetpoint('current_heating_setpoint', 5, 35, 1, ea.STATE_SET)
                .withLocalTemperature(ea.STATE)
                .withSystemMode(['auto', 'heat', 'off'], ea.STATE_SET)
                .withRunningState(['idle', 'heat'], ea.STATE)
                .withLocalTemperatureCalibration(-3, 3, 1, ea.STATE_SET),
            ...tuya.exposes.scheduleAllDays(ea.STATE_SET, 'HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C'),
            e.binary('scale_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('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.'),
            e.binary('frost_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('When the room temperature is lower than ' +
                '5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes.'),
            e.numeric('error', ea.STATE).withDescription('If NTC is damaged, "Er" will be on the TRV display.'),
        ],
        meta: {
            tuyaDatapoints: [
                [2, 'system_mode', tuya.valueConverterBasic.lookup({'auto': tuya.enum(0), 'heat': tuya.enum(1), 'off': tuya.enum(2)})],
                [4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
                [5, 'local_temperature', tuya.valueConverter.divideBy10],
                [6, 'battery', tuya.valueConverter.raw],
                [7, 'child_lock', tuya.valueConverter.lockUnlock],
                [28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1)],
                [29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2)],
                [30, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3)],
                [31, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4)],
                [32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5)],
                [33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6)],
                [34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7)],
                [35, 'fault_alarm', tuya.valueConverter.errorOrBatteryLow],
                [36, 'frost_protection', tuya.valueConverter.onOff],
                [39, 'scale_protection', tuya.valueConverter.onOff],
                [47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration2],
                [49, 'valve_state', tuya.valueConverterBasic.lookup({'closed': tuya.enum(0), 'open': tuya.enum(1)})],
            ],
        },
    };

module.exports = definition;

Works/tested:

  • changing target temp current_heating_setpoint
  • collecting current temp local_temperature
  • valve state valve_state open/closed

Caveats

  • reused model/image 'TS0601_thermostat_3'
  • schedule not tested
  • system_mode looks like preset

tnako avatar Nov 09 '23 08:11 tnako

@tnako thank you very much for implementing the converter, I tested it and can confirm that changing target temperature works and triggers the valve. Local temperature is fine too and it can be adjusted +/-3°C. With that and some Home Assistant automation, I think we can pretty much do anything.

It would be perfect if we could directly act on the valve state (percentage opened ?) to rely on any external thermometer, but I can work around that. Would DP 48 "valve testing" be worth exploring?

Thanks again!

T0ytoy avatar Nov 09 '23 09:11 T0ytoy

@tnako thank you very much :)

I might be wrong, but I think DP 48 refers to the thermostat opening and closing the valve to the max/min for testing.

jim-fx avatar Nov 09 '23 10:11 jim-fx

@tnako could you create a PR?

Koenkk avatar Nov 09 '23 16:11 Koenkk

@tnako could you create a PR?

Sure. First time is best time and closer to weekends.

If I disappear after this promise:

Details
  • added presets
  • added boost mode
  • changed valve_state to running_state and heat/idle
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: '_TZE204_pcdmj88b'}, // Mine
        ],
        model: 'TS0601_thermostat_3',
        vendor: 'TuYa',
        description: 'Thermostatic radiator valve',
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        onEvent: tuya.onEventSetTime,
        configure: tuya.configureMagicPacket,
        exposes: [
            e.child_lock(),
            e.battery_low(),
            e.climate()
                .withSetpoint('current_heating_setpoint', 5, 35, 1, ea.STATE_SET)
                .withLocalTemperature(ea.STATE)
                .withPreset(['schedule', 'holiday', 'manual', 'comfort', 'eco'])
                .withRunningState(['idle', 'heat'], ea.STATE)
                .withLocalTemperatureCalibration(-3, 3, 1, ea.STATE_SET),
            ...tuya.exposes.scheduleAllDays(ea.STATE_SET, 'HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C'),
            e.binary('scale_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('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.'),
            e.binary('frost_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('When the room temperature is lower than ' +
                '5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes.'),
            e.numeric('error', ea.STATE).withDescription('If NTC is damaged, "Er" will be on the TRV display.'),
            e.binary('boost_heating', ea.STATE_SET, 'ON', 'OFF')
                .withDescription('Boost Heating: the device will enter the boost heating mode.'),
            ],
        meta: {
            tuyaDatapoints: [
                [2, 'preset', tuya.valueConverterBasic.lookup({'schedule': tuya.enum(0), 'holiday': tuya.enum(1), 'manual': tuya.enum(2), 'comfort': tuya.enum(3), 'eco': tuya.enum(4)})],
                [4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
                [5, 'local_temperature', tuya.valueConverter.divideBy10],
                [6, 'battery', tuya.valueConverter.raw],
                [7, 'child_lock', tuya.valueConverter.lockUnlock],
                [28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1)],
                [29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2)],
                [30, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3)],
                [31, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4)],
                [32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5)],
                [33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6)],
                [34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7)],
                [35, 'fault_alarm', tuya.valueConverter.errorOrBatteryLow],
                [36, 'frost_protection', tuya.valueConverter.onOff],
                [37, 'boost_heating', tuya.valueConverter.onOff],
                [39, 'scale_protection', tuya.valueConverter.onOff],
                [47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration2],
                [49, 'running_state', tuya.valueConverterBasic.lookup({'idle': tuya.enum(0), 'heat': tuya.enum(1)})],
            ],
        },
    };

module.exports = definition;

tnako avatar Nov 09 '23 18:11 tnako

@tnako I updated with your last version, thank you very much.

It seems that the presets all have a fixed target temperature value (except manual mode) : eco is 20°C (how tf is that "eco"), comfort is 25°C (🔥 ), holiday ('away') is 15°C.

@jim-fx you have a tuya gateway, right? Do you know if those values are updatable at all with the official tuya app, or are they hard-coded and the only solution in homeassistant is to use manual mode?

Thanks again for all the work put into this :)

T0ytoy avatar Nov 10 '23 11:11 T0ytoy

Not sure, I would guess the values are hardcoded. But if you connect the thermostat to home assistant you don't need presets anymore? I accidentaly bought two, I dont mind sending you one 4 free if you would like to play around yourself :)

jim-fx avatar Nov 10 '23 11:11 jim-fx

@jim-fx that's very nice of you but not necessary, I already own 5 of them, only one is installed yet, though 😄 You're right that manual mode is enough, but preset would have been a nice "cherry on top" feature, for example in Home Assistant when no one is at home you trigger the "away" preset instead of setting the manual mode to 17°C, it's a bit easier to understand in the UI.

Anyway 'tis but a detail, thank you for answering ;)

T0ytoy avatar Nov 10 '23 13:11 T0ytoy

@T0ytoy added holiday_temperature, comfort_temperature and eco_temperature. Quick check show possibility to change preset temps

Details

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: '_TZE204_pcdmj88b'}, 
        ],
        model: 'TS0601_thermostat_1',
        vendor: 'TuYa',
        description: 'Thermostatic radiator valve',
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        onEvent: tuya.onEventSetLocalTime,
        configure: tuya.configureMagicPacket,
        exposes: [
            e.child_lock(),
            e.battery(),
            e.battery_low(),
            e.climate()
                .withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
                .withLocalTemperature(ea.STATE)
                .withPreset(['schedule', 'holiday', 'manual', 'comfort', 'eco'])
                .withSystemMode(['off', 'heat'], ea.STATE)
                .withLocalTemperatureCalibration(-3, 3, 1, ea.STATE_SET),
            ...tuya.exposes.scheduleAllDays(ea.STATE_SET, 'HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C HH:MM/C'),
            e.holiday_temperature().withValueMin(5).withValueMax(30),
            e.comfort_temperature().withValueMin(5).withValueMax(30),
            e.eco_temperature().withValueMin(5).withValueMax(30),
            e.binary('scale_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('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.'),
            e.binary('frost_protection', ea.STATE_SET, 'ON', 'OFF').withDescription('When the room temperature is lower than ' +
                '5 °C, the valve opens; when the temperature rises to 8 °C, the valve closes.'),
            e.numeric('error', ea.STATE).withDescription('If NTC is damaged, "Er" will be on the TRV display.'),
            e.binary('boost_heating', ea.STATE_SET, 'ON', 'OFF')
                .withDescription('Boost Heating: the device will enter the boost heating mode.'),
            ],
        meta: {
            tuyaDatapoints: [
                [2, 'preset', tuya.valueConverterBasic.lookup({'schedule': tuya.enum(0), 'holiday': tuya.enum(1), 'manual': tuya.enum(2), 'comfort': tuya.enum(3), 'eco': tuya.enum(4)})],
                [4, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
                [5, 'local_temperature', tuya.valueConverter.divideBy10],
                [6, 'battery', tuya.valueConverter.raw],
                [7, 'child_lock', tuya.valueConverter.lockUnlock],
                [21, 'holiday_temperature', tuya.valueConverter.divideBy10],
                [24, 'comfort_temperature', tuya.valueConverter.divideBy10],
                [25, 'eco_temperature', tuya.valueConverter.divideBy10],
                [28, 'schedule_monday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(1)],
                [29, 'schedule_tuesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(2)],
                [30, 'schedule_wednesday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(3)],
                [31, 'schedule_thursday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(4)],
                [32, 'schedule_friday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(5)],
                [33, 'schedule_saturday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(6)],
                [34, 'schedule_sunday', tuya.valueConverter.thermostatScheduleDayMultiDPWithDayNumber(7)],
                [35, 'fault_alarm', tuya.valueConverter.errorOrBatteryLow],
                [36, 'frost_protection', tuya.valueConverter.onOff],
                [37, 'boost_heating', tuya.valueConverter.onOff],
                [39, 'scale_protection', tuya.valueConverter.onOff],
                [47, 'local_temperature_calibration', tuya.valueConverter.localTempCalibration2],
                [49, 'system_mode', tuya.valueConverterBasic.lookup({'off': tuya.enum(0), 'heat': tuya.enum(1)})],
            ],
        },
    };

module.exports = definition;

Going to create PR

tnako avatar Nov 10 '23 16:11 tnako

Thank you for looking it up! Those TRV went from unusable to good home assistant product in a few day, that is so great.

Looking up at your converter, I was wondering if the third parameter of :
.withLocalTemperatureCalibration(-3, 3, 1, ea.STATE_SET) was the increment size. If that is the case, it would be better at 0.5 or even 0.1, as 1C is a bit high for calibration. But maybe there is a hardware limitation and it cannot be done.

Thanks again!

T0ytoy avatar Nov 10 '23 18:11 T0ytoy

Yes, '1' is precision and you can put any step there. For this valve only 1C calibration works in my tests.

Personally I use home assistance and calibration way easy to do with template.sensors. Example of usage hoas filter on raw data: Red is raw valve values and Blue is 5min moving average. 21 19 18

tnako avatar Nov 10 '23 20:11 tnako

And merged to main branch. Thank everybody! With datapoints here was easy to make convertor 👍

tnako avatar Nov 11 '23 10:11 tnako

Thank you very much for doing this @tnako, it's really good of you. I've got one of these devices and have been playing with the device & the converter:

  • it appears that the temperature calibration can actually range between -12 and 12 from my testing.
  • I think it's this device rather than the one in the picture. I own both, the one pictured in zigbee2mqtt is a _TZE200_hue3yfsn I think.
  • The number of transition-points in the day schedule is hardcoded at 4 in tuya.ts here - I don't know how to know if that's a genuine limitation in the device or not. According to the AliExpress link above it supports 6 transitions each for 5+2, 6+1 or 7 individual days, the same as the TZE200_hue3yfsn. If that's the case, there should be another datapoint for "schedule" like this one.

j4m3s avatar Nov 16 '23 22:11 j4m3s

i tested dev branch, some functions need to be corrected:

  • 'current_heating_setpoint', 5, 45, 0.5
  • .withLocalTemperatureCalibration(-7, 7, 1, ea.STATE_SET)
  • frost_protection -> doesnt work
  • scale_protection -> is not present as setting on the device, you cant switch it on / off

not tested

  • battery low (battery status seems to work)
  • error state
  • shedule

And I'm missing functions:

  • blind spot
  • open window
  • thermal stop

202311222154

Maybe for description modell nr. is "BAB-1413Pro-E" and it looks similar to Tuya TV02, but it isnt Screenshot_20231122_214417

-13230296381108418737

dockerpirate avatar Nov 22 '23 20:11 dockerpirate

How do you even get those devices in pairing mode? Only possible via Tuya gateway?

apedance avatar Nov 27 '23 12:11 apedance