Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New device: Moes , Thermoestatic Valve #23206

Closed
egarijo opened this issue Jun 29, 2024 · 23 comments
Closed

New device: Moes , Thermoestatic Valve #23206

egarijo opened this issue Jun 29, 2024 · 23 comments
Labels
new device support New device support request stale Stale issues

Comments

@egarijo
Copy link

egarijo commented Jun 29, 2024

Link

{"id":21,"type":"Router","ieeeAddr":"0xa4c138b618017288","nwkAddr":4156,"manufId":4417,"manufName":"_TZE204_qasjif9e","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0006\u0000\u0000\u0000e\u0007\u0000\u0000\u0000\u0012\u0006q�-\u0013\u0006q�-e\u0007q�-\u0012\u0005\u0000\u0000\u0000e\u0006\u0000\u0000\u0000\u0012","65506":56,"65508":1,"modelId":"TS0601","manufacturerName":"_TZE204_qasjif9e","powerSource":1,"zclVersion":3,"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1718784631633}

Database entry

{"id":21,"type":"Router","ieeeAddr":"0xa4c138b618017288","nwkAddr":4156,"manufId":4417,"manufName":"_TZE204_qasjif9e","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"\u0006\u0000\u0000\u0000e\u0007\u0000\u0000\u0000\u0012\u0006q�-\u0013\u0006q�-e\u0007q�-\u0012\u0005\u0000\u0000\u0000e\u0006\u0000\u0000\u0000\u0012","65506":56,"65508":1,"modelId":"TS0601","manufacturerName":"_TZE204_qasjif9e","powerSource":1,"zclVersion":3,"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1718784631633}

Comments

I created the file T0601.js file following the instructions:
the file is the following:

const {} = require('zigbee-herdsman-converters/lib/modernExtend');
// Add the lines below
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 ota = require('zigbee-herdsman-converters/lib/ota');
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 = {
zigbeeModel: ['TS0601'],
model: 'TRV FSZPJYDC', // Update this with the real model of the device (written on the device itself or product page)
vendor: 'Moes', // Update this with the real vendor of the device (written on the device itself or product page)
description: 'THERMOSTATE VALVE', // Description of the device, copy from vendor site. (only used for documentation and startup logging)
extend: [],
fromZigbee: [], // We will add this later
toZigbee: [], // Should be empty, unless device can be controlled (e.g. lights, switches).
exposes: [e.battery(), e.temperature(), e.valve_possition(), e.state()] // Defines what this device exposes, used for e.g. Home Assistant discovery and in the frontend
};

module.exports = definition;

After that I have added the following lines on the configuration.yml

advanced:
log_level: debug
external_converters:

  • TS0601.js
    But still the same. Nothing happens.

External definition

const definition = {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE204_9mjy74mp',
    description: 'Automatically generated definition',
    extend: [],
    meta: {},
};

module.exports = definition;
@egarijo egarijo added the new device support New device support request label Jun 29, 2024
@LintHart
Copy link

Hi @egarijo , did you ever get anywhere with these? I unfortunately bought a bunch of them without realising they're not supported. Also having trouble creating an external definition

@egarijo
Copy link
Author

egarijo commented Jul 27, 2024 via email

@LintHart
Copy link

I had some luck with learning how to work with DDFs in Phoscon as it has a builder and managed to adjust a template to read and control the temperature. I did figure out how to start an external definition but my skills aren't there yet to finish it.

I bought a Tuya hub and extracted all of the DPIDs in hope that we might be able to get some assistance :)

"1":"Mode", "2":"Target temperature", "3":"Current temperature", "6":"Working status", "7":"Window status", "8":"Open window", "12":"Child lock", "13":"Battery", "14":"Fault alarm", "15":"Min. limit temperature", "16":"Max. limit temperature", "17":"Heating schedule", "18":"Week program Tuesday", "19":"Week program Wednesday", "20":"Week program Thursday", "21":"Week program Friday", "22":"Week program Saturday", "23":"Week program Sunday", "101":"Room sensor calibration", "108":"Valve", "109":"Models", "110":"Motor thrust", "111":"Display brightness", "112":"Software version", "113":"Screen orientation", "114":"System mode", "115":"Switch deviation (energy-saving mode only)", "116":"Motor data"

@micheltol
Copy link

@egarijo @LintHart any luck? I'm in the same boat and pretty much a newbee in zigbee2mqtt-space 😦

@hideintheclouds
Copy link

I think that the device is a Tuya type, so a different converter should be created, according to the documentation here:
https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html

I had the same issue with a Moes TRV (_TZE204_9mjy74mp TRV801Z) and was able to make it work by following the guide above.

Inspired by @LintHart extracted DPIDs, and looking at tuya.js, I was able to find a similar config here

The converter js should be placed next to configuration.yaml and can be referenced either via the config or the Home Assistant Zigbee2MQTT side addon.

I ended up with something like this:

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');                                                                                     
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: [                                                                                                                                               
        {                                                                                                                                                        
            // The model ID from: Device with modelID 'TS0601' is not supported                                                                                  
            // You may need to add \u0000 at the end of the name in some cases                                                                                   
            modelID: 'TS0601',                                                                                                                                   
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.                                                                        
            manufacturerName: '_TZE204_9mjy74mp',                                                                                                                
        },                                                                                                                                                       
    ],                                                                                                                                                           
    model: 'TRV801Z',                                                                                                                                            
    vendor: 'Moes',                                                                                                                                              
    description: 'Moes old TRV/zigbee model',                                                                                                                    
    fromZigbee: [tuya.fz.datapoints],                                                                                                                            
    toZigbee: [tuya.tz.datapoints],                                                                                                                              
    onEvent: tuya.onEventSetLocalTime,                                                                                                                           
    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, 'OPEN', 'CLOSE').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
                .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%',
                ),
        ],
        meta: {
            tuyaDatapoints: [
                [1, null, tuya.valueConverter.thermostatSystemModeAndPreset(null)],
                [1, 'system_mode', tuya.valueConverter.thermostatSystemModeAndPreset('system_mode')],
                [1, 'preset', tuya.valueConverter.thermostatSystemModeAndPreset('preset')],
                [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.valueConverterBasic.lookup({ON: 1, OFF: 0})],
                [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],
                [114, 'mode', tuya.valueConverterBasic.lookup({comfort: tuya.enum(0), eco: tuya.enum(1)})],
            ],
        },

    extend: [
        // A preferred new way of extending functionality.
    ],
};

module.exports = definition;

Now this converter is probably not 100% reliable, but it seems to be working fine in Home Assistant.
This might be useful for you.

@egarijo
Copy link
Author

egarijo commented Oct 2, 2024 via email

@egarijo
Copy link
Author

egarijo commented Oct 2, 2024 via email

@monteship
Copy link

I think that the device is a Tuya type, so a different converter should be created, according to the documentation here: https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html

I had the same issue with a Moes TRV (_TZE204_9mjy74mp TRV801Z) and was able to make it work by following the guide above.

Inspired by @LintHart extracted DPIDs, and looking at tuya.js, I was able to find a similar config here

The converter js should be placed next to configuration.yaml and can be referenced either via the config or the Home Assistant Zigbee2MQTT side addon.

