『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 438|回复: 3

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

[复制链接]

1

主题

2

帖子

44

积分

新手上路

Rank: 1

积分
44
金钱
42
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;



回复

使用道具 举报

6

主题

52

帖子

361

积分

中级会员

Rank: 3Rank: 3

积分
361
金钱
309
HASS币
0
发表于 2024-2-8 08:09:46 | 显示全部楼层
TY0003? 只有TS0003的
回复

使用道具 举报

8

主题

172

帖子

1156

积分

金牌会员

Rank: 6Rank: 6

积分
1156
金钱
984
HASS币
0
发表于 2024-2-8 19:14:52 | 显示全部楼层
cyl1995 发表于 2024-2-8 08:09
TY0003? 只有TS0003的

TS0003 是单火的吧,可以试试能使用不
回复

使用道具 举报

9

主题

168

帖子

1570

积分

金牌会员

Rank: 6Rank: 6

积分
1570
金钱
1402
HASS币
10
发表于 2024-2-18 15:03:34 | 显示全部楼层
这么写肯定不能用。
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-13 21:58 , Processed in 0.471615 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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