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]: Tuya TS0601 _TZE204_goecjd1t Power Consumption Sensor #25688

Closed
oli-z opened this issue Jan 8, 2025 · 1 comment
Closed
Labels
new device support New device support request

Comments

@oli-z
Copy link

oli-z commented Jan 8, 2025

Link

https://de.aliexpress.com/item/1005008269272176.html

Database entry

{"id":60,"type":"Router","ieeeAddr":"0xa4c13805ae02e3b8","nwkAddr":23167,"manufId":4417,"manufName":"_TZE204_goecjd1t","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":"nu\u0011/\u0013nu\u0011/eou\u0011/\u0012","65506":56,"65508":0,"65534":0,"stackVersion":0,"dateCode":"","appVersion":74,"manufacturerName":"_TZE204_goecjd1t","zclVersion":3,"modelId":"TS0601","powerSource":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":217189513},"lastSeen":1736360071653}

Zigbee2MQTT version

2.0.0

Comments

Hi. I recently bought an Power Clamp Meter just to discover it isn't yet supported in Zigbee2MQTT. Not wanting to give up yet, I tried adding support via a custom converter.

As I understand, I need the data points for the device. Is there any way to dump all datapoints that the device sends?

I used #16926 as an template.

I have debug logging enabled, but no unmapped datapoints are shown in the log. Is the device not sending any data? I also asked ChatGPT, it told me to use a function called tuya.fromZigbee.data_point_dump but if I add that the external converter does not work at all, so maybe that's just an AI hallucination.

Here is the external_converter I already have that does not work:

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 = {

    fingerprint: tuya.fingerprint('TS0601', ['_TZE204_goecjd1t']),
    model: 'TS0601',
    vendor: 'TuYa',
    description: 'Zigbee DIN energy meter',
    fromZigbee: [
        (msg) => {
            console.log(msg);
            return tuya.fz.datapoints(msg);  // Anpassen je nach Bedarf
        },
        fz.electrical_measurement,
        fz.metering,
    ],
    toZigbee: [tuya.tz.datapoints],
    configure: tuya.configureMagicPacket,
    exposes: [e.energy(), e.power(), e.voltage(), e.current()],
    meta: {
        tuyaDatapoints: [
            [1, 'energy', tuya.valueConverter.divideBy100],
        ],
    },

};

module.exports = definition;

Thank you in advance.

External definition

const definition = {
    zigbeeModel: ['TS0601'],
    model: 'TS0601',
    vendor: '_TZE204_goecjd1t',
    description: 'Automatically generated definition',
    extend: [],
    meta: {},
};

module.exports = definition;

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

The device is detected using the external_converter, so at least I got that working 😅
The device doesn't report any data, everything just shows null

@oli-z oli-z added the new device support New device support request label Jan 8, 2025
@oli-z
Copy link
Author

oli-z commented Jan 18, 2025

After a bit of trial and error I could create a converter for this device, atleast for the basic features: Koenkk/zigbee-herdsman-converters#8640

@oli-z oli-z closed this as completed Feb 2, 2025
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