Koenkk / zigbee2mqtt

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

[New device support]: UIOT Light Switch support problem #21722

Closed ArtHuge closed 4 weeks ago

ArtHuge commented 8 months ago

Link

https://www.unisiot.com/en/web/products.html

Database entry

{"id":2,"type":"Router","ieeeAddr":"0x00158d0005db24ef","nwkAddr":14523,"manufId":4657,"manufName":"UIOT","powerSource":"Mains (single phase)","modelId":"UIOT-LNSwitch2[02,02]","epList":[1,2,3,4,5],"endpoints":{"1":{"profId":260,"epId":1,"devId":2,"inClusterList":[0,4,6,25,65535],"outClusterList":[0,4,6,25],"clusters":{"genBasic":{"attributes":{"32769":{"type":"Buffer","data":[0,0,0,0]},"modelId":"UIOT-LNSwitch2[02,02]","manufacturerName":"UIOT","powerSource":1,"zclVersion":1,"appVersion":1,"stackVersion":2,"hwVersion":1,"dateCode":"20191114","swBuildId":"V4.25-2162-V4.51"}}},"binds":[],"configuredReportings":[],"meta":{}},"2":{"profId":260,"epId":2,"devId":2,"inClusterList":[0,4,6],"outClusterList":[0,4,6],"clusters":{"genOnOff":{"attributes":{"onOff":0}}},"binds":[],"configuredReportings":[],"meta":{}},"3":{"profId":260,"epId":3,"devId":2,"inClusterList":[0,4,6],"outClusterList":[0,4,6],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"4":{"profId":260,"epId":4,"devId":2,"inClusterList":[0,4,6],"outClusterList":[0,4,6],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}},"5":{"profId":260,"epId":5,"devId":0,"inClusterList":[0,4,6],"outClusterList":[0,4,6],"clusters":{},"binds":[],"configuredReportings":[],"meta":{}}},"appVersion":1,"stackVersion":2,"hwVersion":1,"dateCode":"20191114","swBuildId":"V4.25-2162-V4.51","zclVersion":1,"interviewCompleted":true,"meta":{},"lastSeen":1709912631297}

Comments

aha,after hard work I successfully added the device!!!!!But it's not perfect, because the log reported some error information, I can't solve it, please help me improve this device.

The device will go offline when an error message appears. Wait for a while and then the device can operate normally after it comes online.

image image

Error Logs :

Info 2024-03-09 02:39:07Configuring '0x00158d0005db24ef'
Debug 2024-03-09 02:39:07Received Zigbee message from '0x00158d0005db24ef', type 'attributeReport', cluster 'genBasic', data '{"32769":{"data":[0,0,0,0],"type":"Buffer"}}' from endpoint 1 with groupID 0
Debug 2024-03-09 02:39:08Received Zigbee message from '0x00158d0005db24ef', type 'attributeReport', cluster 'genBasic', data '{"32769":{"data":[0,0,0,0],"type":"Buffer"}}' from endpoint 1 with groupID 0
Debug 2024-03-09 02:39:09Received Zigbee message from '0x00158d0005db24ef', type 'attributeReport', cluster 'genBasic', data '{"32769":{"data":[0,0,0,0],"type":"Buffer"}}' from endpoint 1 with groupID 0
Error 2024-03-09 02:39:17Failed to configure '0x00158d0005db24ef', attempt 1 (Error: Bind 0x00158d0005db24ef/1 genOnOff from '0x00124b0030c3087e/1' failed (AREQ - ZDO - bindRsp after 10000ms) at Object.start (/app/node_modules/zigbee-herdsman/src/utils/waitress.ts:63:23) at /app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:692:28 at processTicksAndRejections (node:internal/process/task_queues:95:5) at Queue.execute (/app/node_modules/zigbee-herdsman/src/utils/queue.ts:35:20) at Endpoint.bind (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:551:13) at Object.bind (/app/node_modules/zigbee-herdsman-converters/src/lib/reporting.ts:43:9) at configure (/app/data/extension/externally-loaded.js:25:9) at Object.configure (/app/node_modules/zigbee-herdsman-converters/src/index.ts:141:25) at Configure.configure (/app/lib/extension/configure.ts:122:13) at Immediate.<anonymous> (/app/lib/extension/configure.ts:74:17))

js file code :

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 {deviceEndpoints, light, onOff} = require('zigbee-herdsman-converters/lib/modernExtend');
const e = exposes.presets;
const ea = exposes.access;

const definition = {
    zigbeeModel: ['UIOT-LNSwitch2[02,02]'],
    model: 'UIOTLNSwitch2',
    vendor: 'UIOT',
    description: 'UIOT 2 gang switch',
    fromZigbee: [fz.on_off],
    toZigbee: [tz.on_off],
    exposes: [e.switch()],
    // 1=AllOn,2=LeftOn,3=RightOn
    extend: [
    deviceEndpoints({"endpoints":{"1":1,"2":2,"3":3}}), 
    onOff({"powerOnBehavior":false,"endpointNames":["1","2","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;

External definition

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

const definition = {
    zigbeeModel: ['UIOT-LNSwitch2[02,02]'],
    model: 'UIOT-LNSwitch2[02,02]',
    vendor: 'UIOT',
    description: 'Automatically generated definition',
    extend: [deviceEndpoints({"endpoints":{"1":1,"2":2,"3":3,"4":4,"5":5}}), deviceEndpoints({"endpoints":{"1":1,"2":2,"3":3,"4":4,"5":5}}), onOff({"powerOnBehavior":false,"endpointNames":["1","2","3","4","5"]})],
    meta: {"multiEndpoint":true},
};

module.exports = definition;
github-actions[bot] commented 1 month 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