Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.76k stars 1.65k forks source link

[New device support]: 3 Phase Electricity Meter Unsupported device model 'TS0601' and manufacturer name '_TZE200_ywbltqzw' #18384

Open evsmorodin opened 1 year ago

evsmorodin commented 1 year ago

Link

https://www.aliexpress.com/item/1005004883393092.html

Database entry

{"id":21,"type":"Router","ieeeAddr":"0xa4c138d5be107401","nwkAddr":27327,"manufId":4417,"manufName":"_TZE200_ywbltqzw","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":"��\u0014+i��\u0014+i��\u0014+i��\u0014+i��\u0014+i��\u0014+i��\u0014+i��\u0014+i��\u0014+i��\u0014+i","65506":48,"65508":0,"modelId":"TS0601","manufacturerName":"_TZE200_ywbltqzw","powerSource":1,"zclVersion":3,"appVersion":68,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[],"configuredReportings":[],"meta":{}},"242":{"profId":41440,"epId":242,"devId":97,"inClusterList":[],"outClusterList":[33],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":68,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{},"lastSeen":1669465017123,"defaultSendRequestWhen":"immediate"}

Comments

The device does not show any parameters and they cannot be controlled изображение изображение изображение изображение изображение

I tried to create a converter but it came to nothing... изображение изображение

For example XOCA DAC2161C (MatSee Plus) изображение изображение

External converter

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: '_TZE200_ywbltqzw',
        },
    ],
    model: 'PJ-DAC7361C',
    vendor: 'TuYa',
    description: 'Zigbee DIN 3-phase energy meter',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tuya.tz.datapoints],
    whiteLabel: [{vendor: 'XOCA', model: 'DAC7361C'}],
    //onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
    exposes: [
        e.voltage(), e.current(), e.power(), e.energy(),
        tuya.exposes.switch(),
        tuya.exposes.energyWithPhase('a'), tuya.exposes.energyWithPhase('b'), tuya.exposes.energyWithPhase('c'),
        tuya.exposes.voltageWithPhase('a'), tuya.exposes.voltageWithPhase('b'), tuya.exposes.voltageWithPhase('c'),
        tuya.exposes.powerWithPhase('a'), tuya.exposes.powerWithPhase('b'), tuya.exposes.powerWithPhase('c'),
        tuya.exposes.currentWithPhase('a'), tuya.exposes.currentWithPhase('b'), tuya.exposes.currentWithPhase('c'),
        tuya.exposes.powerFactorWithPhase('a'), tuya.exposes.powerFactorWithPhase('b'), tuya.exposes.powerFactorWithPhase('c'),
        exposes.enum('fault', ea.STATE, ['clear', 'over_current_threshold', 'over_power_threshold',
            'over_voltage threshold', 'wrong_frequency_threshold']).withDescription('Fault status of the device (clear = nothing)'),
        exposes.enum('threshold_1', ea.STATE, ['not_set', 'over_current_threshold', 'over_voltage_threshold'])
            .withDescription('State of threshold_1'),
        exposes.binary('threshold_1_protection', ea.STATE, 'ON', 'OFF')
            .withDescription('OFF - alarm only, ON - relay will be off when threshold reached'),
        exposes.numeric('threshold_1_value', ea.STATE)
            .withDescription('Can be in Volt or Ampere depending on threshold setting. Setup the value on the device'),
        exposes.enum('threshold_2', ea.STATE, ['not_set', 'over_current_threshold', 'over_voltage_threshold'])
            .withDescription('State of threshold_2'),
        exposes.binary('threshold_2_protection', ea.STATE, 'ON', 'OFF')
            .withDescription('OFF - alarm only, ON - relay will be off when threshold reached'),
        exposes.numeric('threshold_2_value', ea.STATE)
            .withDescription('Setup value on the device'),
        exposes.binary('clear_fault', ea.STATE_SET, 'ON', 'OFF')
            .withDescription('Turn ON to clear last the fault'),
            exposes.text('meter_id', ea.STATE).withDescription('Meter ID (ID of device)'),
    ],
    meta: {
        // All datapoints go in here
        tuyaDatapoints: [
            [1, 'energy', tuya.valueConverter.divideBy100],
            [3, null, null], // Monthly, but sends data only after request
            [4, null, null], // Dayly, but sends data only after request
            [6, null, tuya.valueConverter.phaseVariant2WithPhase('a')],
            [7, null, tuya.valueConverter.phaseVariant2WithPhase('b')],
            [8, null, tuya.valueConverter.phaseVariant2WithPhase('c')],
            [9, 'power', tuya.valueConverter.raw],
            [10, 'fault', tuya.valueConverterBasic.lookup({'clear': 0, 'over_current_threshold': 1,
                'over_power_threshold': 2, 'over_voltage_threshold': 4, 'wrong_frequency_threshold': 8})],
            [11, null, null], // Frozen - strange function, in native app - nothing is clear
            [16, 'state', tuya.valueConverter.onOff],
            [17, null, tuya.valueConverter.threshold], // It's settable, but can't write converter
            [18, 'meter_id', tuya.valueConverter.raw],
            [20, 'clear_fault', tuya.valueConverter.onOff], // Clear fault
            [21, null, null], // Forward Energy T1 - don't know what this
            [22, null, null], // Forward Energy T2 - don't know what this
            [23, null, null], // Forward Energy T3 - don't know what this
            [24, null, null], // Forward Energy T4 - don't know what this
        ],
    },
};

