Koenkk / Koenkk/zigbee2mqtt

[New device support]: MOES ZM6LT1 1-Phase Energy Power Meter With Current Transformer Sensor Clamp

Open
#32,416 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new device support
Dominant language
TypeScript
Stars
15.7k
Forks
2k
Avg merge
18h 55m
Merged PRs (30d)
35

Description

Link

https://es.aliexpress.com/item/1005012140452412.html?spm=a2g0o.order_list.order_list_main.5.1af01802pwyxMh&gatewayAdapt=usa2esp4itemAdapt#nav-description

Database entry

{"id":13,"type":"Router","ieeeAddr":"0xa4c1387b659727cd","nwkAddr":17168,"manufId":4417,"manufName":"_TZE284_2fnssffc","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":"\u00001+lf\u0002+\u0012","65506":56,"65508":0,"stackVersion":0,"dateCode":"","appversion":78}}},"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":{},"lastSeen":1782491333196}

Zigbee2MQTT version

2.12.0

External definition
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const modernExtend = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    fingerprint: [
        {
            modelID: 'TS0601',
            manufacturerName: '_TZE284_2fnssffc',
        },
    ],
    model: 'ZM6LT1',
    vendor: 'MOES',
    description: 'Smart 1-Phase Energy Power Meter With CT Sensor Clamp',
    extend: [
        tuya.modernExtend.tuyaBase({
            dp: true,
            queryOnConfigure: true,
            queryIntervalSeconds: 60,
        }),
    ],
    exposes: [
        e.energy(),
        e.voltage(),
        e.current(),
        e.power(),
        e.ac_frequency(),
        e.power_factor().withUnit("%"),
        e.numeric("temperature", ea.STATE).withUnit("°C").withDescription("Current temperature"),
        e
            .enum("event", ea.STATE, [
                "normal",
                "over_current_trip",
                "over_power_trip",
                "high_temp_trip",
                "over_voltage_trip",
                "under_voltage_trip",
                "over_current_alarm",
                "over_power_alarm",
                "high_temp_alarm",
                "over_voltage_alarm",
                "under_voltage_alarm",
                "remote_on",
                "remote_off",
                "manual_on",
                "manual_off",
                "leakage_trip",
                "leakage_alarm",
                "restore_default",
                "automatic_closing",
                "electricity_shortage",
                "electricity_shortage_alarm",
                "timing_switch_On",
                "timing_switch_off",
            ])
            .withDescription("Last event of the device"),
        e.enum("over_current_setting", ea.STATE_SET, ["Ignore", "Alarm"]).withDescription("Over current setting"),
        e
            .numeric("over_current_threshold", ea.STATE_SET)
            .withUnit("A")
            .withDescription("Setup the value on the device")
            .withValueMin(1)
            .withValueMax(50),
        e.enum("over_voltage_setting", ea.STATE_SET, ["Ignore", "Alarm"]).withDescription("Over voltage setting"),
        e
            .numeric("over_voltage_threshold", ea.STATE_SET)
            .withUnit("V")
            .withDescription("Setup value on the device")
            .withValueMin(240)
            .withValueMax(295),
        e.enum("under_voltage_setting", ea.STATE_SET, ["Ignore", "Alarm"]).withDescription("Under voltage setting"),
        e
            .numeric("under_voltage_threshold", ea.STATE_SET)
            .withUnit("V")
            .withDescription("Setup value on the device")
            .withValueMin(90)
            .withValueMax(220),
        e.enum("temperature_setting", ea.STATE_SET, ["Ignore", "Alarm"]).withDescription("Temperature setting"),
        e
            .numeric("temperature_threshold", ea.STATE_SET)
            .withUnit("°C")
            .withDescription("Setup value on the device")
            .withValueMin(-25)
            .withValueMax(80),
        e.enum("over_power_setting", ea.STATE_SET, ["Ignore", "Alarm"]).withDescription("Over power setting"),
        e
            .numeric("over_power_threshold", ea.STATE_SET)
            .withUnit("W")
            .withDescription("Setup value on the device")
            .withValueMin(1000)
            .withValueMax(26000),
    ],
    meta: {
        multiEndpointSkip: ["test1", "forward_electricity"],
        tuyaDatapoints: [
            [1, "energy", tuya.valueConverter.divideBy100], // Total forward energy
            [6, null, tuya.valueConverter.phaseVariant2], // Phase A
            [13, "test1", tuya.valueConverter.raw], // Remaining electricity
            [32, "ac_frequency", tuya.valueConverter.divideBy100], // Grid supply frequency
            [50, "power_factor", tuya.valueConverter.raw], // Overall power factor
            [
                102,
                "over_voltage_setting",
                tuya.valueConverterBasic.lookup({
                    Ignore: tuya.enum(0),
                    Alarm: tuya.enum(1),
                }),
            ],
            [
                103,
                "under_voltage_setting",
                tuya.valueConverterBasic.lookup({
                    Ignore: tuya.enum(0),
                    Alarm: tuya.enum(1),
                }),
            ],
            [
                104,
                "over_current_setting",
                tuya.valueConverterBasic.lookup({
                    Ignore: tuya.enum(0),
                    Alarm: tuya.enum(1),
                }),
            ],
            [
                105,
                "over_power_setting",
                tuya.valueConverterBasic.lookup({
                    Ignore: tuya.enum(0),
                    Alarm: tuya.enum(1),
                }),
            ],
            [
                107,
                "temperature_setting",
                tuya.valueConverterBasic.lookup({
                    Ignore: tuya.enum(0),
                    Alarm: tuya.enum(1),
                }),
            ],
            [
                110,
                "event",
                tuya.valueConverterBasic.lookup({
                    normal: 0,
                    over_current_trip: 1,
                    over_power_trip: 2,
                    high_temp_trip: 3,
                    over_voltage_trip: 4,
                    under_voltage_trip: 5,
                    over_current_alarm: 6,
                    over_power_alarm: 7,
                    high_temp_alarm: 8,
                    over_voltage_alarm: 9,
                    under_voltage_alarm: 10,
                    remote_on: 11,
                    remote_off: 12,
                    manual_on: 13,
                    manual_off: 14,
                    leakage_trip: 15,
                    leakage_alarm: 16,
                    restore_default: 17,
                    automatic_closing: 18,
                    electricity_shortage: 19,
                    electricity_shortage_alarm: 20,
                    timing_switch_on: 21,
                    timing_switch_off: 22,
                }),
            ],
            [114, "over_current_threshold", tuya.valueConverter.raw],
            [115, "over_voltage_threshold", tuya.valueConverter.raw],
            [116, "under_voltage_threshold", tuya.valueConverter.raw],
            [118, "temperature_threshold", tuya.valueConverter.divideBy10],
            [119, "over_power_threshold", tuya.valueConverter.raw],
            [125, "forward_electricity", tuya.valueConverter.raw],
            [131, "temperature", tuya.valueConverter.divideBy10],
        ],
    },
    whiteLabel: [tuya.whitelabel("MOES", "ZM6LT1", "Electricity Energy Monitor", ["_TZE284_2fnssffc"])],
};

module.exports = definition;
What does/doesn't work with the external definition?

Only thing working is the Energy field, it is increasing everytime the device that is sensing is turned on, The voltage is showing 52.7V fixed and it shoud it be 227V, The Current value shows 58.88A with little variation, every other field is null.

I copied the definition of the Tongou TOSA1-01WXJAT2A
(https://www.zigbee2mqtt.io/devices/TOSA1-01WXJAT2A.html#tongou-tosa1-01wxjat2a)

Thanks

Notes
Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the supplied database entry and external JavaScript definition with the Tongou TOSA1-01WXJAT2A definition it was based on. Verify the mappings for voltage, current, power, frequency, alarms, and thresholds against the reported device behavior. Done means the MOES ZM6LT1 exposes populated readings with correct values instead of the fixed or null fields described.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.