Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New device support]: Support device EA7361C-CT-BI similar to DAC7361C #26642

Open
coo-private opened this issue Mar 7, 2025 · 1 comment
Open
Labels
new device support New device support request

Comments

@coo-private
Copy link

coo-private commented Mar 7, 2025

Link

https://www.aliexpress.com/item/1005008261491099.html?spm=a2g0o.order_list.order_list_main.5.57f41802U1jn5g

Database entry

{"id":5,"type":"Router","ieeeAddr":"0xa4c1385ab117299e","nwkAddr":20360,"manufId":4417,"manufName":"_TZE204_5scyfj7e","powerSource":"Mains (single phase)","modelId":"TS0601","epList":[1,242],"endpoints":{"1":{"profId":260,"epId":1,"devId":81,"inClusterList":[4,5,61184,0],"outClusterList":[25,10],"clusters":{"genBasic":{"attributes":{"65503":"_a^/iba^/ica^/ica^/ida^/ida^/iea^/iea^/ifa^/ifa^/i","65506":56,"65508":0,"65534":0,"stackVersion":0,"dateCode":"","appVersion":74,"modelId":"TS0601","manufacturerName":"_TZE204_5scyfj7e","powerSource":1,"zclVersion":3,"hwVersion":1}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":1946894323},"lastSeen":1741462260719}

Zigbee2MQTT version

2.1.3-1

Comments

Can you please add:

Model: TS0601
Vendor: _TZE204_5scyfj7e

User Guide for DAC7321C(WIFI) Series V1.0_20230829090847.pdf

DAC7321C-CT Modbus Protocol v1.0.docx

Tuya Smart Three-Phase Bidirectional Electricity Meter with WiFi & ZigBee for KWh Monitoring, featuring RS485 Interface AC 380V

link: https://www.aliexpress.com/item/1005008261491099.html?spm=a2g0o.order_list.order_list_main.5.1c4979d23HFm8t&gatewayAdapt=glo2nld

Image

Very similar to:

#18750
and
https://www.zigbee2mqtt.io/devices/EA4161C-BI.html
https://www.zigbee2mqtt.io/devices/TS0601_din_3.html
sprut/Hub#3849

but this meter has current transformers.

I have purchased this unit but have not been able to get data from it.

Image

Image

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 extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's 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: '_TZE204_x8fp01wi',
        },
    ],
    model: 'TS0601_din_3-Phase',
    vendor: 'TuYa',
    description: 'Earu Zigbee 3-Phase bidirictional Meter',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
    exposes: [
            // Here you should put all functionality that your device exposes
            tuya.exposes.voltageWithPhase('L1'), 
            tuya.exposes.voltageWithPhase('L2'), 
            tuya.exposes.voltageWithPhase('L3'),
            tuya.exposes.currentWithPhase('L1'), 
            tuya.exposes.currentWithPhase('L2'), 
            tuya.exposes.currentWithPhase('L3'),
            tuya.exposes.powerWithPhase('L1'), 
            tuya.exposes.powerWithPhase('L2'), 
            tuya.exposes.powerWithPhase('L3'),
            //tuya.exposes.powerFactorWithPhase('L1'),
            //tuya.exposes.powerFactorWithPhase('L2'),
            //tuya.exposes.powerFactorWithPhase('L3'),
            //tuya.exposes.energyFlowWithPhase('L1'), 
            //tuya.exposes.energyFlowWithPhase('L2'),
            //tuya.exposes.energyFlowWithPhase('L3'),
            //tuya.exposes.energyWithPhase('L1'), 
            //tuya.exposes.energyWithPhase('L2'),
            //tuya.exposes.energyWithPhase('L3'),
            //tuya.exposes.energyProducedWithPhase('L1'), 
            //tuya.exposes.energyProducedWithPhase('L2'),
            //tuya.exposes.energyProducedWithPhase('L3'),
            
            // Change the description according to the specifications of the device
            e.energy().withDescription('Total forward active energy'),
            e.produced_energy().withDescription('Total reverse active energy'),
            //e.enum('energy_flow', ea.STATE, ['consuming', 'producing']).withDescription('Direction of energy'),
            //e.numeric('update_frequency', ea.STATE).withUnit('s').withDescription('Update frequency'),
            //e.ac_frequency(),
    ],
    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
                
                [1, 'energy', tuya.valueConverter.divideBy100],
                [2, 'produced_energy', tuya.valueConverter.divideBy100],
                [6, null, tuya.valueConverter.phaseVariant2WithPhase('L1')],
                [7, null, tuya.valueConverter.phaseVariant2WithPhase('L2')],
                [8, null, tuya.valueConverter.phaseVariant2WithPhase('L3')],
        ],
    },
};

