Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.8k stars 1.64k forks source link

[New device support]: Tuya TRV TRV601 (TRV602) _TZE200_rtrmfadk (Converter & Datapoints provided) #18892

Open Mikescotland opened 1 year ago

Mikescotland commented 1 year ago

Link

https://www.aliexpress.com/item/1005004813488375.html?spm=a2g0o.productlist.main.37.130c23c8R8nr79&algo_pvid=27758fd9-0451-4f71-b0e8-f4f6a5ebe03a&algo_exp_id=27758fd9-0451-4f71-b0e8-f4f6a5ebe03a-18&pdp_npi=4%40dis%21GBP%2152.17%2122.43%21%21%2163.58%21%21%4021038edc16940448207022588e0728%2112000030589174994%21sea%21GB%210%21A&curPageLogUid=pqJjqAWtXHGe

Database entry

{"id":36,"type":"EndDevice","ieeeAddr":"0xa4c13823ca26d31f","nwkAddr":8322,"manufId":4417,"manufName":"_TZE200_rtrmfadk","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":{"65503":"���,i���,i���,i���,i

Comments

Yet another Tuya Smart TRV, the model I was working on is TRV601, it's probably exactly the same as TRV602 (with OLED screen). Disctinctive with these devices is the fact they take 3xAA not 2xAA batteries. Device unsupported. Here are the datapoints from Tuya: MODE 1 (actually it's Preset - auto, manual, off, on) - auto is schedule setup, manual is manual, off is off, and on is constant on regarless of the temperature setting. TARGET TEMP 2 CURRENT TEMP 3 WORKING STATUS 6 WINDOW STATUS 7 OPEN WINDOW 8 CHILD LOCK 12 BATTERY 13 FAULT ALARM 14 MIN LIMIT TEMP 15 MAX LIMIT TEMP 16 HEATING SCHEDULE (Actually it's MONDAY) 17 WEEK PROGRAM TUE 18 WEEK PROGRAM WED 19 WEEK PROGRAM THU 20 WEEK PROGRAM FRI 21 WEEK PROGRAM SAT 22 WEEK PROGRAM SUN 23 ROOM SENSOR CALIBRATION 101 VALVE 108 - Valve position, seems to be only either 0 or 100% MODEL/TYPE (?) 109 - not sure what's that, it was in Chinese MOTOR THRUST 110 - probably it is force valve to open/close DISPLAY BRIGHTNESS 111 SOFTWARE VERSION 112 - not implemented in converter SCREEN ORIENTATION 113 - not implemented in the converter SYSTEM MODE 114 - Eco (with valve operating in two states 0 or 100% and hysteresis - default 0.5 degrees C) and Comfort (no hystereris but valve is dynamically opened between 0 and 100%)

External converter attached, have it now working normally with Climate card and Google Home. I didn't bother with software version, screen orientation (this can be done via physical button so once set, forgotten) etc and seems this model DOES NOT have modes, just presets, auto - schedule, manual as set manually and off. Added modes just for Home Assistant so it doesn't throw out all HVAC options and it's Google Home friendly.

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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's necessary to provide a fingerprint instead of a zigbeeModel
    fingerprint: [
        {

            modelID: 'TS0601',

            manufacturerName: '_TZE200_rtrmfadk',
        },
    ],
    model: 'TS0601_new',
    vendor: 'TuYa',
    description: 'Fill in a description of the device here',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, 
    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.enum('brightness', ea.STATE_SET, ['low', 'medium', 'high']).withDescription('Screen Brightness'),
            e.enum('mode', ea.STATE_SET, ['comfort', 'eco']).withDescription('Hysteresis - comfort > switches off/on exactly at reached temperature with valve smooth from 0 to 100%, eco > 0.5 degrees above or below, valve either 0 or 100%'),

            e.climate()
                .withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
                .withLocalTemperature(ea.STATE)
                .withPreset(['auto', 'manual', 'off', 'on'], ea.STATE_SET)
                .withRunningState(['idle', 'heat'], ea.STATE)
                .withSystemMode(['off', 'heat'], ea.STATE_SET, 'Only for Homeassistant')
                .withLocalTemperatureCalibration(-3, 3, 0.5, 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'),

    ],
    meta: {
            tuyaDatapoints: [

                [1, 'preset', tuya.valueConverterBasic.lookup({'auto': tuya.enum(0),'manual': tuya.enum(1), 'off': tuya.enum(2), 'on': tuya.enum(3)})],
                [1, 'running_state', tuya.valueConverterBasic.lookup({'heat': tuya.enum(0), 'idle': tuya.enum(1)})],
                [1, 'system_mode', tuya.valueConverter.TV02SystemMode],
                [114, 'mode', tuya.valueConverterBasic.lookup({'comfort': tuya.enum(0), 'eco': tuya.enum(1)})],
                [2, 'current_heating_setpoint', tuya.valueConverter.divideBy10],
                [3, 'local_temperature', tuya.valueConverter.divideBy10],

                [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],
                [108, 'position', tuya.valueConverter.divideBy10],
                [111, 'brightness', tuya.valueConverterBasic.lookup({
                    'low': tuya.enum(2), 'medium': tuya.enum(1), 'high': tuya.enum(0)})],

            ],
    },
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

Mikescotland commented 1 year ago

I'm having some problems with adding a few things: datapoint 110 - motor thrust, I can see from Tuya IoT, it's on settings "middle". Probably it can be set up to "low, middle, high", however when I try to set it up, no converters available. It can also be a value set up during the calibration of the valve, i.e. stroke, which then it's better not to be touched. datapoint 113 - screen orientation. Possible values "up" and "down". Unable to resolve as "no converters available". datapoint 115 - switch deviation. It's a slider in the tuya app to set up hysteresis for the "Eco" mode - by default is 0.5 degrees. Don't know how to incorporate it.

resettertje commented 12 months ago

datapoint 113 - screen orientation. Possible values "up" and "down". Unable to resolve as "no converters available".

Pretty sure that is set on the device itself, mine came in the wrong orientation so i had to flip it.

Mikescotland commented 12 months ago

Yes. It is on the device too, but also via software (tuya app allows it).

resettertje commented 12 months ago

Yes. It is on the device too, but also via software (tuya app allows it).

Aaaaah that I didn't know.

tomiss288 commented 11 months ago

Hi, It's exactly the same device like TS0601_TZE200_z1tyspqw. I received new one on a warranty as a replacement for this device. Maybe somebody who know can change script for TS0601_TZE200_z1tyspqw for support _TZE200_rtrmfadk ?

tomiss288 commented 11 months ago

I have one question, how to change temperature displayed from F to C ? Is it possible without Tuya Gateway ?

Mikescotland commented 11 months ago

Hi, It's exactly the same device like TS0601_TZE200_z1tyspqw. I received new one on a warranty as a replacement for this device. Maybe somebody who know can change script for TS0601_TZE200_z1tyspqw for support _TZE200_rtrmfadk ?

Try my converter, just replace manufacturer name with TS601_TZE200_rtrmfadk

tomiss288 commented 11 months ago

Hi, It's exactly the same device like TS0601_TZE200_z1tyspqw. I received new one on a warranty as a replacement for this device. Maybe somebody who know can change script for TS0601_TZE200_z1tyspqw for support _TZE200_rtrmfadk ?

Try my converter, just replace manufacturer name with TS601_TZE200_rtrmfadk

I did it, but it doesn't work in 100% good, e.g, why in your converter there is option for brightness ? Also system mode don't work.

Mikescotland commented 11 months ago

Hi, It's exactly the same device like TS0601_TZE200_z1tyspqw. I received new one on a warranty as a replacement for this device. Maybe somebody who know can change script for TS0601_TZE200_z1tyspqw for support _TZE200_rtrmfadk ?

Try my converter, just replace manufacturer name with TS601_TZE200_rtrmfadk

I did it, but it doesn't work in 100% good, e.g, why in your converter there is option for brightness ? Also system mode don't work.

Then unfortunately you'd need to find data point and create the converter. As far as I know on mine it's not possible to switch between F and °C. Maybe try this converter and change the manufacturer name https://github.com/Koenkk/zigbee2mqtt/issues/9265

Tiggx commented 11 months ago

in my case this worked: https://github.com/jacekk015/zha_quirks/blob/main/ts0601_trv_rtitek.py

Mikescotland commented 11 months ago

Your sxript is for ZHA, this topic is for zigbee2mqtt.

On Fri, 20 Oct 2023, 20:53 Tiggx, @.***> wrote:

in my case this worked: https://github.com/jacekk015/zha_quirks/blob/main/ts0601_trv_rtitek.py

— Reply to this email directly, view it on GitHub https://github.com/Koenkk/zigbee2mqtt/issues/18892#issuecomment-1773316217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNLFK3KNHNTLHB72WGKYFTYALJCXAVCNFSM6AAAAAA4OCQBE6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZTGMYTMMRRG4 . You are receiving this because you authored the thread.Message ID: @.***>

Tiggx commented 11 months ago

oh sorry. my mistake

Herrschacht commented 6 months ago

Anyone got this working with SkyConnect v1.0 ?

github-actions[bot] commented 4 days ago

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