这货, 全部走的是自定义功能, 要从Cluster开始写, fromZigee, toZigee, expose 全部要写, 开发量有点大, 而且没有设备,也无法调:
const herdsman = require('zigbee-herdsman');
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const tz = require('../converters/toZigbee');
const constants = require('../lib/constants');
const reporting = require('../lib/reporting');
const e = exposes.presets;
const manuSpecificOwonPresence = {
ID: 0xFD00,
manufacturerCode: ???, 要调试获得
attributes: {
status: { ID: 0, type: herdsman.Zcl.DataType.enum8 },
breathRate: {ID: 2, type: herdsman.Zcl.DataType.uint8 }
userX: { ID: 3, type: herdsman.Zcl.DataType.int16 },
userY: { ID: 4, type: herdsman.Zcl.DataType.int16 },
bedLeftTopX: { ID: 0x0100, type: herdsman.Zcl.DataType.int16 },
bedLeftTopY: { ID: 0x0101, type: herdsman.Zcl.DataType.int16 },
bedRightBottomX: { ID: 0x0102, type: herdsman.Zcl.DataType.int16 },
bedRightBottomY: { ID: 0x0103, type: herdsman.Zcl.DataType.int16 },
// ...
},
commands: {},
commandsResponse: {},
}
module.exports = [
{
zigbeeModel: ['FDS315'],
model: 'FDS315',
vendor: 'OWON',
description: 'OWON Presence Detector FDS315',
fromZigbee: [{
cluster: 'manuSpecificOwonPresence',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const result = {};
const data = msg.data;
....
}
}],
toZigbee: [....],
exposes: [...],
configure: async (device, coordinatorEndpoint, logger) => {
await endpoint.read('genBasic', ['manufacturerName', 'zclVersion', 'appVersion', 'modelId', 'powerSource']);
},
},
]