Greetings!
I've added a Matter accessory via the Apple Home app. In my app, I'm attempting to commission this device and add it to my fabric. However, when I try to open the commissioning window, I receive an error stating, MTRBaseDevice doesn't support openCommissioningWindowWithDiscriminator over XPC.
It appears that opening a commissioning window via an XPC connection is not yet supported. Is there another method to commission the device? Can I retrieve the setup payload from the MTRBaseDevice object or the shared MTRDeviceController?
Here's the simplified version of my code:
var home: HMHome // HMHome received via HMHomeManager
var accessory: HMAccessory = home.accessory[0] // my Matter-supported accessory
let deviceController = MTRDeviceController.sharedController(
withID: home.matterControllerID as NSCopying,
xpcConnect: home.matterControllerXPCConnectBlock
)
let device = MTRBaseDevice(
nodeID: accessory.matterNodeID as NSNumber,
controller: deviceController
)
device.openCommissioningWindow(
withDiscriminator: 0,
duration: 900,
queue: .main) { payload, error in
if let payload {
// payload not received
} else if let error {
// I'm getting here "Error Domain=MTRErrorDomain Code=6 "(null)""
// and "MTRBaseDevice doesn't support openCommissioningWindowWithDiscriminator over XPC" logged in the console
print(error)
}
How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here
Matter
RSS for tagMatter is an IP-based, royalty-free connectivity protocol standard that enables communication among a wide range of smart devices.
Posts under Matter tag
45 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
Hi, I have tried to add Eve energy plug but still pairing failed, it reported always same error.
Error Domain=com.apple.MatterSupport Code=1 "(null)"
Could anyone help?
Regards
To be able to paire a matter device on ios I need to installed on my iPhone the matter client developper profile as indicate on the apple documentation
Adding Matter support to your ecosystem | Apple Developer Documentation
(To test your app on the iOS or macOS device that initiates the pairing, download the developer profile now, then install it.)
When I do that it works perfectly.
Otherwise the documentation says that the profile is only needed for development but when I want to use my app from the apple store (validate by Apple) and when I remove the profile it doesn't work anymore.
What do I have to do to paire Matter device on iphone without the Matter client developer profile.
Added the MatterExtension for MatterAddDeviceExtensionRequestHandler as new Target. Everything is automatically generated.
But still only the default MatterAddDevice pickerView is displayed instead of MatterAddDeviceExtension?!
func play() {
Task {
let homes = [MatterAddDeviceRequest.Home(displayName: "my Home")]
let topology = MatterAddDeviceRequest.Topology(ecosystemName: "MyEcosystemName", homes: homes)
let request = MatterAddDeviceRequest(topology: topology)
do {
try await request.perform()
print("Successfully set up device!")
} catch {
print("Failed to set up device with error: \(error)")
}
}
}
Entitlements:
Matter Allow Setup Payload = YES
.plist is set up:
NSLocalNetworkUsageDescription
NSBonjourServices:
On iOS 16.0, I added accessories via the MTRDeviceController class in the Matter.framework, and it worked fine.
But when I will phone upgrade to the latest version of the iOS (iOS 16.1.1), after I call "MTRDeviceController" class "pairDevice: onboardingPayload: error:" method. I get an error like this:
CHIP: [BLE] BLE:Error writing Characteristics in Chip service on the device: [The specified UUID is not allowed for this operation.]
According to the error message, I guess that the characteristics of a certain Bluetooth cannot be read and written. After trying to verify it, I find that the characteristics uuid of the Matter accessory: "18EE2EF5-263D-4559-959F-4F9C429F9D12" cannot be read.
So, my question is what can I do in iOS 16.1.1 to make my app work as well as it does on iOS 16.0.