Skip to content

[External Converter]: TS0601 from _TZE284_se4vgzzy #31619

@Vissir

Description

@Vissir

Link

https://www.zemismart.com/products/zw-gd01

Database entry

{"id":78,"type":"Router","ieeeAddr":"0xa4c138f36c85bf77","nwkAddr":27224,"manufId":4417,"manufName":"_TZE284_se4vgzzy","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":">�e1iB�e1fC�e1\u0012","65506":56,"65508":0,"65534":0,"stackVersion":0,"dateCode":"","appVersion":78,"manufacturerName":"_TZE284_se4vgzzy","zclVersion":3,"modelId":"TS0601","powerSource":1}}},"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":{"configured":"0.0.0"},"lastSeen":1775436366488}

Zigbee2MQTT version

2.9.2 (unknown)

External converter

const tuya = require('zigbee-herdsman-converters/lib/tuya');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const e = exposes.presets;
const ea = exposes.access;

const tzTrigger = {
    key: ['state'],
    convertSet: async (entity, key, value, meta) => {
        const endpoint = entity.getEndpoint ? entity.getEndpoint(1) : meta.device.getEndpoint(1);

        await endpoint.command(
            'manuSpecificTuya',
            'dataRequest',
            { seq: 1, dpValues: [{ dp: 1, datatype: 1, data: Buffer.from([1]) }] },
            { disableDefaultResponse: true }
        );

        await new Promise(r => setTimeout(r, 600));

        await endpoint.command(
            'manuSpecificTuya',
            'dataRequest',
            { seq: 2, dpValues: [{ dp: 1, datatype: 1, data: Buffer.from([0]) }] },
            { disableDefaultResponse: true }
        );

        return { state: { state: value.toUpperCase() } };
    },
};

const definition = {
    fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE284_se4vgzzy' }],
    model: 'ZW-GD01',
    vendor: 'Tuya',
    description: 'Zemismart Zigbee Garage Door Opener',
    fromZigbee: [tuya.fz.datapoints],
    toZigbee: [tzTrigger],
    onEvent: tuya.onEventSetTime,
    configure: tuya.configureMagicPacket,
    exposes: [
        e.switch().setAccess('state', ea.STATE_SET),
        e.binary('contact', ea.STATE, 'abierto', 'cerrado')
            .withDescription('Estado del portón'),
    ],
    meta: {
        tuyaDatapoints: [
            [3, 'contact', {from: (v) => (v === true || v === 1) ? 'abierto' : 'cerrado', to: () => 0}],
        ],
    },
};

module.exports = definition;

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

Work: trigger to Open close the door and magentit contact state (Open/close) do not knlw if there is any other entitiy.

Notes

software_build_id: undefined
date_code: ``
endpoints:

{"1":{"clusters":{"input":["genGroups","genScenes","manuSpecificTuya","genBasic","60672"],"output":["genOta","genTime"]}},"242":{"clusters":{"input":[],"output":["greenPower"]}}}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions