找回密码
 立即注册

微信扫码登录

搜索
查看: 2034|回复: 3

[技术探讨] 求一个zigbee2mqtt转换器文件

[复制链接]

1

主题

2

回帖

50

积分

注册会员

积分
50
金钱
47
HASS币
0
发表于 2024-2-7 22:08:12 | 显示全部楼层 |阅读模式
大佬们能发一个涂鸦设备的转换器文件吗? 型号是 [color=rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1))]TY0003 三开的零火开关面板。我自己照着网上教程 弄了个 一点反应没有。
不知道是哪里出了问题。求助!


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 definition = {
    zigbeeModel: ['TY0003'],
    model: 'ZB-SW03',
    vendor: 'eWeLink',
    description: 'Smart light switch - 3 gang',
    extend: preset.switch(),
    exposes: [e.switch().withEndpoint('left'), e.switch().withEndpoint('center'), e.switch().withEndpoint('right')],
    endpoint: (device) => {
        return {'left': 1, 'center': 2, 'right': 3};
    },
    meta: {configureKey: 1, multiEndpoint: true},
    configure: async (device, coordinatorEndpoint, logger) => {
        await reporting.bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']);
        await reporting.bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']);
        await reporting.bind(device.getEndpoint(3), coordinatorEndpoint, ['genOnOff']);
    },
    onEvent: async (type, data, device) => {
        device.skipDefaultResponse = true;
    },
};

module.exports = definition;



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-8-3 14:46 , Processed in 0.345174 second(s), 11 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表