<!--
{
  "availability" : [
    "iOS: 26.1.0 -",
    "iPadOS: 26.1.0 -",
    "macCatalyst: 26.1.0 -",
    "tvOS: 26.1.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMHomeManager/findVendorAccessory(hapPublicKey:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMHomeManager(im)findVendorAccessoryWithHAPPublicKey:completionHandler:"
  },
  "title" : "findVendorAccessory(hapPublicKey:completionHandler:)"
}
-->

# findVendorAccessory(hapPublicKey:completionHandler:)

Finds your vendor HAP accessory using its long-term public key.

```
func findVendorAccessory(hapPublicKey: Data, completionHandler completion: @escaping @Sendable (HMAccessory?, (any Error)?) -> Void)
```

```
func findVendorAccessory(hapPublicKey: Data) async throws -> HMAccessory?
```

## Parameters

`hapPublicKey`

The HAP long-term public key of the accessory with a length of 32 bytes.

`completion`

The block that HomeKit runs after the request completes. If HomeKit isn’t paired to a matching accessory, or if the current process doesn’t have access to the matching accessory, the completion block returns `nil` instead of an accessory. The completion block provides an error if you call `findVendorAccessory(hapPublicKey:completionHandler:)` before [`HMHomeManager`](/documentation/HomeKit/HMHomeManager) can retrieve a home, such as before HomeKit calls the [`homeManagerDidUpdateHomes(_:)`](/documentation/HomeKit/HMHomeManagerDelegate/homeManagerDidUpdateHomes(_:)) callback method.

## Overview

Use `findVendorAccessory(hapPublicKey:completionHandler:)` to find out if your accessory is currently paired with
HomeKit.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)