NAS-WR01B 모델을 TS011F_plug_1로 변경



2022.02.22
패어링된 장치 삭제후 z2m애드온 재시작후 페어링하면 TS011F_plug_1로 잡힘

-----------------------------------------------------------------------
z2m에서 1.0.10펌업후 모델명이 여전히 TS011F_plug_3으로 잡히는데 TS011F_plug_1로 변경해 줘야 실시간 전력이 잡힌다. 3이 풀링방식으로 전력 모니터링하고 1이 실시간 모니터링이라...

3을 1로 변경하는 방법은 z2m 애드온을 중지하고 zigbeemqtt/database.db의 해당 manufName을 1을 사용하는 모델로 변경하는게 가장 간단한 방법(예를 들어 _TZ3000_w0qqde0g을 _TZ3000_ps3dmato로 변경)

또는 external converter로 등록하려면 아래내용으로 plug.js파일을 만들고 z2m구성에 추가해준다.


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 definition = {
        fingerprint: [{modelID: 'TS011F', manufacturerName: '_TZ3000_w0qqde0g'},],
        model: 'TS011F_plug_1',
        description: 'Smart plug (with power monitoring)',
        vendor: 'TuYa',
        whiteLabel: [{vendor: 'LELLKI', model: 'TS011F_plug'}, {vendor: 'NEO', model: 'NAS-WR01B'},
            {vendor: 'BlitzWolf', model: 'BW-SHP15'}],
        fromZigbee: [fz.on_off, fz.electrical_measurement, fz.metering, fz.ignore_basic_report, fz.tuya_switch_power_outage_memory],
        toZigbee: [tz.on_off, tz.tuya_switch_power_outage_memory],
        configure: async (device, coordinatorEndpoint, logger) => {
            const endpoint = device.getEndpoint(1);
            await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'haElectricalMeasurement', 'seMetering']);
            await reporting.rmsVoltage(endpoint, {change: 5});
            await reporting.rmsCurrent(endpoint, {change: 50});
            await reporting.activePower(endpoint, {change: 10});
            await reporting.currentSummDelivered(endpoint);
            endpoint.saveClusterAttributeKeyValue('haElectricalMeasurement', {acCurrentDivisor: 1000, acCurrentMultiplier: 1});
            endpoint.saveClusterAttributeKeyValue('seMetering', {divisor: 100, multiplier: 1});
            device.save();
        },
        exposes: [e.switch(), e.power(), e.current(), e.voltage().withAccess(ea.STATE),
            e.energy(), exposes.enum('power_outage_memory', ea.STATE_SET, ['on', 'off', 'restore'])
                .withDescription('Recover state after power outage')],
};

module.exports = definition;