zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

[New device support]: Tuya Wall Switch (EU) with Neutral (optional) 1-3 Gangs

Open und3f1ned opened this issue 10 months ago • 1 comments

Link

https://www.alibaba.com/product-detail/DS-1021ZC-2-Zigbee-2gang-Light_1600676984496.html

Database entry

{"id":50,"type":"EndDevice","ieeeAddr":"0xa4c13825532ac2fb","nwkAddr":16107,"manufId":4417,"manufName":"_TZ3000_09gto2zn","powerSource":"Mains (single phase)","modelId":"TS0013","epList":[1,2,3],"endpoints":{"1":{"profId":260,"epId":1,"devId":256,"inClusterList":[3,4,5,6,0],"outClusterList":[25,10],"clusters":{"genOnOff":{"attributes":{"onOff":1,"onTime":0,"offWaitTime":0,"tuyaBacklightMode":1,"moesStartUpOnOff":2}},"genBasic":{"attributes":{"65503":"k\u000b\u0000\u0000\u0012�\u000b\u0000\u0000\u0012\u0000\u0000\u0000\u0000\u0011","65506":55,"65508":0,"65534":0,"modelId":"TS0013","manufacturerName":"_TZ3000_09gto2zn","powerSource":3,"zclVersion":3,"appVersion":80,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0xe0798dfffeb3dc4d","endpointID":1}],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":256,"inClusterList":[4,5,6],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":1,"onTime":0,"offWaitTime":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0xe0798dfffeb3dc4d","endpointID":1}],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":256,"inClusterList":[4,5,6],"outClusterList":[],"clusters":{"genOnOff":{"attributes":{"onOff":1,"onTime":0,"offWaitTime":0}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0xe0798dfffeb3dc4d","endpointID":1}],"configuredReportings":[],"meta":{}}},"appVersion":80,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":1324213189},"lastSeen":1712556811650}

Comments

Trying to connect like this

`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 {deviceEndpoints} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = { model: 'DS-1021ZC', vendor: 'TuYa', description: 'Fill in a description of the device here', fromZigbee: [tuya.fz.datapoints], toZigbee: [tuya.tz.datapoints], onEvent: tuya.onEventSetTime, configure: tuya.configureMagicPacket, exposes: [e.switch()], extend: [deviceEndpoints({"endpoints":{"1":1,"2":2,"3":3}})], meta: {"multiEndpoint":true}, configure: async (device, coordinatorEndpoint, logger) => { const endpoint = device.getEndpoint(1); await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']); await reporting.onOff(endpoint); }, };

module.exports = definition;`

But in my version of this switch Backlight mode work incorrect. LED on my switch indicates on/off state and vice versa. So with this mode I need only binary toggle. And I'm struggling how to do this correctly. Please, advise

External definition

const {deviceEndpoints, identify, onOff} = require('zigbee-herdsman-converters/lib/modernExtend');

const definition = {
    zigbeeModel: ['TS0013'],
    model: 'TS0013',
    vendor: '_TZ3000_09gto2zn',
    description: 'Automatically generated definition',
    extend: [deviceEndpoints({"endpoints":{"1":1,"2":2,"3":3}}), identify(), onOff({"powerOnBehavior":false,"endpointNames":["1","2","3"]})],
    meta: {"multiEndpoint":true},
};

module.exports = definition;

und3f1ned avatar Apr 08 '24 06:04 und3f1ned