Zigbee子设备配网

子设备配网是指智能设备依赖于网关连接到Aqara,因此,子设备配网的过程必须具体到某个网关,由网关完成设备激活和消息通知。

配网流程

zigbee设备配网

流程说明:

  1. 查询当前账号下支持该子设备的网关
  2. 选择网关,发送数据让网关进入配网状态
  3. 子设备配网成功,网关发送数据到Aqara 云平台
  4. 向Aqara 云平台查询配网结果
1. 开始子设备配网

接口说明

+ (void)requestCanJoinGatewayFromWithIndex:(NSInteger)index pageSize:(NSInteger)pageSize model:(NSString *)model positionId:(NSString *)positionId comletion:(void (^)(id result, NSError *error))completion;

参数说明

参数 说明
index 起始分页
pageSize 分页大小
model 需要配网的子设备模型值
positionId 家庭ID,从开放平台获取
completion 方法回调

示例代码:

[LMAccessNetRequest requestCanJoinGatewayFromWithIndex:0 pageSize:100 model:@"model.xxxxx.xxx" positionId:@"home.id" comletion:^(id  _Nonnull result, NSError * _Nonnull error) {

}];
2.停止配网

接口说明

+ (void)sendCancelAppPermisionToGateway:(NSString *)did completion:(void (^)(id response, NSError *error))completion;

参数说明 |参数|说明| |---|---| |did|网关ID| |completion|方法回调|

示例代码

[LMAccessNetRequest sendCancelAppPermisionToGateway:did completion:nil];
3. 查询配网结果

接口说明

+ (void)queryChildDeviceAccessNetResultWithGatewayDid:(NSString *)did completion:(void (^)(id response, NSError *error))completion;

参数说明 |参数|说明| |---|---| |did|网关ID| |completion|方法回调|

示例代码

[LMAccessNetRequest queryChildDeviceAccessNetResultWithGatewayDid:@"" completion:^(id  _Nonnull response, NSError * _Nonnull error) {

}];

返回参数说明

"result": {
    "timeStamp": 1685592290262,
    "parentDeviceId": "lumi1.6490c17ac4ec",
    "state": 1,
    "lang": 1
},
参数 说明
state 0 配网成功 1 无新增子设备 2 异常(需要看error信息)
parentDeviceId 网关ID
Copyright © 2023 深圳绿米联创科技有限公司 all right reserved,powered by Gitbook文档修改时间: 2024-02-21 09:55:50

results matching ""

    No results matching ""