Skip to content

how to assign to correct models without ieee address #1

Description

@amigomcu

hi all,
i study this project, zigbee-demo to build self product now.
how to create a model without the models ieee address,
and the server app on zigbee znp.

how to assign to correct models when know the models information(endpoint id, device id ,in/out cluster and att id).

it seem need know device ieee address to read/write action(server.js),*1 and
build models(models.js)*2

*1:
ioServer.regReqHdlr('write', function (args, cb) {
var auxId = _.split(args.auxId, '/'), // [ epId, cid, rid ]
ieeeAddr = args.permAddr,
epId = parseInt(auxId[0]),
cid = auxId[2],
val = args.value,
ep = shepherd.find(ieeeAddr, epId);

    if (ieeeAddr === '0x00124b0001ce1003') {
        // ep.functional = model.functional;
        toggleDev(ep, cid, val);
    } else if (cid === 'genOnOff') {
        var cmd = val ? 'on' : 'off';
        ep.functional('genOnOff', cmd, {}, function (err, rsp) {});

}

*2.
var weatherDevInfo = {
type: 'EndDevice',
ieeeAddr: '0x00124b0001ce1001',
nwkAddr: 1,
manufId: 0,
epList: [ 1, 2 ],
endpoints: {
1: { // temperature
profId: 0x0104, epId: 1, devId: 770, inClusterList: [ 1026 ], outClusterList: [],
clusters: { msTemperatureMeasurement: { dir: 1, attrs: { measuredValue: 0 } } }
},
2: { // humidity
profId: 0x0104, epId: 2, devId: 770, inClusterList: [ 1029 ], outClusterList: [],
clusters: { msRelativeHumidity : { dir: 1, attrs: { measuredValue: 0 } } }
}
}
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions