Closed mikeg-de closed 1 year ago
Might be duplicate: https://github.com/Koenkk/zigbee2mqtt/issues/12315
@Koenkk Would you agree to close this in favor of 12315?
Works, to the greater extend, with the external converted from https://github.com/twhittock/avatto_me167
Some exchange is happening in https://github.com/Koenkk/zigbee2mqtt/issues/12315 which is already closed. Hence, keeping this open.
Battery is said to have no readout but got a blinking battery icon in the device pane after inserting an 1.2 V instead of 1.5 V battery when using 'e.battery()'.
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 tuyaLocal = {
dataPoints: {
me167Mode: 2,
me167HeatingSetpoint: 4,
me167LocalTemp: 5,
me167ChildLock: 7,
me167Heating: 3,
me167Schedule1: 28,
me167Schedule2: 29,
me167Schedule3: 30,
me167Schedule4: 31,
me167Schedule5: 32,
me167Schedule6: 33,
me167Schedule7: 34,
me167ErrorCode: 35,
me167FrostGuard: 36,
me167AntiScaling: 39,
me167TempCalibration: 47,
},
};
const fzLocal = {
me167_thermostat: {
cluster: 'manuSpecificTuya',
type: ['commandDataResponse', 'commandDataReport'],
convert: (model, msg, publish, options, meta) => {
const result = {};
function weeklySchedule(day, value) {
// byte 0 - Day of Week (0~7 = Wed ~ Tue) ???
// byte 1 - hour ???
// byte 2 - minute ???
// byte 3 - Temp (temp = value )
// byte 4 - Temperature (temp = value / 10)
const weekDays=[ 'wed', 'thu', 'fri', 'sat', 'sun','mon', 'tue'];
// we get supplied in value only a weekday schedule, so we must add it to
// the weekly schedule from meta.state, if it exists
const weeklySchedule= meta.state.hasOwnProperty('weekly_schedule') ? meta.state.weekly_schedule : {};
meta.logger.info(JSON.stringify({'received day': day, 'received values': value}));
let daySchedule = []; // result array
for (let i=1; i<16 && value[i]; ++i) {
const aHour=value[i];
++i;
const aMinute=value[i];
++i;
const aTemp2=value[i];
++i;
const aTemp=value[i];
daySchedule=[...daySchedule, {
temperature: Math.floor((aTemp+aTemp2*256)/10),
hour: aHour,
minute: aMinute,
}];
}
meta.logger.info(JSON.stringify({'returned weekly schedule: ': daySchedule}));
return {'weekly-schedule': {...weeklySchedule, [weekDays[day]]: daySchedule}};
}
for (const dpValue of msg.data.dpValues) {
const value = tuya.getDataValue(dpValue);
switch (dpValue.dp) {
case tuyaLocal.dataPoints.me167ChildLock:
result.child_lock = value ? 'LOCK' : 'UNLOCK';
break;
case tuyaLocal.dataPoints.me167HeatingSetpoint:
result.current_heating_setpoint = value/10;
break;
case tuyaLocal.dataPoints.me167LocalTemp:
result.local_temperature = value/10;
break;
case tuyaLocal.dataPoints.me167Heating:
switch(value) {
case 0:
result.running_state = "heat"; // valve open
break;
case 1:
result.running_state = "idle"; // valve closed
break;
default:
meta.logger.warn('zigbee-herdsman-converters:me167_thermostat: ' +
`Running state ${value} is not recognized.`);
break;
}
break;
case tuyaLocal.dataPoints.me167Mode:
switch (value) {
case 0: // auto
result.system_mode = 'auto';
break;
case 1: // manu
result.system_mode = 'heat';
break;
case 2: // off
result.system_mode = 'off';
break;
default:
meta.logger.warn('zigbee-herdsman-converters:me167_thermostat: ' +
`Mode ${value} is not recognized.`);
break;
}
break;
case tuyaLocal.dataPoints.me167Schedule1:
weeklySchedule(0,value);
break;
case tuyaLocal.dataPoints.me167Schedule2:
weeklySchedule(1,value);
break;
case tuyaLocal.dataPoints.me167Schedule3:
weeklySchedule(2,value);
break;
case tuyaLocal.dataPoints.me167Schedule4:
weeklySchedule(3,value);
break;
case tuyaLocal.dataPoints.me167Schedule5:
weeklySchedule(4,value);
break;
case tuyaLocal.dataPoints.me167Schedule6:
weeklySchedule(5,value);
break;
case tuyaLocal.dataPoints.me167Schedule7:
weeklySchedule(6,value);
break;
case tuyaLocal.dataPoints.me167TempCalibration:
if (value >= 4294967295 ){
result.local_temperature_calibration = (value-4294967295)-1 // negative values
}else{
result.local_temperature_calibration = value
}
break;
case tuyaLocal.dataPoints.me167ErrorCode:
switch (value) {
case 0: // OK
result.battery_low = false;
meta.logger.info(`zigbee-herdsman-converters:me167_thermostat: BattOK - Error Code: ` +
`${JSON.stringify(dpValue)}`);
break;
case 1: // Empty Battery
result.battery_low = true;
meta.logger.info(`zigbee-herdsman-converters:me167_thermostat: BattEmtpy - Error Code: ` +
`${JSON.stringify(dpValue)}`);
break;
default:
meta.logger.warn(`zigbee-herdsman-converters:me167_thermostat: Error Code not recognized: ` +
`${JSON.stringify(dpValue)}`);
break;
}
break;
case tuyaLocal.dataPoints.me167FrostGuard:
result.frost_guard = value ? 'ON' : 'OFF';
break;
case tuyaLocal.dataPoints.me167AntiScaling:
result.anti_scaling = value ? 'ON' : 'OFF';
break;
default:
meta.logger.warn(`zigbee-herdsman-converters:me167_thermostat: NOT RECOGNIZED ` +
`DP #${dpValue.dp} with data ${JSON.stringify(dpValue)}`);
}
}
return result;
},
},
};
const tzLocal = {
me167_thermostat_current_heating_setpoint: {
key: ['current_heating_setpoint'],
convertSet: async (entity, key, value, meta) => {
const temp = Math.round(value * 10);
await tuya.sendDataPointValue(entity, tuyaLocal.dataPoints.me167HeatingSetpoint, temp);
},
},
me167_thermostat_system_mode: {
key: ['system_mode'],
convertSet: async (entity, key, value, meta) => {
switch (value) {
case 'off':
await tuya.sendDataPointEnum(entity, tuyaLocal.dataPoints.me167Mode, 2 /* off */);
break;
case 'heat':
await tuya.sendDataPointEnum(entity, tuyaLocal.dataPoints.me167Mode, 1 /* manual */);
break;
case 'auto':
await tuya.sendDataPointEnum(entity, tuyaLocal.dataPoints.me167Mode, 0 /* auto */);
break;
}
},
},
me167_thermostat_child_lock: {
key: ['child_lock'],
convertSet: async (entity, key, value, meta) => {
await tuya.sendDataPointBool(entity, tuyaLocal.dataPoints.me167ChildLock, value === 'LOCK');
},
},
me167_thermostat_schedule: {
key: ['weekly_schedule'],
convertSet: async (entity, key, value, meta) => {
const weekDays=['wed', 'thu', 'fri', 'sat', 'sun', 'mon' , 'tue'];
// we overwirte only the received days. The other ones keep stored on the device
const keys = Object.keys(value);
for (const dayName of keys) { // for loop in order to delete the empty day schedules
const output= []; // empty output byte buffer
const dayNo=weekDays.indexOf(dayName);
output[0]=dayNo+1;
const schedule=value[dayName];
schedule.forEach((el, Index) => {
if (Index <4) {
output[1+4*Index]=el.hour;
output[2+4*Index]=el.minute;
output[3+4*Index]=Math.floor((el.temperature*10)/256);
output[4+4*Index]=(el.temperature*10)%256;
} else {
meta.logger.warn('more than 4 schedule points supplied for week-day '+dayName +
' additional schedule points will be ignored');
}
});
meta.logger.info(`zigbee-herdsman-converters:me167_thermostat: Writing Schedule to ` +
`DP #${tuyaLocal.dataPoints.me167Schedule1+dayNo} with data ${JSON.stringify(output)}`);
await tuya.sendDataPointRaw(entity, tuyaLocal.dataPoints.me167Schedule1+dayNo, output);
await new Promise((r) => setTimeout(r, 2000));
// wait 2 seconds between schedule sends in order not to overload the device
}
},
},
me167_thermostat_calibration: {
key: ['local_temperature_calibration'],
convertSet: async (entity, key, value, meta) => {
if (value >= 0) value = value;
if (value < 0) value = value+4294967295+1;
await tuya.sendDataPointValue(entity, tuyaLocal.dataPoints.me167TempCalibration, value);
},
},
me167_thermostat_anti_scaling: {
key: ['anti_scaling'],
convertSet: async (entity, key, value, meta) => {
await tuya.sendDataPointBool(entity, tuyaLocal.dataPoints.me167AntiScaling, value === 'ON');
},
},
me167_thermostat_frost_guard: {
key: ['frost_guard'],
convertSet: async (entity, key, value, meta) => {
await tuya.sendDataPointBool(entity, tuyaLocal.dataPoints.me167FrostGuard, value === 'ON');
},
},
};
const definition = {
// Since a lot of Tuya devices use the same modelID, but use different data points
// it's usually 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: '_TZE200_bvu2wnxz'
},
],
model: 'ME167',
vendor: 'Avatto',
description: 'Thermostatic radiator valve',
fromZigbee: [
fz.ignore_basic_report, // Add this if you are getting no converter for 'genBasic'
//fz.tuya_data_point_dump, // This is a debug converter, it will be described in the next part
fzLocal.me167_thermostat,
],
toZigbee: [
//tz.tuya_data_point_test, // Another debug converter
tzLocal.me167_thermostat_child_lock,
tzLocal.me167_thermostat_current_heating_setpoint,
tzLocal.me167_thermostat_system_mode,
tzLocal.me167_thermostat_schedule,
tzLocal.me167_thermostat_calibration,
tzLocal.me167_thermostat_anti_scaling,
tzLocal.me167_thermostat_frost_guard,
],
onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic']);
},
exposes: [
e.child_lock(),
exposes.switch().withState('anti_scaling', true).withDescription('Anti Scaling feature is ON or OFF'),
exposes.switch().withState('frost_guard', true).withDescription('Frost Protection feature is ON or OFF'),
exposes.climate().withSetpoint('current_heating_setpoint', 5, 35, 1)
.withLocalTemperature()
.withSystemMode(['auto','heat','off'])
.withRunningState(['idle', 'heat'], ea.STATE)
.withLocalTemperatureCalibration(-10, 10, 1, ea.STATE_SET)
],
};
module.exports = definition;
Thanks for work. I am implemented, however getting errors on "Get":
Debug 2022-11-18 19:29:27Received MQTT message on 'zigbee2mqtt/Termohlavice: Obyvak L/get' with data '{"anti_scaling":""}'
Error 2022-11-18 19:29:27No converter available for 'get' 'anti_scaling' ()
For any of refresh attempt. Is that my device -- I see empty answer...
'{"anti_scaling":""}'
Thx.
The kudos should go to @raketenemo per https://github.com/twhittock/avatto_me167
I don't get any errors and have the debug running since I installed all thermostats. However, I do get a strange behavior as if there is a manufacturer setting overwriting mine.
Commands send via Node-Red seem to take effect only briefly
Manualy overwrite via thermostat seems to be kept
But, settings are only kept for circa 15 to 20 minutes which significantly degrades comfort.
The product page states it is "programmable" so I assume there are some yet to be discovered and thus not exposed settings.
I tried to retrieve / decipher the raw data points as described in https://www.zigbee2mqtt.io/advanced/support-new-devices/03_find_tuya_data_points.html#requirements-and-caveats by registering as described but that tutorial isn't applying anymore and I got stuck.
I will try to follow https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html#_3-understanding-tuya-data-points and attempt to reach out to the manufacturer as well asking for UART protocol and DPIDs data formats for their functions.
Update Checking the manual it becomes apparent that there are different operation modes as such "manual" and "programming". The later indicated by the clock icon on the thermostat display. I figure out that, in order to switch on the thermostat to manual mode, you have to press the "rotator" button twice if it sleeps and once if enabled..
Checking the debug log I traced this back to "system_mode": "auto"
vs. "system_mode": "heat"
. which is an exposed device setting.
About the error upon "GET". The Thermostat can not be actively called. It only support set.
Thanks for work. I am implemented, however getting errors on "Get":
Debug 2022-11-18 19:29:27Received MQTT message on 'zigbee2mqtt/Termohlavice: Obyvak L/get' with data '{"anti_scaling":""}' Error 2022-11-18 19:29:27No converter available for 'get' 'anti_scaling' ()
For any of refresh attempt. Is that my device -- I see empty answer...
'{"anti_scaling":""}'
Thx.
Indeed clicking on the button to retrieve the state of anti_scaling or frost_guard, will trigger an error. I've been comparing the me167.js file with https://github.com/Koenkk/zigbee-herdsman-converters/blob/4f7734b373921fb5524df33a777a290d1bc77bd4/lib/tuya.js.
I aligned the code by looking at other convertors. I ended up with this:
exposes: [
e.child_lock(),
exposes.binary('anti_scaling', ea.STATE_SET, 'ON', 'OFF').withDescription('Anti Scaling feature is ON or OFF'),
exposes.binary('frost_guard', ea.STATE_SET, 'ON', 'OFF').withDescription('Frost Protection feature is ON or OFF'),
exposes.climate().withSetpoint('current_heating_setpoint', 5, 35, 0.5, ea.STATE_SET)
.withLocalTemperature(ea.STATE)
.withSystemMode(['auto','heat','off'], ea.STATE_SET)
.withLocalTemperatureCalibration(-10, 10, 1, ea.STATE_SET)
],
this will result inL
Is there actually merge request opened? This now seems to work for me. If not, I can do that...
So far no PR was made as we are presumably still in discovery phase. The feedback form the manufacturer was not quite constructive as, apparently, he simply wants to sell his stuff (gateway).
Therefore, I dug up the logs to retrieve the date from the "interview" phase when pairing an and device and got this schema:
Raw log
info 2022-11-23 11:20:52: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Thermostatic radiator valve","exposes":[{"features":[{"access":3,"description":"Enables/disables physical input on the device","name":"state","property":"child_lock","type":"binary","value_off":"UNLOCK","value_on":"LOCK"}],"type":"lock"},{"description":"Anti Scaling feature is ON or OFF","features":[{"access":7,"name":"state","property":"anti_scaling","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"description":"Frost Protection feature is ON or OFF","features":[{"access":7,"name":"state","property":"frost_guard","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"features":[{"access":7,"description":"Temperature setpoint","name":"current_heating_setpoint","property":"current_heating_setpoint","type":"numeric","unit":"°C","value_max":35,"value_min":5,"value_step":1},{"access":5,"description":"Current temperature measured on the device","name":"local_temperature","property":"local_temperature","type":"numeric","unit":"°C"},{"access":7,"description":"Mode of this device","name":"system_mode","property":"system_mode","type":"enum","values":["auto","heat","off"]},{"access":1,"description":"The current running state","name":"running_state","property":"running_state","type":"enum","values":["idle","heat"]},{"access":3,"description":"Offset to be used in the local_temperature","name":"local_temperature_calibration","property":"local_temperature_calibration","type":"numeric","unit":"°C","value_max":10,"value_min":-10,"value_step":1}],"type":"climate"},{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"ME167","options":[],"supports_ota":false,"vendor":"Avatto"},"friendly_name":"0x84ba20fffe9a6a5e","ieee_address":"0x84ba20fffe9a6a5e","status":"successful","supported":true},"type":"device_interview"}'
Formatted JSON
{
"data": {
"definition": {
"description": "Thermostatic radiator valve",
"exposes": [
{
"features": [
{
"access": 3,
"description": "Enables/disables physical input on the device",
"name": "state",
"property": "child_lock",
"type": "binary",
"value_off": "UNLOCK",
"value_on": "LOCK"
}
],
"type": "lock"
},
{
"description": "Anti Scaling feature is ON or OFF",
"features": [
{
"access": 7,
"name": "state",
"property": "anti_scaling",
"type": "binary",
"value_off": "OFF",
"value_on": "ON",
"value_toggle": "TOGGLE"
}
],
"type": "switch"
},
{
"description": "Frost Protection feature is ON or OFF",
"features": [
{
"access": 7,
"name": "state",
"property": "frost_guard",
"type": "binary",
"value_off": "OFF",
"value_on": "ON",
"value_toggle": "TOGGLE"
}
],
"type": "switch"
},
{
"features": [
{
"access": 7,
"description": "Temperature setpoint",
"name": "current_heating_setpoint",
"property": "current_heating_setpoint",
"type": "numeric",
"unit": "°C",
"value_max": 35,
"value_min": 5,
"value_step": 1
},
{
"access": 5,
"description": "Current temperature measured on the device",
"name": "local_temperature",
"property": "local_temperature",
"type": "numeric",
"unit": "°C"
},
{
"access": 7,
"description": "Mode of this device",
"name": "system_mode",
"property": "system_mode",
"type": "enum",
"values": [
"auto",
"heat",
"off"
]
},
{
"access": 1,
"description": "The current running state",
"name": "running_state",
"property": "running_state",
"type": "enum",
"values": [
"idle",
"heat"
]
},
{
"access": 3,
"description": "Offset to be used in the local_temperature",
"name": "local_temperature_calibration",
"property": "local_temperature_calibration",
"type": "numeric",
"unit": "°C",
"value_max": 10,
"value_min": -10,
"value_step": 1
}
],
"type": "climate"
},
{
"access": 1,
"description": "Link quality (signal strength)",
"name": "linkquality",
"property": "linkquality",
"type": "numeric",
"unit": "lqi",
"value_max": 255,
"value_min": 0
}
],
"model": "ME167",
"options": [],
"supports_ota": false,
"vendor": "Avatto"
},
"friendly_name": "0x84ba20fffe9a6a5e",
"ieee_address": "0x84ba20fffe9a6a5e",
"status": "successful",
"supported": true
},
"type": "device_interview"
}
However, that seems to be incomplete as I also received a preprogrammed weekly schedule for one day Raw
debug 2022-11-23 10:41:05: Received Zigbee message from '0x84ba20fffe97d741', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[1,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200],"type":"Buffer"},"datatype":0,"dp":28}],"seq":8960}' from endpoint 1 with groupID 0
info 2022-11-23 10:41:05: {"received day":0,"received values":{"type":"Buffer","data":[1,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:05: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
Formatted
{
"dpValues": [
{
"data": {
"data": [
1,
6,
0,
0,
120,
8,
0,
0,
160,
18,
0,
0,
220,
20,
0,
0,
200
],
"type": "Buffer"
},
"datatype": 0,
"dp": 28
}
],
"seq": 8960
}
{
"received day": 0,
"received values": {
"type": "Buffer",
"data": [
1,
6,
0,
0,
120,
8,
0,
0,
160,
18,
0,
0,
220,
20,
0,
0,
200
]
}
}
{
"returned weekly schedule: ": [
{
"temperature": 12,
"hour": 6,
"minute": 0
},
{
"temperature": 16,
"hour": 8,
"minute": 0
},
{
"temperature": 22,
"hour": 18,
"minute": 0
},
{
"temperature": 20,
"hour": 20,
"minute": 0
}
]
}
Raw data for entire weekly schedule
info 2022-11-23 10:41:05: {"received day":0,"received values":{"type":"Buffer","data":[1,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:05: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
info 2022-11-23 10:41:05: MQTT publish: topic 'zigbee2mqtt/0x84ba20fffe97d741', payload '{"anti_scaling":null,"child_lock":"UNLOCK","current_heating_setpoint":5,"device":{"applicationVersion":65,"dateCode":"","friendlyName":"0x84ba20fffe97d741","hardwareVersion":1,"ieeeAddr":"0x84ba20fffe97d741","manufacturerID":4098,"manufacturerName":"_TZE200_bvu2wnxz","model":"ME167","networkAddress":27353,"powerSource":"Battery","stackVersion":0,"type":"EndDevice","zclVersion":3},"frost_guard":null,"last_seen":"2022-11-23T10:41:05+01:00","linkquality":109,"local_temperature":17,"local_temperature_calibration":null,"running_state":"idle","system_mode":"off"}'
debug 2022-11-23 10:41:05: Received Zigbee message from '0x84ba20fffe97d741', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[2,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200],"type":"Buffer"},"datatype":0,"dp":29}],"seq":9216}' from endpoint 1 with groupID 0
info 2022-11-23 10:41:05: {"received day":1,"received values":{"type":"Buffer","data":[2,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:05: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
info 2022-11-23 10:41:05: MQTT publish: topic 'zigbee2mqtt/0x84ba20fffe97d741', payload '{"anti_scaling":null,"child_lock":"UNLOCK","current_heating_setpoint":5,"device":{"applicationVersion":65,"dateCode":"","friendlyName":"0x84ba20fffe97d741","hardwareVersion":1,"ieeeAddr":"0x84ba20fffe97d741","manufacturerID":4098,"manufacturerName":"_TZE200_bvu2wnxz","model":"ME167","networkAddress":27353,"powerSource":"Battery","stackVersion":0,"type":"EndDevice","zclVersion":3},"frost_guard":null,"last_seen":"2022-11-23T10:41:05+01:00","linkquality":109,"local_temperature":17,"local_temperature_calibration":null,"running_state":"idle","system_mode":"off"}'
debug 2022-11-23 10:41:05: Received Zigbee message from '0x84ba20fffe97d741', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[3,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200],"type":"Buffer"},"datatype":0,"dp":30}],"seq":9472}' from endpoint 1 with groupID 0
info 2022-11-23 10:41:05: {"received day":2,"received values":{"type":"Buffer","data":[3,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:05: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
info 2022-11-23 10:41:05: MQTT publish: topic 'zigbee2mqtt/0x84ba20fffe97d741', payload '{"anti_scaling":null,"child_lock":"UNLOCK","current_heating_setpoint":5,"device":{"applicationVersion":65,"dateCode":"","friendlyName":"0x84ba20fffe97d741","hardwareVersion":1,"ieeeAddr":"0x84ba20fffe97d741","manufacturerID":4098,"manufacturerName":"_TZE200_bvu2wnxz","model":"ME167","networkAddress":27353,"powerSource":"Battery","stackVersion":0,"type":"EndDevice","zclVersion":3},"frost_guard":null,"last_seen":"2022-11-23T10:41:05+01:00","linkquality":109,"local_temperature":17,"local_temperature_calibration":null,"running_state":"idle","system_mode":"off"}'
debug 2022-11-23 10:41:06: Received Zigbee message from '0x84ba20fffe97d741', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[4,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200],"type":"Buffer"},"datatype":0,"dp":31}],"seq":9728}' from endpoint 1 with groupID 0
info 2022-11-23 10:41:06: {"received day":3,"received values":{"type":"Buffer","data":[4,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:06: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
info 2022-11-23 10:41:06: MQTT publish: topic 'zigbee2mqtt/0x84ba20fffe97d741', payload '{"anti_scaling":null,"child_lock":"UNLOCK","current_heating_setpoint":5,"device":{"applicationVersion":65,"dateCode":"","friendlyName":"0x84ba20fffe97d741","hardwareVersion":1,"ieeeAddr":"0x84ba20fffe97d741","manufacturerID":4098,"manufacturerName":"_TZE200_bvu2wnxz","model":"ME167","networkAddress":27353,"powerSource":"Battery","stackVersion":0,"type":"EndDevice","zclVersion":3},"frost_guard":null,"last_seen":"2022-11-23T10:41:06+01:00","linkquality":109,"local_temperature":17,"local_temperature_calibration":null,"running_state":"idle","system_mode":"off"}'
debug 2022-11-23 10:41:06: Received Zigbee message from '0x84ba20fffe97d741', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[5,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200],"type":"Buffer"},"datatype":0,"dp":32}],"seq":9984}' from endpoint 1 with groupID 0
info 2022-11-23 10:41:06: {"received day":4,"received values":{"type":"Buffer","data":[5,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:06: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
info 2022-11-23 10:41:06: MQTT publish: topic 'zigbee2mqtt/0x84ba20fffe97d741', payload '{"anti_scaling":null,"child_lock":"UNLOCK","current_heating_setpoint":5,"device":{"applicationVersion":65,"dateCode":"","friendlyName":"0x84ba20fffe97d741","hardwareVersion":1,"ieeeAddr":"0x84ba20fffe97d741","manufacturerID":4098,"manufacturerName":"_TZE200_bvu2wnxz","model":"ME167","networkAddress":27353,"powerSource":"Battery","stackVersion":0,"type":"EndDevice","zclVersion":3},"frost_guard":null,"last_seen":"2022-11-23T10:41:06+01:00","linkquality":109,"local_temperature":17,"local_temperature_calibration":null,"running_state":"idle","system_mode":"off"}'
debug 2022-11-23 10:41:06: Received Zigbee message from '0x84ba20fffe97d741', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[6,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200],"type":"Buffer"},"datatype":0,"dp":33}],"seq":10240}' from endpoint 1 with groupID 0
info 2022-11-23 10:41:06: {"received day":5,"received values":{"type":"Buffer","data":[6,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:06: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
info 2022-11-23 10:41:06: MQTT publish: topic 'zigbee2mqtt/0x84ba20fffe97d741', payload '{"anti_scaling":null,"child_lock":"UNLOCK","current_heating_setpoint":5,"device":{"applicationVersion":65,"dateCode":"","friendlyName":"0x84ba20fffe97d741","hardwareVersion":1,"ieeeAddr":"0x84ba20fffe97d741","manufacturerID":4098,"manufacturerName":"_TZE200_bvu2wnxz","model":"ME167","networkAddress":27353,"powerSource":"Battery","stackVersion":0,"type":"EndDevice","zclVersion":3},"frost_guard":null,"last_seen":"2022-11-23T10:41:06+01:00","linkquality":109,"local_temperature":17,"local_temperature_calibration":null,"running_state":"idle","system_mode":"off"}'
debug 2022-11-23 10:41:06: Received Zigbee message from '0x84ba20fffe97d741', type 'commandDataReport', cluster 'manuSpecificTuya', data '{"dpValues":[{"data":{"data":[7,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200],"type":"Buffer"},"datatype":0,"dp":34}],"seq":10496}' from endpoint 1 with groupID 0
info 2022-11-23 10:41:06: {"received day":6,"received values":{"type":"Buffer","data":[7,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
info 2022-11-23 10:41:06: {"returned weekly schedule: ":[{"temperature":12,"hour":6,"minute":0},{"temperature":16,"hour":8,"minute":0},{"temperature":22,"hour":18,"minute":0},{"temperature":20,"hour":20,"minute":0}]}
info 2022-11-23 10:41:06: MQTT publish: topic 'zigbee2mqtt/0x84ba20fffe97d741', payload '{"anti_scaling":null,"child_lock":"UNLOCK","current_heating_setpoint":5,"device":{"applicationVersion":65,"dateCode":"","friendlyName":"0x84ba20fffe97d741","hardwareVersion":1,"ieeeAddr":"0x84ba20fffe97d741","manufacturerID":4098,"manufacturerName":"_TZE200_bvu2wnxz","model":"ME167","networkAddress":27353,"powerSource":"Battery","stackVersion":0,"type":"EndDevice","zclVersion":3},"frost_guard":null,"last_seen":"2022-11-23T10:41:06+01:00","linkquality":109,"local_temperature":17,"local_temperature_calibration":null,"running_state":"idle","system_mode":"off"}'
The two payloads, Buffer with data and weekly schedule with array, and their structure are not quite conclusive but the first kind of matches the later albeit in a different value order.
Buffer: {"type":"Buffer","data":[1,6,0,0,120,8,0,0,160,18,0,0,220,20,0,0,200]}}
Values: 17 in total
Value Structure
Worth to note the later can be generally described as x*y (x representing the hour and y representing the respective settings). Therefore, the mapping between the two messages looks like so:
[
1, // Day of week, ranging from 1 to 7
6,0,0,120, // Hour of day, unknown or minute, desired temperature as int
8,0,0,160,
18,0,0,220,
20,0,0,200
]
Day-wise
[
{"temperature":12,"hour":6,"minute":0},
{"temperature":16,"hour":8,"minute":0},
{"temperature":22,"hour":18,"minute":0},
{"temperature":20,"hour":20,"minute":0}
]
What is intriguing is the extra value in the buffer message as there are four values vs. three in the day-wise data. Maybe the datatype per initial debug message which is preceding the info messages?
I am also curious if, in order for a day wise scheduling, sending both or only either of two messages is required.
@mikeg-de Hello, I installed according to your introduction. Works great But don't understand where and how to enter the schedules Can I somehow do this via the card or do I need a special card for this? Formatted JSON - in which file does the text go? Formatted - where does that go? or can you upload the finished files? Sorry for my English
Hi I got it working with me167, but when I set system_mode to heat and set a temperature, after some minutes it always returns to auto and changes the temperature set before. Any suggestion? Thanks
@Evgeka07 I haven't figured out the scheduling by back engineering the format form my earlier post https://github.com/Koenkk/zigbee2mqtt/issues/15009#issuecomment-1324892985 either yet. The manufacturer was quite reluctant sharing the UART protocol and DPIDs data formats. had no time to test but plan to do so soon.
@woody4165 check your thermostats. I had the exact same issue and the timing / auto function was active. Please see my previous comment as well:
Checking the manual it becomes apparent that there are different operation modes as such "manual" and "programming". The later indicated by the clock icon on the thermostat display. I figure out that, in order to switch on the thermostat to manual mode, you have to press the "rotator" button twice if it sleeps and once if enabled..
Checking the debug log I traced this back to "system_mode": "auto" vs. "system_mode": "heat". which is an exposed device setting.
@woody4165 check your thermostats. I had the exact same issue and the timing / auto function was active. Please see my previous comment as well:
Checking the manual it becomes apparent that there are different operation modes as such "manual" and "programming". The later indicated by the clock icon on the thermostat display. I figure out that, in order to switch on the thermostat to manual mode, you have to press the "rotator" button twice if it sleeps and once if enabled.. ME167 Thermostat Manual.pdf Checking the debug log I traced this back to "system_mode": "auto" vs. "system_mode": "heat". which is an exposed device setting.
Thanks, I've tried, but strangely after few seconds, sometimes minutes, it returns in programming mode, even if don't do anything physically or from zigbee2mqtt My model should be _TZE200_bvu2wnxz
Thanks, I've tried, but strangely after few seconds, sometimes minutes, it returns in programming mode, even if don't do anything physically or from zigbee2mqtt My model should be _TZE200_bvu2wnxz
Set system mode to "heat", and it will not go back to the schedule, but will just target the setpoint.
I've solved installing the dev branch It was recognized immediately and now it's working well
It's recognized as Brand [TuYa] Model [TS0601_thermostat_3]
Thanks
@woody4165 How did you do it? Can you set the instructions?
@Evgeka07 I've followed these steps https://www.zigbee2mqtt.io/advanced/more/switch-to-dev-branch.html I'm using Proxmox with Z2M in a container. So I was sure that if anything was going to fail, I can restore the backup of the CT
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
Link
https://de.aliexpress.com/item/1005004696707285.html?spm=a2g0o.order_list.0.0.6aaf5c5flG1pw9&gatewayAdapt=glo2deu
https://zigbee.blakadder.com/Avatto_TRV06.html
Database entry
Comments
Pairing did work but getting an unsupported manufacturer error message.
External converter
Checked https://github.com/Koenkk/zigbee2mqtt/discussions/14320 but that dies not work.
Found https://github.com/twhittock/avatto_me167 which happened to be the same manufacturer and model but seems to not work properly as I get errors like
No converter available for 'local_temperature' ("")
Tried creating an external converter myself but failed miserably
Debug log to attempt to generate the converter myself but can't figure out how to create the converter myself.
Supported color modes
No response
Color temperature range
No response