module.exports = definition;

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

device is not supported

Image

@coo-private coo-private added the new device support New device support request label Mar 7, 2025
@coo-private coo-private changed the title Support device similar to DAC7361C [New device support] Support device similar to DAC7361C Mar 7, 2025
@coo-private coo-private changed the title [New device support] Support device similar to DAC7361C [New device support]: Support device similar to DAC7361C Mar 7, 2025
@coo-private coo-private changed the title [New device support]: Support device similar to DAC7361C [New device support]: Support device EA7361C-CT-BI similar to DAC7361C Mar 7, 2025
@coo-private
Copy link
Author

coo-private commented Mar 8, 2025

I edited the converter a bit and it worked.
But it still doesn't transfer a lot of data.

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 e = exposes.presets;
const ea = exposes.access;
const tuya = require('zigbee-herdsman-converters/lib/tuya');

const definition = {
    // Since a lot of TuYa devices use the same modelID, but use different datapoints
    // it's 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: '_TZE204_5scyfj7e',
        },
    ],
    model: 'TS0601_din_3-Phase',
    vendor: 'Tuya',
    description: 'EARU Zigbee 3-Phase bidirictional Meter',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
    exposes: [
            // Here you should put all functionality that your device exposes
            tuya.exposes.voltageWithPhase('L1'), 
            tuya.exposes.voltageWithPhase('L2'), 
            tuya.exposes.voltageWithPhase('L3'),
            tuya.exposes.currentWithPhase('L1'), 
            tuya.exposes.currentWithPhase('L2'), 
            tuya.exposes.currentWithPhase('L3'),
            tuya.exposes.powerWithPhase('L1'), 
            tuya.exposes.powerWithPhase('L2'), 
            tuya.exposes.powerWithPhase('L3'),
            tuya.exposes.powerFactorWithPhase('L1'),
            tuya.exposes.powerFactorWithPhase('L2'),
            tuya.exposes.powerFactorWithPhase('L3'),
            //tuya.exposes.energyFlowWithPhase('L1'), 
            //tuya.exposes.energyFlowWithPhase('L2'),
            //tuya.exposes.energyFlowWithPhase('L3'),
            //tuya.exposes.energyWithPhase('L1'), 
            //tuya.exposes.energyWithPhase('L2'),
            //tuya.exposes.energyWithPhase('L3'),
            //tuya.exposes.energyProducedWithPhase('L1'), 
            //tuya.exposes.energyProducedWithPhase('L2'),
            //tuya.exposes.energyProducedWithPhase('L3'),
            
            // Change the description according to the specifications of the device
            e.energy().withDescription('Total forward active energy'),
            e.produced_energy().withDescription('Total reverse active energy'),
            e.enum('energy_flow', ea.STATE, ['consuming', 'producing']).withDescription('Direction of energy'),
            e.numeric('update_frequency', ea.STATE).withUnit('s').withDescription('Update frequency'),
            e.ac_frequency(),
    ],
    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
                
                [1, 'energy', tuya.valueConverter.divideBy100],
                [2, 'produced_energy', tuya.valueConverter.divideBy100],
                [6, null, tuya.valueConverter.phaseVariant2WithPhase('L1')],
                [7, null, tuya.valueConverter.phaseVariant2WithPhase('L2')],
                [8, null, tuya.valueConverter.phaseVariant2WithPhase('L3')],
        ],
    },
};

module.exports = definition;

And have some errors in startup z2m log

[2025-03-09 00:33:20] info: z2m: Connecting to MQTT server at mqtt://core-mosquitto:1883
[2025-03-09 00:33:20] info: z2m: Connected to MQTT server
[2025-03-09 00:33:20] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt_01/bridge/state', payload '{"state":"online"}'
[2025-03-09 00:33:20] info: z2m: Loaded external converter 'DAC2161С.js'.
[2025-03-09 00:33:20] error: z2m: Failed to call 'ExternalConverters' 'start' (node:internal/modules/cjs/loader:645
throw e;
^
Error: Cannot find module '/app/node_modules/zigbee-herdsman-converters/dist/lib/extend.js'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1281:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1269:15)
at resolveExports (node:internal/modules/cjs/loader:638:14)
at Function._findPath (node:internal/modules/cjs/loader:743:31)
at Function._resolveFilename (node:internal/modules/cjs/loader:1230:27)
at Function._load (node:internal/modules/cjs/loader:1070:27)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Module.require (node:internal/modules/cjs/loader:1335:12)
at require (node:internal/modules/helpers:136:16))

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new device support New device support request
Projects
None yet
Development

No branches or pull requests

1 participant