|
楼主 |
发表于 2020-4-5 11:34:25
|
显示全部楼层
重启后,按按键后,出来的日志,不太一样了.
zigbee2mqtt:debug 2020-04-05 10:37:47: Received Zigbee message from '0x00158d0001ff3ab3', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"zonestatus":18,"extendedstatus":0}' from endpoint 1 with groupID 0
,zigbee2mqtt:debug 2020-04-05 10:37:47: No converter available for 'SEB01ZB' with cluster 'ssIasZone' and type 'commandStatusChangeNotification' and data '{"zonestatus":18,"extendedstatus":0}'
主要就是这一块内容了
cluster 'ssIasZone' and type 'commandStatusChangeNotification' and data '{"zonestatus":18,"extendedstatus":0}
可以参考其它的 commandStatusChangeNotification 来修改(当然也可以直接到github里面去看,最终的代码是这样的)
sslj_sos_alarm_2: {
cluster: 'ssIasZone',
type: 'commandStatusChangeNotification',
convert: (model, msg, publish, options, meta) => {
const zoneStatus = msg.data.zonestatus;
return {
sos: (zoneStatus & 1<<1) > 0,
battery_low: (zoneStatus & 1<<3) > 0,
};
},
},
为什么zoneStatus的第1 bit表示按键,第3bit是电量低的标志,现在还不知道,可能要参考别的,或靠经验了.
调试下来bit 1是比较容易发现的,因为按按键的时候这一位为1,没按按键的时候是0 ( 没按按键,也会定时上报状态的 ),下面是没按按键时定期上报的日志,zonestatus值为16
zigbee2mqtt:debug 2020-04-05 11:19:13: Received Zigbee message from '0x00158d0001ff3ab3', type 'commandStatusChangeNotification', cluster 'ssIasZone', data '{"zonestatus":16,"extendedstatus":0}' from endpoint 1 with groupID 0
当然要把这个加到前面devices.js里面.
..
fromzigbee: [fz.sslj_sos_alarm_2],
..
保存(如果需要,要复制回去),重启,就能用了
zigbee2mqtt:info 2020-04-05 11:19:13: MQTT publish: topic 'zigbee2mqtt/0x00158d0001ff3ab3', payload '{"sos":false,"battery_low":false,"linkquality":123,"test":{"zonestatus":16,"extendedstatus":0}}'
zigbee2mqtt:info 2020-04-05 11:18:07: MQTT publish: topic 'zigbee2mqtt/0x00158d0001ff3ab3', payload '{"sos":true,"battery_low":false,"linkquality":94,"test":{"zonestatus":18,"extendedstatus":0}}'
PS:忽略 test 字段,这个是我用来测试的,后面也会去掉.
|
|