I ended up with something like this:

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');                                                                                     
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: [                                                                                                                                               
        {                                                                                                                                                        
            // The model ID from: Device with modelID 'TS0601' is not supported                                                                                  
            // You may need to add \u0000 at the end of the name in some cases                                                                                   
            modelID: 'TS0601',                                                                                                                                   
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.                                                                        
            manufacturerName: '_TZE204_9mjy74mp',                                                                                                                
        },                                                                                                                                                       
    ],                                                                                                                                                           
    model: 'TRV801Z',                                                                                                                                            
    vendor: 'Moes',                                                                                                                                              
    description: 'Moes old TRV/zigbee model',                                                                                                                    
    fromZigbee: [tuya.fz.datapoints],                                                                                                                            
    toZigbee: [tuya.tz.datapoints],                                                                                                                              
    onEvent: tuya.onEventSetLocalTime,                                                                                                                           
    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, 'OPEN', 'CLOSE').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
                .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%',
                ),
        ],
        meta: {
            tuyaDatapoints: [
                [1, null, tuya.valueConverter.thermostatSystemModeAndPreset(null)],
                [1, 'system_mode', tuya.valueConverter.thermostatSystemModeAndPreset('system_mode')],
                [1, 'preset', tuya.valueConverter.thermostatSystemModeAndPreset('preset')],
                [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.valueConverterBasic.lookup({ON: 1, OFF: 0})],
                [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],
                [114, 'mode', tuya.valueConverterBasic.lookup({comfort: tuya.enum(0), eco: tuya.enum(1)})],
            ],
        },

    extend: [
        // A preferred new way of extending functionality.
    ],
};

module.exports = definition;

Now this converter is probably not 100% reliable, but it seems to be working fine in Home Assistant. This might be useful for you.

Confirm as working solution

@egarijo
Copy link
Author

egarijo commented Oct 4, 2024 via email

@egarijo
Copy link
Author

egarijo commented Oct 9, 2024 via email

@egarijo
Copy link
Author

egarijo commented Oct 9, 2024 via email

@Joshi120
Copy link

Heya, i am very confused. i added the code from above next to the Config file and referenced it but it still says not supported. I own the exact TRV mentioned above the code

@egarijo
Copy link
Author

egarijo commented Oct 22, 2024 via email

@PedroKTFC
Copy link

I think that the device is a Tuya type, so a different converter should be created, according to the documentation here: https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html

I had the same issue with a Moes TRV (_TZE204_9mjy74mp TRV801Z) and was able to make it work by following the guide above.

Inspired by @LintHart extracted DPIDs, and looking at tuya.js, I was able to find a similar config here

The converter js should be placed next to configuration.yaml and can be referenced either via the config or the Home Assistant Zigbee2MQTT side addon.

I ended up with something like this:

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 modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');                                                                                     
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: [                                                                                                                                               
        {                                                                                                                                                        
            // The model ID from: Device with modelID 'TS0601' is not supported                                                                                  
            // You may need to add \u0000 at the end of the name in some cases                                                                                   
            modelID: 'TS0601',                                                                                                                                   
            // The manufacturer name from: Device with modelID 'TS0601' is not supported.                                                                        
            manufacturerName: '_TZE204_9mjy74mp',                                                                                                                
        },                                                                                                                                                       
    ],                                                                                                                                                           
    model: 'TRV801Z',                                                                                                                                            
    vendor: 'Moes',                                                                                                                                              
    description: 'Moes old TRV/zigbee model',                                                                                                                    
    fromZigbee: [tuya.fz.datapoints],                                                                                                                            
    toZigbee: [tuya.tz.datapoints],                                                                                                                              
    onEvent: tuya.onEventSetLocalTime,                                                                                                                           
    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, 'OPEN', 'CLOSE').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
                .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%',
                ),
        ],
        meta: {
            tuyaDatapoints: [
                [1, null, tuya.valueConverter.thermostatSystemModeAndPreset(null)],
                [1, 'system_mode', tuya.valueConverter.thermostatSystemModeAndPreset('system_mode')],
                [1, 'preset', tuya.valueConverter.thermostatSystemModeAndPreset('preset')],
                [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.valueConverterBasic.lookup({ON: 1, OFF: 0})],
                [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],
                [114, 'mode', tuya.valueConverterBasic.lookup({comfort: tuya.enum(0), eco: tuya.enum(1)})],
            ],
        },

    extend: [
        // A preferred new way of extending functionality.
    ],
};

module.exports = definition;

Now this converter is probably not 100% reliable, but it seems to be working fine in Home Assistant. This might be useful for you.

Looking at the code you ended up with above and the code you reference just before it as your inspiration, I can't see any significant difference. Excuse my ignorance but can you explain what you've changed. I'm using ZHA in HA and I'm getting some basic functionality but I'd like to get more if I can work out how. Thanks.

@hideintheclouds
Copy link

@PedroKTFC The difference is: value conversion/lookup for the alarm_switch, as the existing config was throwing an exception when deserializing the received payload from the TRV:
[14, 'alarm_switch', tuya.valueConverterBasic.lookup({ON: 1, OFF: 0})],
vs. the initial one:
[14, 'alarm_switch', tuya.valueConverter.onOff],

@LAD47
Copy link

LAD47 commented Oct 26, 2024

@hideintheclouds The same thermostat from Moes comes with manufacturerName: "_TZE200_rtrmfadk". It is automatically installed by zigbee2mqtt. However, it has the same problem you explained with the 'alarm_switch'. I have tested '_TZE200_rtrmfadk' and it works without error messages when I use your 'alarm_switch' definitions. It would probably be wise to fix '_TZE200_rtrmfadk' as well.

@egarijo
Copy link
Author

egarijo commented Oct 29, 2024 via email

@canope-25
Copy link

canope-25 commented Oct 30, 2024

@PedroKTFC The difference is: value conversion/lookup for the alarm_switch, as the existing config was throwing an exception when deserializing the received payload from the TRV:

            [14, 'alarm_switch', tuya.valueConverterBasic.lookup({ON: 1, OFF: 0})],

vs. the initial one:

            [14, 'alarm_switch', tuya.valueConverter.onOff],

Hi ,

First of all thank you for the job done 😄.

I would like to share the fact that some useful settings are still not yet supported by the converters proposed there.

It will be useful to also have the ability to define :

  • the eco mode hysteresis
  • the display orientation
  • the light level of of the display

The associated three options are available through Tuya / gw / app:

image

All the other settings are working with the converter beside the three previous ones:

image
image
image

There is also something that I would like ( but don't know is feasible ) , it's to also have the power supply voltage.

I selected this device because it's rely on three AA cells ( and not two as usually done by other devices ).
It's seems to support NiMH cells because of that ( voltage is between 3.6 and 4.5 and seems to work better , i tested another one where everything went south when the voltage was 2.4 volt ( 2 AA NiMH cells nominal voltage ).

Thank you in advance for your help!

@PedroKTFC
Copy link

This is what I get in ZHA. Clearly, the mapping for the equivalent ZHA quirk needs further work. Unfortunately the quirk is complicated so working out what needs to change will take some time.

Screenshot 2024-10-30 at 22-34-28 Developer Tools – Home Assistant - gamlingay pedropaula uk

@canope-25
Copy link

canope-25 commented Oct 31, 2024

Hi ,
I'm trying to extend the Tuya Developer IOT Core license hoping to be able to access to more details regarding the device but seems difficult .
What can I do in order to help improve the features coverage with zb2mqtt ?

@canope-25
Copy link

Hi ,

I will try ( this evening ) the js template available at this link :

https://github.com/DonaldChung-HK/z2m-moes-trv-801-converter/blob/main/moes_valve_ZTRV801.js

Seems to be more complete

Copy link
Contributor

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

@github-actions github-actions bot added the stale Stale issues label Dec 31, 2024
@egarijo egarijo closed this as completed Dec 31, 2024
@PedroKTFC
Copy link

I'm afraid I've moved over to Zigbee2MQTT for this device where support is more up to date (but for a completely different reason).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request stale Stale issues
Projects
None yet
Development

No branches or pull requests

9 participants