"Accessory is not reachable" error

Hi, I am having problem trying to add accessory to HMHome, the problem happens both with HomeKit Accessory Simulator, and the iOS10 iPhone 6s simulator running on the same machine. XCode version: 8.1

The code to add accessory:

- (IBAction)unwindToAccessoryList:(UIStoryboardSegue* )segue {

NewAccessoryTableViewController* sourceController = [segue sourceViewController];

if(sourceController.accessoryItemArray.count > 0) {

for(AccessoryItem* item in sourceController.accessoryItemArray) {

if(item.selected) {

/

[self.home addAccessory:item.accessory completionHandler:^(NSError * _Nullable error) {

if(error) {

NSLog(@"AccessoryTableViewController:addAccessory(), error adding accessory to home, error:%@", error);

}

}];

}

}

[self.tableView reloadData];

}

}


the log I get:
2016-11-17 10:02:39.253 LearnIOSApp2[1438:16151] AccessoryTableViewController:addAccessory(), error adding accessory to home, error:Error Domain=HMErrorDomain Code=4 "Accessory is not reachable." UserInfo={NSLocalizedDescription=Accessory is not reachable.}


and I have a dialog saying "the accessory is not certified", after I click "Add anyway", I don't have a prompt asking for Setup Code.

Thanks for any help!

I ran into this too, I was able to get around it by not calling HMAccessoryBrowser.stopSearchingForNewAccessories() until after paring was complete. If stop is called before or during the paring process bad things seem to happen.


Not sure if this is a HomeKit bug or by design.

"Accessory is not reachable" error
 
 
Q