module.exports = definition;

Supported color modes

No response

Color temperature range

No response

markus-barta commented 1 year ago

Almost the same hardware here: Zigbee Model: TS0601 Zigbee Manufacturer: _TZE204_x8fp01wi

github-actions[bot] commented 1 year ago

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

evsmorodin commented 1 year ago

Issue is still relevant

evsmorodin commented 1 year ago

I made a mistake and the converter didn't load after correction, there are results изображение изображение изображение изображение

github-actions[bot] commented 11 months ago

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

evsmorodin commented 11 months ago

Issue is still relevant

evsmorodin commented 11 months ago

@Koenkk please open this issue

Koenkk commented 11 months ago

@evsmorodin to properly support this device, you have to figure out all the datapoints: https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html

jujumo commented 10 months ago

Same hardware here and same problem.

github-actions[bot] commented 4 months ago

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days

evsmorodin commented 4 months ago

@evsmorodin to properly support this device, you have to figure out all the datapoints: https://www.zigbee2mqtt.io/advanced/support-new-devices/02_support_new_tuya_devices.html

Hello, @Koenkk! For a long time there was no time for smart devices. Today I set aside time for this. So, the datapoints for the device are:

{
    "result": [
        {
            "dpId": 1,
            "dpName": "Forward Energy Total"
        },
        {
            "dpId": 3,
            "dpName": "Month energy"
        },
        {
            "dpId": 4,
            "dpName": "Daily energy"
        },
        {
            "dpId": 6,
            "dpName": "Phase A"
        },
        {
            "dpId": 7,
            "dpName": "Phase B"
        },
        {
            "dpId": 8,
            "dpName": "Phase C"
        },
        {
            "dpId": 9,
            "dpName": "Total Power "
        },
        {
            "dpId": 10,
            "dpName": "Fault"
        },
        {
            "dpId": 11,
            "dpName": "Frozen set"
        },
        {
            "dpId": 16,
            "dpName": "Switch"
        },
        {
            "dpId": 17,
            "dpName": "Alarm set"
        },
        {
            "dpId": 18,
            "dpName": "Meter ID"
        },
        {
            "dpId": 20,
            "dpName": "Clear event"
        },
        {
            "dpId": 21,
            "dpName": "Forward Energy T1"
        },
        {
            "dpId": 22,
            "dpName": "Forward Energy T2"
        },
        {
            "dpId": 23,
            "dpName": "Forward Energy T3"
        },
        {
            "dpId": 24,
            "dpName": "Forward Energy T4"
        }
    ],
    "t": 1715425098886,
    "success": true,
    "status": "ok"
}