Koenkk / zigbee2mqtt

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

[New device support]: TS0601 - 4 gang switch - manufName: _TZE204_wzoxrizd #20555

Closed minhphung1002 closed 3 months ago

minhphung1002 commented 10 months ago

Link

https://shopee.vn/product/111606192/7605566671

Database entry

{"id":36,"type":"Router","ieeeAddr":"0xa4c1384b85155574","nwkAddr":9801,"manufId":4417,"manufName":"_TZE204_wzoxrizd","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":"\u0003\u0000\u0000\u0000i\u0004\u0000\u0000\u0000i\u0004\u0000\u0000\u0000i\u0004\u0000\u0000\u0000i","65506":56,"65508":0,"65534":0,"modelId":"TS0601","manufacturerName":"_TZE204_wzoxrizd","powerSource":1,"zclVersion":3,"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0024c9b3d5","endpointID":1}],"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":-708457359},"lastSeen":1704341187356,"defaultSendRequestWhen":"immediate"} {"id":37,"type":"Router","ieeeAddr":"0xa4c138d2a3f23481","nwkAddr":37296,"manufId":4417,"manufName":"_TZE204_wzoxrizd","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":"\u0003\u0000\u0000\u0000i\u0004\u0000\u0000\u0000i\u0004\u0000\u0000\u0000i\u0004\u0000\u0000\u0000i","65506":56,"65508":0,"65534":0,"modelId":"TS0601","manufacturerName":"_TZE204_wzoxrizd","powerSource":1,"zclVersion":3,"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":""}}},"binds":[{"cluster":6,"type":"endpoint","deviceIeeeAddress":"0x00124b0024c9b3d5","endpointID":1}],"configuredReportings":[],"meta":{}},"242":{"epId":242,"inClusterList":[],"outClusterList":[],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":74,"stackVersion":0,"hwVersion":1,"dateCode":"","zclVersion":3,"interviewCompleted":true,"meta":{"configured":-708457359},"lastSeen":1704341178265,"defaultSendRequestWhen":"immediate"}

Comments

I am using "Zigbee2MQTT Edge" and I followed the instructions to add a new device, but after successfully adding the device, I cannot control it. When I turn on the device under the "Exposes" section, I receive the following message: Device '0xa4c1384b85155574' has no endpoint 'l1'. I'm not very experienced, please help me add this device to my Home Assistant. Thank you very much.

External defintion

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_wzoxrizd',
        },
    ],
    model: 'TS0601_new',
    vendor: 'TuYa',
    description: 'Fill in a description of the device here',
    fromZigbee: [fz.on_off],
    toZigbee: [tz.on_off],
    onEvent: tuya.onEventSetTime, // Add this if you are getting no converter for 'commandMcuSyncTime'
    configure: tuya.configureMagicPacket,
    exposes: [e.switch().withEndpoint('l1').setAccess('state', ea.STATE_SET),e.switch().withEndpoint('l2').setAccess('state', ea.STATE_SET),e.switch().withEndpoint('l3').setAccess('state', ea.STATE_SET),e.switch().withEndpoint('l4').setAccess('state', ea.STATE_SET)],
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
        await reporting.onOff(endpoint);
    },
};

module.exports = definition;
minhphung1002 commented 10 months ago

help me please!!!!

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