Skip to content

[External Converter]: TS0601 from _TZE204_lpedvtvr #29534

@AudreynHeadburn

Description

@AudreynHeadburn

Link

https://www.zigbee2mqtt.io/devices/ZHT-SR.html#moes-zht-sr

Database entry

{ "type": "Router", "ieeeAddr": "0xa4c13867b3db4fbf", "manufId": 4417, "manufName": "_TZE204_lpedvtvr", "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": { "manufacturerName": "_TZE204_lpedvtvr", "modelId": "TS0601", "powerSource": 1, "zclVersion": 3, "appVersion": 74, "stackVersion": 0, "hwVersion": 1, "dateCode": "" } } }, "binds": [], "configuredReportings": [] }, "242": { "profId": 41440, "epId": 242, "devId": 97, "inClusterList": [], "outClusterList": [33], "clusters": {}, "binds": [], "configuredReportings": [] } }, "interviewCompleted": true, "interviewState": "SUCCESSFUL" }

Zigbee2MQTT version

2.6.3

External converter

// ZHT-SR kompletter Converter (external):
// - Zeitbasis auf Unix-Epoch (1970) umgestellt
// - Auto-Zeit-Sync bei Announce/Restart via onEventSetLocalTime
//
// Datei: /opt/zigbee2mqtt/data/external_extensions/zht_sr_timefix_ext.js

const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya    = require('zigbee-herdsman-converters/lib/tuya');

const e  = exposes.presets;
const ea = exposes.access;

module.exports = {
  fingerprint: [{modelID: 'TS0601', manufacturerName: '_TZE204_lpedvtvr'}],
  model: 'ZHT-SR',
  vendor: 'Moes',
  description: 'Smart ring thermostat',

  // WICHTIG: timeStart auf 1970 (statt 2000)
  extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: '1970' })],

  // Auto-Set der lokalen Zeit bei Announce/Interview/Restart
  onEvent: tuya.onEventSetLocalTime,

  exposes: [
    e.climate()
      .withSetpoint('current_heating_setpoint', 5, 45, 0.5, ea.STATE_SET)
      .withLocalTemperature(ea.STATE)
      .withLocalTemperatureCalibration(-10, 10, 1, ea.STATE_SET)
      .withSystemMode(['off', 'heat'], ea.STATE_SET)
      .withRunningState(['idle', 'heat'], ea.STATE)
      .withPreset(['Manual', 'Temporary manual', 'Program', 'Eco']),

    new exposes.Numeric('eco_temperature', ea.STATE_SET)
      .withUnit('°C')
      .withDescription('Temperature for eco mode')
      .withValueMin(10)
      .withValueMax(30),

    e.child_lock(),
    e.deadzone_temperature().withValueMin(0.5).withValueMax(5).withValueStep(0.5),
    e.max_temperature_limit().withValueMin(35).withValueMax(45),
    e.min_temperature_limit().withValueMin(1).withValueMax(15),

    e.enum('sensor_mode', ea.STATE, ['IN', 'OU', 'AL'])
      .withDescription('IN - internal sensor, no heat protection. OU - external sensor, no heat protection. AL - internal sensor for room temperature, external for heat protection'),

    new exposes.Numeric('floor_temperature', ea.STATE).withUnit('°C').withDescription('Floor temperature'),

    new exposes.Numeric('high_protect_temperature', ea.STATE_SET)
      .withUnit('°C')
      .withDescription('High protect temperature')
      .withValueMin(10)
      .withValueMax(70),

    new exposes.Numeric('low_protect_temperature', ea.STATE_SET)
      .withUnit('°C')
      .withDescription('Low protect temperature')
      .withValueMin(0)
      .withValueMax(10),

    new exposes.Numeric('backlight_brightness', ea.STATE_SET)
      .withUnit('%')
      .withDescription('Backlight brightness')
      .withValueMin(0)
      .withValueMax(100),

    new exposes.Enum(
      'screen_time',
      ea.STATE_SET,
      [10, 20, 30, 40, 50, 60].map(secs => `${secs}_seconds`),
    )
      .withDescription('Screen on time')
      .withCategory('config'),

    e.binary('rgb_light', ea.STATE_SET, 'ON', 'OFF'),
  ],

  meta: {
    tuyaDatapoints: [
      [1,   'system_mode',                 tuya.valueConverterBasic.lookup({off: false, heat: true})],
      [2,   'preset',                      tuya.valueConverterBasic.lookup({Manual: 0,'Temporary manual': 1, Program: 2, Eco: 3})],
      [16,  'local_temperature',           tuya.valueConverter.divideBy10],
      [18,  'min_temperature_limit',       tuya.valueConverter.divideBy10],
      [32,  'sensor_mode',                 tuya.valueConverterBasic.lookup({IN: 0, AL: 1, OU: 2})],
      [34,  'max_temperature_limit',       tuya.valueConverter.divideBy10],
      [39,  'child_lock',                  tuya.valueConverter.lockUnlock],
      [47,  'running_state',               tuya.valueConverterBasic.lookup({heat: 0, idle: 1})],
      [48,  'backlight_brightness',        tuya.valueConverter.raw],
      [50,  'current_heating_setpoint',    tuya.valueConverter.divideBy10],
      [101, 'local_temperature_calibration', tuya.valueConverter.localTemperatureCalibration_256],
      [109, 'floor_temperature',           tuya.valueConverter.divideBy10],
      [110, 'deadzone_temperature',        tuya.valueConverter.divideBy10],
      [111, 'high_protect_temperature',    tuya.valueConverter.divideBy10],
      [112, 'low_protect_temperature',     tuya.valueConverter.divideBy10],
      [113, 'eco_temperature',             tuya.valueConverter.divideBy10],
      [114, 'screen_time',                 tuya.valueConverterBasic.lookup({
                                             '10_seconds': 0,'20_seconds': 1,'30_seconds': 2,
                                             '40_seconds': 3,'50_seconds': 4,'60_seconds': 5,
                                           })],
      [115, 'rgb_light',                   tuya.valueConverterBasic.lookup({ON: true, OFF: false})],
    ],
  },
};

What does/doesn't work with the external definition?

Hi,
the date was always wrong with the Moes ZHT-SR (TS0601
_TZE204_lpedvtvr (Smart ring thermostat)) It always started with Wednesday. I fixed it, now it syncs the real date and time.

changed:
extend: [tuya.modernExtend.tuyaBase({dp: true, timeStart: "2000"})],
to:
extend: [tuya.modernExtend.tuyaBase({ dp: true, timeStart: '1970' })],

onEvent: tuya.onEventSetLocalTime,

Another question:
Is there a way to get the "local_temperature" to 0.1 C steps instead of 0.5 C?

I know there is an NTC 3950, 10K temperature sensor inside that's capable of measuring the temperature to 0.1 C. But because of the Tuya handling it only shows the Temperature in 0.5 C steps. That's a lot for Celsius. My old Bosch thermostats are working with 0.1 steps (e.g. 22.3 C, 23.7 C etc...)
would be awesome if someone could help me with that.

Nico

Notes

software_build_id: undefined
date_code: ``
endpoints:

{"1":{"clusters":{"input":["genGroups","genScenes","manuSpecificTuya","genBasic"],"output":["genOta","genTime"]}},"242":{"clusters":{"input":[],"output":["greenPower"]}}}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions