[External Converter]: Moes ZM7LT3 3-Phase Energy Power Meter (_TZE284_cf4b5ktf)
Link
https://aliexpress.com/item/1005012523225629.html
Database entry
{"id":29,"type":"Router","ieeeAddr":"0xa4c1384da9d1fa61","nwkAddr":24043,"manufId":4417,"manufName":"_TZE284_cf4b5ktf","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0,60672],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"��"2i"�"2i'�"2i,�"2i1�"2i6�"2i;�"2i@�"2i","65506":56,"65508":0,"65534":0,"modelId":"TS0601","manufacturerName":"_TZE284_cf4b5ktf","powerSource":1,"zclVersion":3,"appVersion":78,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":78,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"interviewState":"SUCCESSFUL","meta":{"configured":"0.0.0"},"lastSeen":1787828109955}
Zigbee2MQTT version
2.13.0 (fcbb7ff44bdc05a16e95d3472a81d110646cc17b )
External converter
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
// Decodifica um bloco de 18 bytes de uma fase
const decodePhase = (v) => ({
voltage: ((v[2] << 8) | v[3]) / 10,
current: ((v[4] << 16) | (v[5] << 8) | v[6]) / 1000,
power: (v[7] << 16) | (v[8] << 8) | v[9],
power_reactive: (v[10] << 16) | (v[11] << 8) | v[12],
power_apparent: (v[13] << 16) | (v[14] << 8) | v[15],
power_factor: v[16] / 100,
});
// DP 17 - limites de alarme: 3 blocos de 4 bytes [tipo, reservado, valorAlto, valorBaixo]
const decodeAlarmSettings = (v) => ({
over_current_threshold: (v[2] << 8) | v[3],
over_voltage_threshold: (v[6] << 8) | v[7],
under_voltage_threshold: (v[10] << 8) | v[11],
});
const alarmFields = {
over_current_threshold: { offset: 0 },
over_voltage_threshold: { offset: 4 },
under_voltage_threshold: { offset: 8 },
};
const getStoredDp17 = (meta) => {
const stored = globalStore.getValue(meta.device, 'dp17raw');
if (stored) return [...stored];
return [1, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0]; // fallback com os tipos corretos
};
// Cria uma entrada de ESCRITA para um campo específico do DP 17
const makeAlarmWriteEntry = (key) => {
const { offset } = alarmFields[key];
return [17, key, {
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
to: async (value, meta) => {
const buf = getStoredDp17(meta);
buf[offset + 2] = (value >> 8) & 0xFF;
buf[offset + 3] = value & 0xFF;
globalStore.putValue(meta.device, 'dp17raw', buf);
return buf; // array puro, NÃO Buffer
},
}];
};
const definition = {
fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE284_cf4b5ktf' }],
model: 'ZM7LT3',
vendor: 'Moes',
description: 'Smart 3-Phase Energy Power Meter',
extend: [
tuya.modernExtend.tuyaBase({
dp: true,
queryOnConfigure: true,
queryIntervalSeconds: 10, // atualização a cada 5 segundos
}),
],
exposes: [
// Fase A
e.numeric('voltage_l1', ea.STATE).withUnit('V').withDescription('Voltage phase A'),
e.numeric('current_l1', ea.STATE).withUnit('A').withDescription('Current phase A'),
e.numeric('power_l1', ea.STATE).withUnit('W').withDescription('Active power phase A'),
e.numeric('power_reactive_l1', ea.STATE).withUnit('VAR').withDescription('Reactive power phase A'),
e.numeric('power_apparent_l1', ea.STATE).withUnit('VA').withDescription('Apparent power phase A'),
e.numeric('power_factor_l1', ea.STATE).withDescription('Power factor phase A'),
// Fase B
e.numeric('voltage_l2', ea.STATE).withUnit('V').withDescription('Voltage phase B'),
e.numeric('current_l2', ea.STATE).withUnit('A').withDescription('Current phase B'),
e.numeric('power_l2', ea.STATE).withUnit('W').withDescription('Active power phase B'),
e.numeric('power_reactive_l2', ea.STATE).withUnit('VAR').withDescription('Reactive power phase B'),
e.numeric('power_apparent_l2', ea.STATE).withUnit('VA').withDescription('Apparent power phase B'),
e.numeric('power_factor_l2', ea.STATE).withDescription('Power factor phase B'),
// Fase C
e.numeric('voltage_l3', ea.STATE).withUnit('V').withDescription('Voltage phase C'),
e.numeric('current_l3', ea.STATE).withUnit('A').withDescription('Current phase C'),
e.numeric('power_l3', ea.STATE).withUnit('W').withDescription('Active power phase C'),
e.numeric('power_reactive_l3', ea.STATE).withUnit('VAR').withDescription('Reactive power phase C'),
e.numeric('power_apparent_l3', ea.STATE).withUnit('VA').withDescription('Apparent power phase C'),
e.numeric('power_factor_l3', ea.STATE).withDescription('Power factor phase C'),
// Limites de alarme (DP 17) - editáveis
e.numeric('over_current_threshold', ea.ALL).withUnit('A')
.withDescription('Overcurrent alarm threshold (any phase)').withCategory('config'),
e.numeric('over_voltage_threshold', ea.ALL).withUnit('V')
.withDescription('Overvoltage alarm threshold').withCategory('config'),
e.numeric('under_voltage_threshold', ea.ALL).withUnit('V')
.withDescription('Undervoltage alarm threshold').withCategory('config'),
],
meta: {
tuyaDatapoints: [
[6, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l1: d.voltage, current_l1: d.current, power_l1: d.power,
power_reactive_l1: d.power_reactive, power_apparent_l1: d.power_apparent,
power_factor_l1: d.power_factor,
};
}}],
[7, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l2: d.voltage, current_l2: d.current, power_l2: d.power,
power_reactive_l2: d.power_reactive, power_apparent_l2: d.power_apparent,
power_factor_l2: d.power_factor,
};
}}],
[8, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l3: d.voltage, current_l3: d.current, power_l3: d.power,
power_reactive_l3: d.power_reactive, power_apparent_l3: d.power_apparent,
power_factor_l3: d.power_factor,
};
}}],
// Entrada "mestra" - roda na LEITURA e popula os 3 campos de uma vez
[17, null, { from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
}}],
// Entradas específicas - usadas só na ESCRITA
makeAlarmWriteEntry('over_current_threshold'),
makeAlarmWriteEntry('over_voltage_threshold'),
makeAlarmWriteEntry('under_voltage_threshold'),
],
},
};
module.exports = definition;
What does/doesn't work with the external definition?
Recently, I purchased a Moes energy measurement module, model ZM7LT3, and was unpleasantly surprised to discover that it is not compatible with Z2M. I then mapped the DataPoints (DPs) with the help of a similar energy measurement module for which someone had posted the converter here (thanks, guys!).
The module returns 3 DPs: DP 6 (Phase A), DP 7 (Phase B), DP 8 (Phase C), and DP 17 (Alarm threshold values). If anyone feels that any information is missing and can help add to it, I would really appreciate it.
Notes
software_build_id: undefined
date_code: ``
endpoints:
{"1":{"clusters":{"input":["genGroups","genScenes","manuSpecificTuya","genBasic","60672"],"output":["genOta","genTime"]}},"242":{"clusters":{"input":[],"output":["greenPower"]}}}
🙏 Thank you for creating this issue and sharing your external converter!
In case all features work, please submit a pull request on this repository so the device can be supported out-of-the-box with the next release. For instructions on how to create a pull request see the docs.
If NOT all features work, please follow the How To Support new devices. Since this is a Tuya also consider How To Support new Tuya devices.
If you need help with the process, feel free to ask here and we'll be happy to assist.
🙏 Thank you for creating this issue and sharing your external converter!
In case all features work, please submit a pull request on this repository so the device can be supported out-of-the-box with the next release. For instructions on how to create a pull request see the docs.
If NOT all features work, please follow the How To Support new devices. Since this is a Tuya also consider How To Support new Tuya devices.
If you need help with the process, feel free to ask here and we'll be happy to assist.
🙏 Thank you for creating this issue and sharing your external converter!
In case all features work, please submit a pull request on this repository so the device can be supported out-of-the-box with the next release. For instructions on how to create a pull request see the docs.
If NOT all features work, please follow the How To Support new devices. Since this is a Tuya also consider How To Support new Tuya devices.
If you need help with the process, feel free to ask here and we'll be happy to assist.
🙏 Thank you for creating this issue and sharing your external converter!
In case all features work, please submit a pull request on this repository so the device can be supported out-of-the-box with the next release. For instructions on how to create a pull request see the docs.
If NOT all features work, please follow the How To Support new devices. Since this is a Tuya also consider How To Support new Tuya devices.
If you need help with the process, feel free to ask here and we'll be happy to assist.
I made a correction to Bit 2 of Datapoint 17. It was returning the Reactive Power as a positive value, but according to the manufacturer, this value should be treated as negative.
I received the documentation from Moes, which shows some other DPs, but the other datapoints they mention are not actually returned by this module. Only the ones I mentioned are returned: DP 6, 7, 8, and 17.
Here is the updated code.
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
// Decodifica um bloco de 18 bytes de uma fase, aplicando o bitmap de sinal (byte 17)
// bit0=corrente, bit1=potência ativa, bit2=potência reativa, bit3=fator de potência (0=positivo, 1=negativo)
const decodePhase = (v) => {
const signByte = v[17];
const sign = (bit) => (signByte & (1 << bit)) ? -1 : 1;
return {
voltage: ((v[2] << 8) | v[3]) / 10,
current: (((v[4] << 16) | (v[5] << 8) | v[6]) / 1000) * sign(0),
power: ((v[7] << 16) | (v[8] << 8) | v[9]) * sign(1),
power_reactive: ((v[10] << 16) | (v[11] << 8) | v[12]) * sign(2),
power_apparent: (v[13] << 16) | (v[14] << 8) | v[15], // aparente não tem sinal no protocolo
power_factor: (v[16] / 100) * sign(3),
};
};
// DP 17 - limites de alarme: 3 blocos de 4 bytes [tipo, modo_ação, valorAlto, valorBaixo]
// tipo 1 = sobrecorrente (A) | tipo 3 = sobretensão (V) | tipo 4 = subtensão (V)
// modo_ação: 0 = apenas alarme | 1 = desarme automático | 2 = não dispara alarme
const ALARM_ACTION_MODES = { alarm_only: 0, trip: 1, no_alarm: 2 };
const ALARM_ACTION_MODES_REV = { 0: 'alarm_only', 1: 'trip', 2: 'no_alarm' };
const decodeAlarmSettings = (v) => ({
over_current_threshold: (v[2] << 8) | v[3],
over_current_action: ALARM_ACTION_MODES_REV[v[1]] ?? 'alarm_only',
over_voltage_threshold: (v[6] << 8) | v[7],
over_voltage_action: ALARM_ACTION_MODES_REV[v[5]] ?? 'alarm_only',
under_voltage_threshold: (v[10] << 8) | v[11],
under_voltage_action: ALARM_ACTION_MODES_REV[v[9]] ?? 'alarm_only',
});
const alarmFields = {
over_current_threshold: { offset: 0, type: 'value' },
over_current_action: { offset: 0, type: 'action' },
over_voltage_threshold: { offset: 4, type: 'value' },
over_voltage_action: { offset: 4, type: 'action' },
under_voltage_threshold: { offset: 8, type: 'value' },
under_voltage_action: { offset: 8, type: 'action' },
};
const getStoredDp17 = (meta) => {
const stored = globalStore.getValue(meta.device, 'dp17raw');
if (stored) return [...stored];
return [1, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0]; // fallback com os tipos corretos
};
const makeAlarmWriteEntry = (key) => {
const { offset, type } = alarmFields[key];
return [17, key, {
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
to: async (value, meta) => {
const buf = getStoredDp17(meta);
if (type === 'value') {
buf[offset + 2] = (value >> 8) & 0xFF;
buf[offset + 3] = value & 0xFF;
} else {
buf[offset + 1] = ALARM_ACTION_MODES[value] ?? 0;
}
globalStore.putValue(meta.device, 'dp17raw', buf);
return buf;
},
}];
};
const definition = {
fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE284_cf4b5ktf' }],
model: 'ZM7LT3',
vendor: 'Moes',
description: 'Smart 3-Phase Energy Power Meter With CT Sensor Clamps',
extend: [
tuya.modernExtend.tuyaBase({ dp: true, queryOnConfigure: true, queryIntervalSeconds: 10 }),
],
exposes: [
// Fase A
e.numeric('voltage_l1', ea.STATE).withUnit('V').withDescription('Voltage phase A'),
e.numeric('current_l1', ea.STATE).withUnit('A').withDescription('Current phase A'),
e.numeric('power_l1', ea.STATE).withUnit('W').withDescription('Active power phase A'),
e.numeric('power_reactive_l1', ea.STATE).withUnit('VAR').withDescription('Reactive power phase A'),
e.numeric('power_apparent_l1', ea.STATE).withUnit('VA').withDescription('Apparent power phase A'),
e.numeric('power_factor_l1', ea.STATE).withDescription('Power factor phase A'),
// Fase B
e.numeric('voltage_l2', ea.STATE).withUnit('V').withDescription('Voltage phase B'),
e.numeric('current_l2', ea.STATE).withUnit('A').withDescription('Current phase B'),
e.numeric('power_l2', ea.STATE).withUnit('W').withDescription('Active power phase B'),
e.numeric('power_reactive_l2', ea.STATE).withUnit('VAR').withDescription('Reactive power phase B'),
e.numeric('power_apparent_l2', ea.STATE).withUnit('VA').withDescription('Apparent power phase B'),
e.numeric('power_factor_l2', ea.STATE).withDescription('Power factor phase B'),
// Fase C
e.numeric('voltage_l3', ea.STATE).withUnit('V').withDescription('Voltage phase C'),
e.numeric('current_l3', ea.STATE).withUnit('A').withDescription('Current phase C'),
e.numeric('power_l3', ea.STATE).withUnit('W').withDescription('Active power phase C'),
e.numeric('power_reactive_l3', ea.STATE).withUnit('VAR').withDescription('Reactive power phase C'),
e.numeric('power_apparent_l3', ea.STATE).withUnit('VA').withDescription('Apparent power phase C'),
e.numeric('power_factor_l3', ea.STATE).withDescription('Power factor phase C'),
// Limites de alarme (DP 17) - com faixa min/max explícita (corrige a barra no Home Assistant)
e.numeric('over_current_threshold', ea.ALL).withUnit('A')
.withValueMin(0).withValueMax(63).withValueStep(1)
.withDescription('Overcurrent alarm threshold (any phase)').withCategory('config'),
e.numeric('over_voltage_threshold', ea.ALL).withUnit('V')
.withValueMin(0).withValueMax(300).withValueStep(1)
.withDescription('Overvoltage alarm threshold').withCategory('config'),
e.numeric('under_voltage_threshold', ea.ALL).withUnit('V')
.withValueMin(0).withValueMax(300).withValueStep(1)
.withDescription('Undervoltage alarm threshold').withCategory('config'),
// Modo de ação de cada alarme
e.enum('over_current_action', ea.ALL, ['alarm_only', 'trip', 'no_alarm'])
.withDescription('Action taken on overcurrent alarm').withCategory('config'),
e.enum('over_voltage_action', ea.ALL, ['alarm_only', 'trip', 'no_alarm'])
.withDescription('Action taken on overvoltage alarm').withCategory('config'),
e.enum('under_voltage_action', ea.ALL, ['alarm_only', 'trip', 'no_alarm'])
.withDescription('Action taken on undervoltage alarm').withCategory('config'),
],
meta: {
tuyaDatapoints: [
[6, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l1: d.voltage, current_l1: d.current, power_l1: d.power,
power_reactive_l1: d.power_reactive, power_apparent_l1: d.power_apparent,
power_factor_l1: d.power_factor,
};
}}],
[7, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l2: d.voltage, current_l2: d.current, power_l2: d.power,
power_reactive_l2: d.power_reactive, power_apparent_l2: d.power_apparent,
power_factor_l2: d.power_factor,
};
}}],
[8, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l3: d.voltage, current_l3: d.current, power_l3: d.power,
power_reactive_l3: d.power_reactive, power_apparent_l3: d.power_apparent,
power_factor_l3: d.power_factor,
};
}}],
// Entrada "mestra" - roda na LEITURA e popula todos os campos do DP 17
[17, null, { from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
}}],
// Entradas específicas - usadas só na ESCRITA
makeAlarmWriteEntry('over_current_threshold'),
makeAlarmWriteEntry('over_current_action'),
makeAlarmWriteEntry('over_voltage_threshold'),
makeAlarmWriteEntry('over_voltage_action'),
makeAlarmWriteEntry('under_voltage_threshold'),
makeAlarmWriteEntry('under_voltage_action'),
],
},
};
module.exports = definition;
First of all, thanks for mapping this device and sharing the converter. It saved me a lot of work.
I would like to raise a possible issue with the decoding of the power fields, and ask for help confirming it.
In decodePhase, active and reactive power are decoded as unsigned 24-bit integers:
power: (v[7] << 16) | (v[8] << 8) | v[9],
power_reactive: (v[10] << 16) | (v[11] << 8) | v[12],
This works fine for a purely consuming installation, but in my setup one of the branches is a grid-tied PV inverter, so active power on some phases is expected to be negative (export). Reactive power can also be negative depending on the load.
If the device transmits these values as two's complement, the current decoder will report something close to 16,700,000 instead of a negative number. If it transmits magnitude only, then direction of flow is simply not recoverable from the payload, which is also important to know.
A possible fix, assuming two's complement:
const s24 = (x) => (x & 0x800000) ? x - 0x1000000 : x;
power: s24((v[7] << 16) | (v[8] << 8) | v[9]),
power_reactive: s24((v[10] << 16) | (v[11] << 8) | v[12]),
My questions:
- Has anyone tested this device with reverse power flow (PV export or any other generation)? What do the raw bytes look like in that condition?
- Is there any indication in the payload of a separate direction or sign flag, maybe in the unused bytes of the 18-byte block, or in
v[0]/v[1]/v[17]? - Does
power_factor(v[16] / 100) carry any sign or leading/lagging indication, or is it magnitude only?
I ask because I am trying to separate two single-phase loads connected phase-to-phase (A-B and B-C) using the per-phase active and reactive power, and the sign of the reactive component is essential for that calculation to work.
I am happy to run tests and capture raw payloads on my unit if that helps. Just let me know which conditions would be most useful to log.
Thanks again for the work on this converter.
Hi! Let me ask you: which of the two code snippets I posted did you use? The last one? Since I don’t have a solar generation system here, I was really limited when it came to validating it. I made a fix regarding the negative values in the last code.
Could you generate a log for your module in your environment using the following debug code? Let it run for about 1 minute and send me the output! I’ll take a look and try to adjust the code.
Please send me the log starting from the moment you reconfigure the device.
import * as tuya from 'zigbee-herdsman-converters/lib/tuya';
const definition = {
fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE284_cf4b5ktf' }],
model: 'ZM7LT3',
vendor: 'Moes',
description: 'Energy meter - DEBUG mode',
fromZigbee: [
{
cluster: 'manuSpecificTuya',
type: ['commandDataResponse', 'commandDataReport'],
convert: (model, msg, publish, options, meta) => {
for (const dpValue of msg.data.dpValues) {
meta.logger.warning(
`[TUYA DP] dp=${dpValue.dp} datatype=${dpValue.datatype} data=${JSON.stringify(dpValue.data)}`
);
}
return {};
},
},
],
toZigbee: [],
exposes: [],
configure: tuya.configureMagicPacket,
};
export default definition;
Hi! Sorry for the delay — my meter was still uninstalled and I only managed to get it mounted and wired today.
I used your last snippet (the DEBUG converter with meta.logger.warning), with tuya.modernExtend.tuyaBase({ dp: true, queryOnConfigure: true, queryIntervalSeconds: 10 }) added on top so it polls every 10s instead of waiting on the device's own reporting.
Quick note on my wiring topology, since it affects how to interpret the values: Grid -> reference meter (already supported) -> most of the house load (lighting, showers, AC) -> this Moes meter -> [an outlet circuit + the PV inverter, temporarily wired on the same breaker for convenience]. So this meter sees the net of outlet-circuit consumption minus solar generation on phases A and C.
During this capture, the reference meter's produced_energy counter was continuously increasing, meaning the whole house was net-exporting to the grid even with the heavier loads (lighting, AC, etc.) factored in upstream. Since the outlet circuit downstream of this Moes meter draws far less than that, generation should be dominating at this meter's measurement point too — so I believe this is a reasonably valid export test, not a wash between load and generation.
Here is the log, captured during that window:
[2026-09-07 12:56:49] [TUYA DP] dp=6 datatype=0 data=[2,15,5,62,0,26,187,0,3,29,0,1,194,0,3,147,87,2]
[2026-09-07 12:56:49] [TUYA DP] dp=7 datatype=0 data=[2,15,5,53,0,3,222,0,0,115,0,0,5,0,0,115,100,0]
[2026-09-07 12:56:49] [TUYA DP] dp=8 datatype=0 data=[2,15,5,59,0,26,200,0,2,215,0,2,44,0,3,146,80,6]
[2026-09-07 12:56:49] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
[2026-09-07 12:56:59] [TUYA DP] dp=6 datatype=0 data=[2,15,5,63,0,26,92,0,3,19,0,1,188,0,3,136,86,2]
[2026-09-07 12:56:59] [TUYA DP] dp=7 datatype=0 data=[2,15,5,54,0,3,225,0,0,115,0,0,5,0,0,115,100,0]
[2026-09-07 12:56:59] [TUYA DP] dp=8 datatype=0 data=[2,15,5,60,0,26,111,0,2,204,0,2,38,0,3,136,80,6]
[2026-09-07 12:56:59] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
[2026-09-07 12:57:09] [TUYA DP] dp=6 datatype=0 data=[2,15,5,63,0,26,106,0,3,21,0,1,189,0,3,137,87,2]
[2026-09-07 12:57:09] [TUYA DP] dp=7 datatype=0 data=[2,15,5,53,0,3,220,0,0,114,0,0,5,0,0,115,100,0]
[2026-09-07 12:57:09] [TUYA DP] dp=8 datatype=0 data=[2,15,5,60,0,26,126,0,2,207,0,2,39,0,3,137,80,6]
[2026-09-07 12:57:09] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
[2026-09-07 12:57:19] [TUYA DP] dp=6 datatype=0 data=[2,15,5,62,0,26,53,0,3,15,0,1,184,0,3,129,87,2]
[2026-09-07 12:57:19] [TUYA DP] dp=7 datatype=0 data=[2,15,5,51,0,3,217,0,0,114,0,0,5,0,0,115,100,0]
[2026-09-07 12:57:19] [TUYA DP] dp=8 datatype=0 data=[2,15,5,57,0,26,74,0,2,198,0,2,35,0,3,128,80,6]
[2026-09-07 12:57:19] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
[2026-09-07 12:57:29] [TUYA DP] dp=6 datatype=0 data=[2,15,5,63,0,26,14,0,3,9,0,1,184,0,3,125,87,2]
[2026-09-07 12:57:29] [TUYA DP] dp=7 datatype=0 data=[2,15,5,52,0,3,215,0,0,114,0,0,5,0,0,115,100,0]
[2026-09-07 12:57:29] [TUYA DP] dp=8 datatype=0 data=[2,15,5,59,0,26,38,0,2,197,0,2,31,0,3,124,80,6]
[2026-09-07 12:57:29] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
[2026-09-07 12:57:39] [TUYA DP] dp=6 datatype=0 data=[2,15,5,64,0,25,162,0,2,254,0,1,175,0,3,111,87,2]
[2026-09-07 12:57:39] [TUYA DP] dp=7 datatype=0 data=[2,15,5,52,0,3,213,0,0,114,0,0,5,0,0,114,100,0]
[2026-09-07 12:57:39] [TUYA DP] dp=8 datatype=0 data=[2,15,5,59,0,25,185,0,2,182,0,2,26,0,3,110,80,6]
[2026-09-07 12:57:39] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
[2026-09-07 12:57:49] [TUYA DP] dp=6 datatype=0 data=[2,15,5,63,0,25,68,0,2,244,0,1,170,0,3,99,87,2]
[2026-09-07 12:57:49] [TUYA DP] dp=7 datatype=0 data=[2,15,5,51,0,3,212,0,0,114,0,0,5,0,0,114,100,0]
[2026-09-07 12:57:49] [TUYA DP] dp=8 datatype=0 data=[2,15,5,59,0,25,94,0,2,173,0,2,19,0,3,99,78,6]
[2026-09-07 12:57:49] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
[2026-09-07 12:57:59] [TUYA DP] dp=6 datatype=0 data=[2,15,5,62,0,25,14,0,2,235,0,1,165,0,3,90,87,2]
[2026-09-07 12:57:59] [TUYA DP] dp=7 datatype=0 data=[2,15,5,50,0,3,211,0,0,114,0,0,4,0,0,114,100,0]
[2026-09-07 12:57:59] [TUYA DP] dp=8 datatype=0 data=[2,15,5,57,0,25,36,0,2,165,0,2,14,0,3,90,78,6]
[2026-09-07 12:57:59] [TUYA DP] dp=17 datatype=0 data=[1,0,0,63,3,0,1,9,4,0,0,160]
I cross-checked voltage (bytes [2:4] of each DP, /10) against the per-phase voltage reported by the reference meter to confirm which DP maps to which phase:
| DP | Voltage (this meter) | Voltage (reference meter) | Phase |
|---|---|---|---|
| dp=6 | 134.3V | voltage_a = 134.3V | A |
| dp=7 | 133.3V | voltage_b = 133.1V | B |
| dp=8 | 134.0V | voltage_c = 133.8V | C |
This matches the phase assignment from your original converter (dp6=A, dp7=B, dp8=C). My PV is connected on phases A and C, and per the reasoning above, generation should be dominating consumption at this meter's point on those two phases throughout the capture.
Given that, and given that none of the active power bytes (offsets [7:10] within each DP payload) went negative or showed any pattern resembling a sign flip across this whole window, I'm now leaning towards these values genuinely being unsigned, with no separate sign/direction indicator elsewhere in the payload that I've been able to identify either. Let me know if you'd like me to check anything specific (e.g. the reactive power bytes, or byte 16/17), or if you have a different theory to test.
Follow-up to my last message I've just ran a cleaner test. I turned my PV inverter off and back on 10s later; per code it needs to wait before re-injecting, and the first DP report showing generation again was around 1min10s after powering on again.
Looking specifically at byte v[17] (the last byte in each 18-byte DP payload) on the phases with PV connected (dp=6/phase A, dp=8/phase C):
Before/steady low load: v[17] = 4 (both phases)
Ramp-up into generation: v[17] = 6 (transient, both phases)
Steady high generation: v[17] = 2 (both phases)
Right after turning off: v[17] = 4 (both phases, immediately)
While off (no PV): v[17] = 4 (constant, both phases)
Ramp-up on restart: v[17] = 6 (transient again)
Phase B (dp=7, no PV connected) stayed at v[17] = 4 for the entire test, no variation at all, through the whole on/off cycle.
The timing lines up exactly with when I flipped the breaker, both times, so this doesn't look like noise.
This is consistent with the bit-per-field hypothesis you had in your second code revision (bit0=current, bit1=active power, bit2=reactive power, bit3=power factor, 0=positive/1=negative):
- 4 = 0b0100 -> only bit 2 (reactive) set
- 6 = 0b0110 -> bits 1 and 2 (active + reactive) both set
- 2 = 0b0010 -> only bit 1 (active) set
One thing that might help explain the transient "6" during ramp-up/down: PV inverters run at close to unity power factor once they're producing steadily, meaning reactive power sits very close to zero. A value that close to zero could easily flip sign back and forth from measurement noise while the inverter is transitioning in or out of generation, which would explain why bit 2 toggles briefly during the ramp but not during steady state (either fully off or fully generating).
So it looks like your sign-byte fix was right all along — I just didn't have solar to validate it against until now. I've deployed that exact code on my meter and I'm watching the live signed values now to confirm the wattage actually comes through negative during export. Will report back shortly, but this is looking solid.
Edit: Confirmed — your sign-byte fix works exactly as designed. Screenshot attached from the Z2M frontend, taken live during solar export.
Phases A and C, which have PV connected, correctly show negative active power during export. Phase B, with no PV, correctly stays positive (normal consumption). I also double-checked internal consistency by recomputing the power triangle (sqrt(P² + Q²) vs reported apparent power, and P/S vs reported power factor) for all three phases, and everything checks out.
This looks ready to merge as far as I'm concerned. Thanks again for working through this with me, and sorry it took so many rounds to get a proper solar test in.
That's awesome, man! I'm glad to hear it worked out. Exactly, the negative values on phases A and C are due to power being fed back into the grid (reverse power flow).
The only thing that's still puzzling me about this module is that the Tuya app shows the grid frequency, but I haven't been able to map the frequency data through the DataPoints at all. If you have any ideas, I'm open to suggestions! I think maybe Moes sets a fixed value (50 or 60 Hz) based on your location. But that's just a guess.
Which version of the converter is the latest?
Which version of the converter is the latest?
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const tuya = require('zigbee-herdsman-converters/lib/tuya');
const globalStore = require('zigbee-herdsman-converters/lib/store');
const e = exposes.presets;
const ea = exposes.access;
// Decodifica um bloco de 18 bytes de uma fase, aplicando o bitmap de sinal (byte 17)
// bit0=corrente, bit1=potência ativa, bit2=potência reativa, bit3=fator de potência (0=positivo, 1=negativo)
const decodePhase = (v) => {
const signByte = v[17];
const sign = (bit) => (signByte & (1 << bit)) ? -1 : 1;
return {
voltage: ((v[2] << 8) | v[3]) / 10,
current: (((v[4] << 16) | (v[5] << 8) | v[6]) / 1000) * sign(0),
power: ((v[7] << 16) | (v[8] << 8) | v[9]) * sign(1),
power_reactive: ((v[10] << 16) | (v[11] << 8) | v[12]) * sign(2),
power_apparent: (v[13] << 16) | (v[14] << 8) | v[15], // aparente não tem sinal no protocolo
power_factor: (v[16] / 100) * sign(3),
};
};
// DP 17 - limites de alarme: 3 blocos de 4 bytes [tipo, modo_ação, valorAlto, valorBaixo]
// tipo 1 = sobrecorrente (A) | tipo 3 = sobretensão (V) | tipo 4 = subtensão (V)
// modo_ação: 0 = apenas alarme | 1 = desarme automático | 2 = não dispara alarme
const ALARM_ACTION_MODES = { alarm_only: 0, trip: 1, no_alarm: 2 };
const ALARM_ACTION_MODES_REV = { 0: 'alarm_only', 1: 'trip', 2: 'no_alarm' };
const decodeAlarmSettings = (v) => ({
over_current_threshold: (v[2] << 8) | v[3],
over_current_action: ALARM_ACTION_MODES_REV[v[1]] ?? 'alarm_only',
over_voltage_threshold: (v[6] << 8) | v[7],
over_voltage_action: ALARM_ACTION_MODES_REV[v[5]] ?? 'alarm_only',
under_voltage_threshold: (v[10] << 8) | v[11],
under_voltage_action: ALARM_ACTION_MODES_REV[v[9]] ?? 'alarm_only',
});
const alarmFields = {
over_current_threshold: { offset: 0, type: 'value' },
over_current_action: { offset: 0, type: 'action' },
over_voltage_threshold: { offset: 4, type: 'value' },
over_voltage_action: { offset: 4, type: 'action' },
under_voltage_threshold: { offset: 8, type: 'value' },
under_voltage_action: { offset: 8, type: 'action' },
};
const getStoredDp17 = (meta) => {
const stored = globalStore.getValue(meta.device, 'dp17raw');
if (stored) return [...stored];
return [1, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0]; // fallback com os tipos corretos
};
const makeAlarmWriteEntry = (key) => {
const { offset, type } = alarmFields[key];
return [17, key, {
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
to: async (value, meta) => {
const buf = getStoredDp17(meta);
if (type === 'value') {
buf[offset + 2] = (value >> 8) & 0xFF;
buf[offset + 3] = value & 0xFF;
} else {
buf[offset + 1] = ALARM_ACTION_MODES[value] ?? 0;
}
globalStore.putValue(meta.device, 'dp17raw', buf);
return buf;
},
}];
};
const definition = {
fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE284_cf4b5ktf' }],
model: 'ZM7LT3',
vendor: 'Moes',
description: 'Smart 3-Phase Energy Power Meter With CT Sensor Clamps',
extend: [
tuya.modernExtend.tuyaBase({ dp: true, queryOnConfigure: true, queryIntervalSeconds: 10 }),
],
exposes: [
// Fase A
e.numeric('voltage_l1', ea.STATE).withUnit('V').withDescription('Voltage phase A'),
e.numeric('current_l1', ea.STATE).withUnit('A').withDescription('Current phase A'),
e.numeric('power_l1', ea.STATE).withUnit('W').withDescription('Active power phase A'),
e.numeric('power_reactive_l1', ea.STATE).withUnit('VAR').withDescription('Reactive power phase A'),
e.numeric('power_apparent_l1', ea.STATE).withUnit('VA').withDescription('Apparent power phase A'),
e.numeric('power_factor_l1', ea.STATE).withDescription('Power factor phase A'),
// Fase B
e.numeric('voltage_l2', ea.STATE).withUnit('V').withDescription('Voltage phase B'),
e.numeric('current_l2', ea.STATE).withUnit('A').withDescription('Current phase B'),
e.numeric('power_l2', ea.STATE).withUnit('W').withDescription('Active power phase B'),
e.numeric('power_reactive_l2', ea.STATE).withUnit('VAR').withDescription('Reactive power phase B'),
e.numeric('power_apparent_l2', ea.STATE).withUnit('VA').withDescription('Apparent power phase B'),
e.numeric('power_factor_l2', ea.STATE).withDescription('Power factor phase B'),
// Fase C
e.numeric('voltage_l3', ea.STATE).withUnit('V').withDescription('Voltage phase C'),
e.numeric('current_l3', ea.STATE).withUnit('A').withDescription('Current phase C'),
e.numeric('power_l3', ea.STATE).withUnit('W').withDescription('Active power phase C'),
e.numeric('power_reactive_l3', ea.STATE).withUnit('VAR').withDescription('Reactive power phase C'),
e.numeric('power_apparent_l3', ea.STATE).withUnit('VA').withDescription('Apparent power phase C'),
e.numeric('power_factor_l3', ea.STATE).withDescription('Power factor phase C'),
// Limites de alarme (DP 17) - com faixa min/max explícita (corrige a barra no Home Assistant)
e.numeric('over_current_threshold', ea.ALL).withUnit('A')
.withValueMin(0).withValueMax(63).withValueStep(1)
.withDescription('Overcurrent alarm threshold (any phase)').withCategory('config'),
e.numeric('over_voltage_threshold', ea.ALL).withUnit('V')
.withValueMin(0).withValueMax(300).withValueStep(1)
.withDescription('Overvoltage alarm threshold').withCategory('config'),
e.numeric('under_voltage_threshold', ea.ALL).withUnit('V')
.withValueMin(0).withValueMax(300).withValueStep(1)
.withDescription('Undervoltage alarm threshold').withCategory('config'),
// Modo de ação de cada alarme
e.enum('over_current_action', ea.ALL, ['alarm_only', 'trip', 'no_alarm'])
.withDescription('Action taken on overcurrent alarm').withCategory('config'),
e.enum('over_voltage_action', ea.ALL, ['alarm_only', 'trip', 'no_alarm'])
.withDescription('Action taken on overvoltage alarm').withCategory('config'),
e.enum('under_voltage_action', ea.ALL, ['alarm_only', 'trip', 'no_alarm'])
.withDescription('Action taken on undervoltage alarm').withCategory('config'),
],
meta: {
tuyaDatapoints: [
[6, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l1: d.voltage, current_l1: d.current, power_l1: d.power,
power_reactive_l1: d.power_reactive, power_apparent_l1: d.power_apparent,
power_factor_l1: d.power_factor,
};
}}],
[7, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l2: d.voltage, current_l2: d.current, power_l2: d.power,
power_reactive_l2: d.power_reactive, power_apparent_l2: d.power_apparent,
power_factor_l2: d.power_factor,
};
}}],
[8, null, { from: (v) => {
const d = decodePhase(v);
return {
voltage_l3: d.voltage, current_l3: d.current, power_l3: d.power,
power_reactive_l3: d.power_reactive, power_apparent_l3: d.power_apparent,
power_factor_l3: d.power_factor,
};
}}],
// Entrada "mestra" - roda na LEITURA e popula todos os campos do DP 17
[17, null, { from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
}}],
// Entradas específicas - usadas só na ESCRITA
makeAlarmWriteEntry('over_current_threshold'),
makeAlarmWriteEntry('over_current_action'),
makeAlarmWriteEntry('over_voltage_threshold'),
makeAlarmWriteEntry('over_voltage_action'),
makeAlarmWriteEntry('under_voltage_threshold'),
makeAlarmWriteEntry('under_voltage_action'),
],
},
};
module.exports = definition;
update for new Z2M (ES Module)
import * as exposes from 'zigbee-herdsman-converters/lib/exposes';
import * as tuya from 'zigbee-herdsman-converters/lib/tuya';
import * as globalStore from 'zigbee-herdsman-converters/lib/store';
const e = exposes.presets;
const ea = exposes.access;
// Decodifica um bloco de 18 bytes de uma fase, aplicando o bitmap de sinal (byte 17)
// bit0=corrente, bit1=potência ativa, bit2=potência reativa, bit3=fator de potência
// 0=positivo, 1=negativo
const decodePhase = (v) => {
const signByte = v[17];
const sign = (bit) => (signByte & (1 << bit)) ? -1 : 1;
return {
voltage: ((v[2] << 8) | v[3]) / 10,
current: (((v[4] << 16) | (v[5] << 8) | v[6]) / 1000) * sign(0),
power: ((v[7] << 16) | (v[8] << 8) | v[9]) * sign(1),
power_reactive: ((v[10] << 16) | (v[11] << 8) | v[12]) * sign(2),
power_apparent: (v[13] << 16) | (v[14] << 8) | v[15],
power_factor: (v[16] / 100) * sign(3),
};
};
// DP 17 - limites de alarme:
// 3 blocos de 4 bytes [tipo, modo_ação, valorAlto, valorBaixo]
//
// tipo:
// 1 = sobrecorrente (A)
// 3 = sobretensão (V)
// 4 = subtensão (V)
//
// modo_ação:
// 0 = apenas alarme
// 1 = desarme automático
// 2 = não dispara alarme
const ALARM_ACTION_MODES = {
alarm_only: 0,
trip: 1,
no_alarm: 2,
};
const ALARM_ACTION_MODES_REV = {
0: 'alarm_only',
1: 'trip',
2: 'no_alarm',
};
const decodeAlarmSettings = (v) => ({
over_current_threshold: (v[2] << 8) | v[3],
over_current_action: ALARM_ACTION_MODES_REV[v[1]] ?? 'alarm_only',
over_voltage_threshold: (v[6] << 8) | v[7],
over_voltage_action: ALARM_ACTION_MODES_REV[v[5]] ?? 'alarm_only',
under_voltage_threshold: (v[10] << 8) | v[11],
under_voltage_action: ALARM_ACTION_MODES_REV[v[9]] ?? 'alarm_only',
});
const alarmFields = {
over_current_threshold: {
offset: 0,
type: 'value',
},
over_current_action: {
offset: 0,
type: 'action',
},
over_voltage_threshold: {
offset: 4,
type: 'value',
},
over_voltage_action: {
offset: 4,
type: 'action',
},
under_voltage_threshold: {
offset: 8,
type: 'value',
},
under_voltage_action: {
offset: 8,
type: 'action',
},
};
const getStoredDp17 = (meta) => {
const stored = globalStore.getValue(meta.device, 'dp17raw');
if (stored) {
return [...stored];
}
// fallback com os tipos corretos
return [
1, 0, 0, 0,
3, 0, 0, 0,
4, 0, 0, 0,
];
};
const makeAlarmWriteEntry = (key) => {
const {offset, type} = alarmFields[key];
return [
17,
key,
{
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
to: async (value, meta) => {
const buf = getStoredDp17(meta);
if (type === 'value') {
buf[offset + 2] = (value >> 8) & 0xff;
buf[offset + 3] = value & 0xff;
} else {
buf[offset + 1] = ALARM_ACTION_MODES[value] ?? 0;
}
globalStore.putValue(meta.device, 'dp17raw', buf);
return buf;
},
},
];
};
const definition = {
fingerprint: [
{
modelID: 'TS0601',
manufacturerName: '_TZE284_cf4b5ktf',
},
],
model: 'ZM7LT3',
vendor: 'Moes',
description: 'Smart 3-Phase Energy Power Meter With CT Sensor Clamps',
extend: [
tuya.modernExtend.tuyaBase({
dp: true,
queryOnConfigure: true,
queryIntervalSeconds: 10,
}),
],
exposes: [
// Phase A
e.numeric('voltage_l1', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase A'),
e.numeric('current_l1', ea.STATE)
.withUnit('A')
.withDescription('Current phase A'),
e.numeric('power_l1', ea.STATE)
.withUnit('W')
.withDescription('Active power phase A'),
e.numeric('power_reactive_l1', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase A'),
e.numeric('power_apparent_l1', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase A'),
e.numeric('power_factor_l1', ea.STATE)
.withDescription('Power factor phase A'),
// Phase B
e.numeric('voltage_l2', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase B'),
e.numeric('current_l2', ea.STATE)
.withUnit('A')
.withDescription('Current phase B'),
e.numeric('power_l2', ea.STATE)
.withUnit('W')
.withDescription('Active power phase B'),
e.numeric('power_reactive_l2', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase B'),
e.numeric('power_apparent_l2', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase B'),
e.numeric('power_factor_l2', ea.STATE)
.withDescription('Power factor phase B'),
// Phase C
e.numeric('voltage_l3', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase C'),
e.numeric('current_l3', ea.STATE)
.withUnit('A')
.withDescription('Current phase C'),
e.numeric('power_l3', ea.STATE)
.withUnit('W')
.withDescription('Active power phase C'),
e.numeric('power_reactive_l3', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase C'),
e.numeric('power_apparent_l3', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase C'),
e.numeric('power_factor_l3', ea.STATE)
.withDescription('Power factor phase C'),
// Alarm thresholds
e.numeric('over_current_threshold', ea.ALL)
.withUnit('A')
.withValueMin(0)
.withValueMax(63)
.withValueStep(1)
.withDescription('Overcurrent alarm threshold (any phase)')
.withCategory('config'),
e.numeric('over_voltage_threshold', ea.ALL)
.withUnit('V')
.withValueMin(0)
.withValueMax(300)
.withValueStep(1)
.withDescription('Overvoltage alarm threshold')
.withCategory('config'),
e.numeric('under_voltage_threshold', ea.ALL)
.withUnit('V')
.withValueMin(0)
.withValueMax(300)
.withValueStep(1)
.withDescription('Undervoltage alarm threshold')
.withCategory('config'),
// Alarm actions
e.enum(
'over_current_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on overcurrent alarm')
.withCategory('config'),
e.enum(
'over_voltage_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on overvoltage alarm')
.withCategory('config'),
e.enum(
'under_voltage_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on undervoltage alarm')
.withCategory('config'),
],
meta: {
tuyaDatapoints: [
[
6,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l1: d.voltage,
current_l1: d.current,
power_l1: d.power,
power_reactive_l1: d.power_reactive,
power_apparent_l1: d.power_apparent,
power_factor_l1: d.power_factor,
};
},
},
],
[
7,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l2: d.voltage,
current_l2: d.current,
power_l2: d.power,
power_reactive_l2: d.power_reactive,
power_apparent_l2: d.power_apparent,
power_factor_l2: d.power_factor,
};
},
},
],
[
8,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l3: d.voltage,
current_l3: d.current,
power_l3: d.power,
power_reactive_l3: d.power_reactive,
power_apparent_l3: d.power_apparent,
power_factor_l3: d.power_factor,
};
},
},
],
// Master DP17 entry:
// used when reading the datapoint.
[
17,
null,
{
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
},
],
// Specific entries used for writing individual DP17 fields
makeAlarmWriteEntry('over_current_threshold'),
makeAlarmWriteEntry('over_current_action'),
makeAlarmWriteEntry('over_voltage_threshold'),
makeAlarmWriteEntry('over_voltage_action'),
makeAlarmWriteEntry('under_voltage_threshold'),
makeAlarmWriteEntry('under_voltage_action'),
],
},
};
export default definition;
Hi, thx for your converter. I imptoved something: Add energy (DP 1, ÷100 кВт·ч), power (DP 9, Вт), power_reactive (DP 47), power_apparent (DP 48), power_factor (DP 53, ÷100) Add claster 57344, It's the temperature
See beelow: import * as exposes from 'zigbee-herdsman-converters/lib/exposes'; import * as tuya from 'zigbee-herdsman-converters/lib/tuya'; import * as globalStore from 'zigbee-herdsman-converters/lib/store';
const e = exposes.presets; const ea = exposes.access;
// --------------------------------------------------------------------------- // Блок одной фазы (DP 6 / 7 / 8), 18 байт, индексы с 0: // 0-1 константа (2, 15), не используется // 2-3 напряжение, ÷10 -> В // 4-6 ток, ÷1000 -> А // 7-9 активная мощность, Вт // 10-12 реактивная мощность, вар // 13-15 полная мощность, ВА // 16 коэффициент мощности, % (÷100) // 17 битовая маска знаков (1 = отрицательное значение): // bit0 ток, bit1 активная, bit2 реактивная, bit3 коэффициент мощности // В логах встречались только значения 0 и 4, то есть проверен только bit2 // (знак реактивной мощности). Остальные биты основаны на предположении. // --------------------------------------------------------------------------- const decodePhase = (v) => { const signByte = v[17]; const sign = (bit) => (signByte & (1 << bit)) ? -1 : 1;
return {
voltage: ((v[2] << 8) | v[3]) / 10,
current: (((v[4] << 16) | (v[5] << 8) | v[6]) / 1000) * sign(0),
power: ((v[7] << 16) | (v[8] << 8) | v[9]) * sign(1),
power_reactive: ((v[10] << 16) | (v[11] << 8) | v[12]) * sign(2),
power_apparent: (v[13] << 16) | (v[14] << 8) | v[15],
power_factor: (v[16] / 100) * sign(3),
};
};
// --------------------------------------------------------------------------- // DP 17 - пороги защиты: 3 блока по 4 байта [тип, режим, старший байт, младший байт] // тип: 1 = макс. ток (А), 3 = перенапряжение (В), 4 = недонапряжение (В) // режим: 0 = только тревога, 1 = автоотключение, 2 = без тревоги // Подтверждено по логам: значения 63/265/160 -> 40/280/110 читаются верно. // В логах встречался только режим 0; режимы 1 и 2 не проверялись. // --------------------------------------------------------------------------- const ALARM_ACTION_MODES = { alarm_only: 0, trip: 1, no_alarm: 2, };
const ALARM_ACTION_MODES_REV = { 0: 'alarm_only', 1: 'trip', 2: 'no_alarm', };
const decodeAlarmSettings = (v) => ({ over_current_threshold: (v[2] << 8) | v[3], over_current_action: ALARM_ACTION_MODES_REV[v[1]] ?? 'alarm_only',
over_voltage_threshold: (v[6] << 8) | v[7],
over_voltage_action: ALARM_ACTION_MODES_REV[v[5]] ?? 'alarm_only',
under_voltage_threshold: (v[10] << 8) | v[11],
under_voltage_action: ALARM_ACTION_MODES_REV[v[9]] ?? 'alarm_only',
});
const alarmFields = { over_current_threshold: { offset: 0, type: 'value', }, over_current_action: { offset: 0, type: 'action', }, over_voltage_threshold: { offset: 4, type: 'value', }, over_voltage_action: { offset: 4, type: 'action', }, under_voltage_threshold: { offset: 8, type: 'value', }, under_voltage_action: { offset: 8, type: 'action', }, };
const getStoredDp17 = (meta) => { const stored = globalStore.getValue(meta.device, 'dp17raw');
// Без последнего принятого DP 17 запись невозможна: иначе остальные два порога
// были бы перезаписаны нулями.
if (!stored) {
throw new Error(
'DP 17 ещё не получен от счётчика (он приходит примерно раз в 10 с). ' +
'Повторите команду через несколько секунд.',
);
}
return [...stored];
};
const makeAlarmWriteEntry = (key) => { const {offset, type} = alarmFields[key];
return [
17,
key,
{
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
to: async (value, meta) => {
const buf = getStoredDp17(meta);
if (type === 'value') {
buf[offset + 2] = (value >> 8) & 0xff;
buf[offset + 3] = value & 0xff;
} else {
buf[offset + 1] = ALARM_ACTION_MODES[value] ?? 0;
}
globalStore.putValue(meta.device, 'dp17raw', buf);
return buf;
},
},
];
};
// --------------------------------------------------------------------------- // Кластер 0xE000 (57344), сообщения type 'raw': 3 байта [старший, младший, ?] // Принято считать: байты 0-1 = температура внутри счётчика, ÷100 -> °C // (2373 -> 23,73 °C). Растёт под нагрузкой и медленно снижается после отключения. // Третий байт (208 или 210) не расшифрован и игнорируется. // Пакет приходит 3-5 раз подряд с одним значением, повторы отбрасываются. // Конвертер зарегистрирован для строкового и числового идентификатора кластера, // так как для неизвестных кластеров он может приходить в любом из видов. // --------------------------------------------------------------------------- const makeDeviceTemperatureConverter = (cluster) => ({ cluster, type: ['raw'], convert: (model, msg, publish, options, meta) => { const buf = msg.data;
if (!buf || buf.length < 2) {
return;
}
const temperature = ((buf[0] << 8) | buf[1]) / 100;
// отсечь заведомо недостоверные значения
if (temperature < -40 || temperature > 150) {
return;
}
// не публиковать повторы
if (meta?.state?.device_temperature === temperature) {
return;
}
return {device_temperature: temperature};
},
});
const fzDeviceTemperature = [ makeDeviceTemperatureConverter('57344'), makeDeviceTemperatureConverter(57344), ];
const definition = { fingerprint: [ { modelID: 'TS0601', manufacturerName: '_TZE28C1000000_cf4b5ktf', }, ],
model: 'ZM7LT3',
vendor: 'Moes',
description: 'Smart 3-Phase Energy Power Meter With CT Sensor Clamps',
extend: [
tuya.modernExtend.tuyaBase({
dp: true,
queryOnConfigure: true,
queryIntervalSeconds: 10,
}),
],
// Конвертер для кластера 57344 (raw). Объединяется с конвертерами из extend.
fromZigbee: fzDeviceTemperature,
exposes: [
// Суммарные показатели
e.energy(),
e.power(),
e.power_reactive(),
e.power_apparent(),
e.power_factor(),
// Температура внутри счётчика (кластер 57344)
e.device_temperature(),
// Phase A
e.numeric('voltage_l1', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase A'),
e.numeric('current_l1', ea.STATE)
.withUnit('A')
.withDescription('Current phase A'),
e.numeric('power_l1', ea.STATE)
.withUnit('W')
.withDescription('Active power phase A'),
e.numeric('power_reactive_l1', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase A'),
e.numeric('power_apparent_l1', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase A'),
e.numeric('power_factor_l1', ea.STATE)
.withDescription('Power factor phase A'),
// Phase B
e.numeric('voltage_l2', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase B'),
e.numeric('current_l2', ea.STATE)
.withUnit('A')
.withDescription('Current phase B'),
e.numeric('power_l2', ea.STATE)
.withUnit('W')
.withDescription('Active power phase B'),
e.numeric('power_reactive_l2', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase B'),
e.numeric('power_apparent_l2', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase B'),
e.numeric('power_factor_l2', ea.STATE)
.withDescription('Power factor phase B'),
// Phase C
e.numeric('voltage_l3', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase C'),
e.numeric('current_l3', ea.STATE)
.withUnit('A')
.withDescription('Current phase C'),
e.numeric('power_l3', ea.STATE)
.withUnit('W')
.withDescription('Active power phase C'),
e.numeric('power_reactive_l3', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase C'),
e.numeric('power_apparent_l3', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase C'),
e.numeric('power_factor_l3', ea.STATE)
.withDescription('Power factor phase C'),
// Alarm thresholds
e.numeric('over_current_threshold', ea.ALL)
.withUnit('A')
.withValueMin(0)
.withValueMax(63)
.withValueStep(1)
.withDescription('Overcurrent alarm threshold (any phase)')
.withCategory('config'),
e.numeric('over_voltage_threshold', ea.ALL)
.withUnit('V')
.withValueMin(0)
.withValueMax(300)
.withValueStep(1)
.withDescription('Overvoltage alarm threshold')
.withCategory('config'),
e.numeric('under_voltage_threshold', ea.ALL)
.withUnit('V')
.withValueMin(0)
.withValueMax(300)
.withValueStep(1)
.withDescription('Undervoltage alarm threshold')
.withCategory('config'),
// Alarm actions
e.enum(
'over_current_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on overcurrent alarm')
.withCategory('config'),
e.enum(
'over_voltage_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on overvoltage alarm')
.withCategory('config'),
e.enum(
'under_voltage_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on undervoltage alarm')
.withCategory('config'),
],
meta: {
tuyaDatapoints: [
// Суммарные показатели. Подтверждены сверкой с суммой по фазам:
// DP 9 = P_A+P_B+P_C, DP 48 = S_A+S_B+S_C, DP 47 = |Q_A|+|Q_B|+|Q_C|.
// DP 51 дублирует DP 1 и не используется.
[1, 'energy', tuya.valueConverter.divideBy100], // кВт·ч
[9, 'power', tuya.valueConverter.raw], // Вт
[47, 'power_reactive', tuya.valueConverter.raw], // вар
[48, 'power_apparent', tuya.valueConverter.raw], // ВА
[53, 'power_factor', tuya.valueConverter.divideBy100], // 0..1
[
6,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l1: d.voltage,
current_l1: d.current,
power_l1: d.power,
power_reactive_l1: d.power_reactive,
power_apparent_l1: d.power_apparent,
power_factor_l1: d.power_factor,
};
},
},
],
[
7,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l2: d.voltage,
current_l2: d.current,
power_l2: d.power,
power_reactive_l2: d.power_reactive,
power_apparent_l2: d.power_apparent,
power_factor_l2: d.power_factor,
};
},
},
],
[
8,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l3: d.voltage,
current_l3: d.current,
power_l3: d.power,
power_reactive_l3: d.power_reactive,
power_apparent_l3: d.power_apparent,
power_factor_l3: d.power_factor,
};
},
},
],
// Master DP17 entry:
// используется при чтении (берётся первая запись с этим DP).
[
17,
null,
{
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
},
],
// Отдельные записи для записи полей DP17
makeAlarmWriteEntry('over_current_threshold'),
makeAlarmWriteEntry('over_current_action'),
makeAlarmWriteEntry('over_voltage_threshold'),
makeAlarmWriteEntry('over_voltage_action'),
makeAlarmWriteEntry('under_voltage_threshold'),
makeAlarmWriteEntry('under_voltage_action'),
],
},
};
export default definition;
Sorry, comments by english. One deyail/ I've changed fingerprint to
manufacturerName: '_TZE28C1000000_cf4b5ktf',
import * as exposes from 'zigbee-herdsman-converters/lib/exposes'; import * as tuya from 'zigbee-herdsman-converters/lib/tuya'; import * as globalStore from 'zigbee-herdsman-converters/lib/store';
const e = exposes.presets; const ea = exposes.access;
// --------------------------------------------------------------------------- // One phase block (DP 6 / 7 / 8), 18 bytes, 0-based indices: // 0-1 constant (2, 15), unused // 2-3 voltage, /10 -> V // 4-6 current, /1000 -> A // 7-9 active power, W // 10-12 reactive power, var // 13-15 apparent power, VA // 16 power factor, % (/100) // 17 sign bitmask (1 = negative value): // bit0 current, bit1 active power, bit2 reactive power, bit3 power factor // Only the values 0 and 4 were seen in the logs, so only bit2 // (sign of reactive power) is verified. The other bits are assumptions. // --------------------------------------------------------------------------- const decodePhase = (v) => { const signByte = v[17]; const sign = (bit) => (signByte & (1 << bit)) ? -1 : 1;
return {
voltage: ((v[2] << 8) | v[3]) / 10,
current: (((v[4] << 16) | (v[5] << 8) | v[6]) / 1000) * sign(0),
power: ((v[7] << 16) | (v[8] << 8) | v[9]) * sign(1),
power_reactive: ((v[10] << 16) | (v[11] << 8) | v[12]) * sign(2),
power_apparent: (v[13] << 16) | (v[14] << 8) | v[15],
power_factor: (v[16] / 100) * sign(3),
};
};
// --------------------------------------------------------------------------- // DP 17 - protection thresholds: 3 blocks of 4 bytes [type, mode, high byte, low byte] // type: 1 = max current (A), 3 = overvoltage (V), 4 = undervoltage (V) // mode: 0 = alarm only, 1 = auto trip, 2 = no alarm // Verified against logs: values 63/265/160 -> 40/280/110 are read correctly. // Only mode 0 was seen in the logs; modes 1 and 2 are untested. // --------------------------------------------------------------------------- const ALARM_ACTION_MODES = { alarm_only: 0, trip: 1, no_alarm: 2, };
const ALARM_ACTION_MODES_REV = { 0: 'alarm_only', 1: 'trip', 2: 'no_alarm', };
const decodeAlarmSettings = (v) => ({ over_current_threshold: (v[2] << 8) | v[3], over_current_action: ALARM_ACTION_MODES_REV[v[1]] ?? 'alarm_only',
over_voltage_threshold: (v[6] << 8) | v[7],
over_voltage_action: ALARM_ACTION_MODES_REV[v[5]] ?? 'alarm_only',
under_voltage_threshold: (v[10] << 8) | v[11],
under_voltage_action: ALARM_ACTION_MODES_REV[v[9]] ?? 'alarm_only',
});
const alarmFields = { over_current_threshold: { offset: 0, type: 'value', }, over_current_action: { offset: 0, type: 'action', }, over_voltage_threshold: { offset: 4, type: 'value', }, over_voltage_action: { offset: 4, type: 'action', }, under_voltage_threshold: { offset: 8, type: 'value', }, under_voltage_action: { offset: 8, type: 'action', }, };
const getStoredDp17 = (meta) => { const stored = globalStore.getValue(meta.device, 'dp17raw');
// Writing is impossible without a previously received DP 17: otherwise the
// other two thresholds would be overwritten with zeros.
if (!stored) {
throw new Error(
'DP 17 has not been received from the meter yet (it arrives about every 10 s). ' +
'Repeat the command in a few seconds.',
);
}
return [...stored];
};
const makeAlarmWriteEntry = (key) => { const {offset, type} = alarmFields[key];
return [
17,
key,
{
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
to: async (value, meta) => {
const buf = getStoredDp17(meta);
if (type === 'value') {
buf[offset + 2] = (value >> 8) & 0xff;
buf[offset + 3] = value & 0xff;
} else {
buf[offset + 1] = ALARM_ACTION_MODES[value] ?? 0;
}
globalStore.putValue(meta.device, 'dp17raw', buf);
return buf;
},
},
];
};
// --------------------------------------------------------------------------- // Cluster 0xE000 (57344), messages of type 'raw': 3 bytes [high, low, ?] // Working assumption: bytes 0-1 = temperature inside the meter, /100 -> °C // (2373 -> 23.73 °C). Rises under load and slowly falls after the load is switched off. // The third byte (208 or 210) is not decoded and is ignored. // The packet arrives 3-5 times in a row with the same value; repeats are dropped. // The converter is registered for both the string and the numeric cluster ID, // since for unknown clusters it may arrive in either form. // --------------------------------------------------------------------------- const makeDeviceTemperatureConverter = (cluster) => ({ cluster, type: ['raw'], convert: (model, msg, publish, options, meta) => { const buf = msg.data;
if (!buf || buf.length < 2) {
return;
}
const temperature = ((buf[0] << 8) | buf[1]) / 100;
// discard obviously implausible values
if (temperature < -40 || temperature > 150) {
return;
}
// do not publish repeats
if (meta?.state?.device_temperature === temperature) {
return;
}
return {device_temperature: temperature};
},
});
const fzDeviceTemperature = [ makeDeviceTemperatureConverter('57344'), makeDeviceTemperatureConverter(57344), ];
const definition = { fingerprint: [ { modelID: 'TS0601', manufacturerName: '_TZE28C1000000_cf4b5ktf', }, ],
model: 'ZM7LT3',
vendor: 'Moes',
description: 'Smart 3-Phase Energy Power Meter With CT Sensor Clamps',
extend: [
tuya.modernExtend.tuyaBase({
dp: true,
queryOnConfigure: true,
queryIntervalSeconds: 10,
}),
],
// Converter for cluster 57344 (raw). Merged with the converters from extend.
fromZigbee: fzDeviceTemperature,
exposes: [
// Totals
e.energy(),
e.power(),
e.power_reactive(),
e.power_apparent(),
e.power_factor(),
// Temperature inside the meter (cluster 57344)
e.device_temperature(),
// Phase A
e.numeric('voltage_l1', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase A'),
e.numeric('current_l1', ea.STATE)
.withUnit('A')
.withDescription('Current phase A'),
e.numeric('power_l1', ea.STATE)
.withUnit('W')
.withDescription('Active power phase A'),
e.numeric('power_reactive_l1', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase A'),
e.numeric('power_apparent_l1', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase A'),
e.numeric('power_factor_l1', ea.STATE)
.withDescription('Power factor phase A'),
// Phase B
e.numeric('voltage_l2', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase B'),
e.numeric('current_l2', ea.STATE)
.withUnit('A')
.withDescription('Current phase B'),
e.numeric('power_l2', ea.STATE)
.withUnit('W')
.withDescription('Active power phase B'),
e.numeric('power_reactive_l2', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase B'),
e.numeric('power_apparent_l2', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase B'),
e.numeric('power_factor_l2', ea.STATE)
.withDescription('Power factor phase B'),
// Phase C
e.numeric('voltage_l3', ea.STATE)
.withUnit('V')
.withDescription('Voltage phase C'),
e.numeric('current_l3', ea.STATE)
.withUnit('A')
.withDescription('Current phase C'),
e.numeric('power_l3', ea.STATE)
.withUnit('W')
.withDescription('Active power phase C'),
e.numeric('power_reactive_l3', ea.STATE)
.withUnit('VAR')
.withDescription('Reactive power phase C'),
e.numeric('power_apparent_l3', ea.STATE)
.withUnit('VA')
.withDescription('Apparent power phase C'),
e.numeric('power_factor_l3', ea.STATE)
.withDescription('Power factor phase C'),
// Alarm thresholds
e.numeric('over_current_threshold', ea.ALL)
.withUnit('A')
.withValueMin(0)
.withValueMax(63)
.withValueStep(1)
.withDescription('Overcurrent alarm threshold (any phase)')
.withCategory('config'),
e.numeric('over_voltage_threshold', ea.ALL)
.withUnit('V')
.withValueMin(0)
.withValueMax(300)
.withValueStep(1)
.withDescription('Overvoltage alarm threshold')
.withCategory('config'),
e.numeric('under_voltage_threshold', ea.ALL)
.withUnit('V')
.withValueMin(0)
.withValueMax(300)
.withValueStep(1)
.withDescription('Undervoltage alarm threshold')
.withCategory('config'),
// Alarm actions
e.enum(
'over_current_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on overcurrent alarm')
.withCategory('config'),
e.enum(
'over_voltage_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on overvoltage alarm')
.withCategory('config'),
e.enum(
'under_voltage_action',
ea.ALL,
['alarm_only', 'trip', 'no_alarm'],
)
.withDescription('Action taken on undervoltage alarm')
.withCategory('config'),
],
meta: {
tuyaDatapoints: [
// Totals. Verified by comparing with the sum over the phases:
// DP 9 = P_A+P_B+P_C, DP 48 = S_A+S_B+S_C, DP 47 = |Q_A|+|Q_B|+|Q_C|.
// DP 51 duplicates DP 1 and is not used.
[1, 'energy', tuya.valueConverter.divideBy100], // kWh
[9, 'power', tuya.valueConverter.raw], // W
[47, 'power_reactive', tuya.valueConverter.raw], // var
[48, 'power_apparent', tuya.valueConverter.raw], // VA
[53, 'power_factor', tuya.valueConverter.divideBy100], // 0..1
[
6,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l1: d.voltage,
current_l1: d.current,
power_l1: d.power,
power_reactive_l1: d.power_reactive,
power_apparent_l1: d.power_apparent,
power_factor_l1: d.power_factor,
};
},
},
],
[
7,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l2: d.voltage,
current_l2: d.current,
power_l2: d.power,
power_reactive_l2: d.power_reactive,
power_apparent_l2: d.power_apparent,
power_factor_l2: d.power_factor,
};
},
},
],
[
8,
null,
{
from: (v) => {
const d = decodePhase(v);
return {
voltage_l3: d.voltage,
current_l3: d.current,
power_l3: d.power,
power_reactive_l3: d.power_reactive,
power_apparent_l3: d.power_apparent,
power_factor_l3: d.power_factor,
};
},
},
],
// Master DP17 entry:
// used when reading (the first entry with this DP is the one taken).
[
17,
null,
{
from: (v, meta) => {
globalStore.putValue(meta.device, 'dp17raw', v);
return decodeAlarmSettings(v);
},
},
],
// Separate entries for writing individual DP17 fields
makeAlarmWriteEntry('over_current_threshold'),
makeAlarmWriteEntry('over_current_action'),
makeAlarmWriteEntry('over_voltage_threshold'),
makeAlarmWriteEntry('over_voltage_action'),
makeAlarmWriteEntry('under_voltage_threshold'),
makeAlarmWriteEntry('under_voltage_action'),
],
},
};
export default definition;
20. energy
@sdbldn have you managed to see the accumulated energy? It comes back as "null" and I can't seem to be able to fix it :( I'd like to use this instead of polling it from HA.
@dmagyar Yes, I've managed to get the accumulated energy reporting correctly!
The issue was caused by the meter using cluster 0xED00 for segmented transmission of the packed metering data. Zigbee2MQTT wasn't handling this handshake, so the corresponding 0xEF00 / Cmd 0x02 DP reports were never fully received.
After implementing the 0xED00 handshake, fragment retrieval, and data reassembly in the external converter, accumulated energy (DP1), reverse energy (DP2), total power, frequency, and other metering values are now reporting correctly without periodic polling.
I've also verified the three-phase measurements, alarm reporting, and threshold configuration.
I'll attach the updated converter below for testing. The fix works directly through the external converter without modifying zigbee-herdsman.
20. > 20. energy
[@sdbldn](https://github.com/sdbldn) have you managed to see the accumulated energy? It comes back as "null" and I can't seem to be able to fix it :( I'd like to use this instead of polling it from HA.
Nice work @dmagyar @sdbldn !
I believe the converter is now 100% functional and ready to be integrated into Z2M.
Yes, I confirm! With this latest one it successfully reports both produced as well as consumed energy. Great stuff @sdbldn thank you.
@dmagyar @dlangamer You're very welcome! If you come across any other MOES devices that are not yet supported or fully configured in Zigbee2MQTT, please feel free to reach out to me.