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

 找回密码
 立即注册
查看: 737|回复: 2

[求助] Zigbee2Mqtt 配置文件修改(配合debug)

[复制链接]

2

主题

32

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
100
HASS币
0
发表于 2023-8-10 10:50:08 | 显示全部楼层 |阅读模式
各位大佬好,像各位大佬求助,先说下我的基本情况,
基础设施:
- 群晖虚拟机安装的HA完整版
- 小米多模网关2走ZHA+淘宝的三方多模网关走Z2M
- 家里设备是精装房带的罗格朗zigbee系列
目前状态:
- 小米多模网关2走ZHA,能够识别大部分罗格朗的设备,但是唯独情景开关(双键,休息/起床)识别的有问题,没有实体,设备不上线(物理按键无法触发自动化)
- 因为ZHA的配置文件编写太难,网上资料太少,我又增加了一个多模网关,走Z2M,按照教程能识别出情景开关设备了, 但是仍然无法上线
- 配置文件我是按照官方教程做的,在点击物理按键同时查看debug日志的这一块已经触及了我的知识盲区了。

期望:
- 各位坛友帮忙看看配置文件,协助设备上线


罗格朗情景开关外观

legrand action.png

js代码:(我知道肯定有很多错误,小白一个,供大家讨论,我可以配合实验,哈哈哈哈)

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: ['Sleep_Wake_SC'],
    model: 'myModel',
    vendor: 'myVendor',
    description: 'My super switch!',
    fromZigbee: [fz.legrand_scenes],
    toZigbee: [],
    exposes: [e.action(['sleep', 'wakeup'])],
    // The configure method below is needed to make the device reports on/off state changes
    // when the device is controlled manually through the button on it.
    configure: async (device, coordinatorEndpoint, logger) => {
        const endpoint = device.getEndpoint(1);
        await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
        await reporting.onOff(endpoint);
    },
};

module.exports = definition;
debug 日志
(在我按了休息按键以后出现)
<div style="box-sizing: border-box; color: rgb(108, 117, 125); font-family: Poppins, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><small class="pe-1" style="box-sizing: border-box; font-size: 12px; padding-right: 0.25rem !important;">2023-08-10 10:47:13</small><code style="box-sizing: border-box; font-family: var(--bs-font-monospace); font-size: 12px; overflow-wrap: break-word; color: var(--bs-code-color);">Received Zigbee message from '0x847127fffe4a3cce', type 'raw', cluster '23', data '{"data":[9,34,5,0,0],"type":"Buffer"}' from endpoint 1 with groupID 0</code></div><div style="box-sizing: border-box; color: rgb(108, 117, 125); font-family: Poppins, -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, &quot;Helvetica Neue&quot;, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><small class="pe-1" style="box-sizing: border-box; font-size: 12px; padding-right: 0.25rem !important;">2023-08-10 10:47:13</small><code style="box-sizing: border-box; font-family: var(--bs-font-monospace); font-size: 12px; overflow-wrap: break-word; color: var(--bs-code-color);">No converter available for 'myModel' with cluster '23' and type 'raw' and data '{"data":[9,34,5,0,0],"type":"Buffer"}'</code></div>
(在我按了起床按键以后出现)
2023-08-10 10:47:29Received Zigbee message from '0x847127fffe4a3cce', type 'raw', cluster '23', data '{"data":[9,35,5,1,0],"type":"Buffer"}' from endpoint 1 with groupID 0
2023-08-10 10:47:29No converter available for 'myModel' with cluster '23' and type 'raw' and data '{"data":[9,35,5,1,0],"type":"Buffer"}'


烦请各位大佬深处援手,已经肝了好几天了。
多谢!








回复

使用道具 举报

3

主题

18

帖子

62

积分

注册会员

Rank: 2

积分
62
金钱
44
HASS币
0
发表于 2023-8-10 14:21:54 | 显示全部楼层
借鉴学习
回复

使用道具 举报

2

主题

32

帖子

132

积分

注册会员

Rank: 2

积分
132
金钱
100
HASS币
0
 楼主| 发表于 2023-8-11 13:56:01 | 显示全部楼层
人工置顶
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-19 07:30 , Processed in 0.081196 second(s), 27 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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