Guides
How to find a lost HomeKit or Matter setup code
Lost the pairing code for a smart home accessory? Here is where every setup code is printed, how to recover one from the box or manual, and what to do when it is genuinely gone.
5 min read
Every HomeKit accessory has an eight-digit setup code, usually written as
XXX-XX-XXX. Matter accessories use an eleven-digit code. You scan it or type it
in once, when you first pair the device, and then, in most people’s experience,
never think about it again — until the day you move house, switch hubs, or reset
an accessory that has started misbehaving. At that point the code is the one
thing standing between you and a working device, and the sticker it was printed
on is behind a wall plate or in a skip.
This guide covers where the code is printed, how to recover one you have misplaced, and what your options are when it is truly gone.
What a setup code actually is
The setup code is a shared secret. During pairing, your phone and the accessory use it to prove to each other that they are in the same room and that you are allowed to add the device. HomeKit calls it a setup code; the Matter spec calls it a manual pairing code, and pairs it with a QR code that carries the same value plus a bit of extra routing information.
Three things follow from that, and they are the source of most confusion:
- You did not choose it. It was generated and printed when the device was manufactured. There is no “reset the code” option anywhere, in any app.
- It does not change. Factory-resetting an accessory clears its network and pairing state, but the code underneath is the same as the day you bought it.
- It is not stored in Apple Home in a form you can read back. Apple Home shows you accessory names, rooms and firmware versions, but it deliberately never exposes setup codes to any app, including third-party ones. So you cannot “look it up” after the fact from within Home.
Where the code is printed
In rough order of how likely it is to still exist:
1. On the accessory itself
Look for a small sticker with a QR code or a barcode, usually alongside a serial
number, a model number and regulatory logos. The setup code is the
XXX-XX-XXX-shaped number near it. Common spots by device type:
| Accessory | Usual location |
|---|---|
| Smart plug | The face with the prongs, or a side panel |
| Bulb | The collar just above the screw thread or pins |
| Light strip | The controller pod, or the power brick |
| Camera | The base, the back plate, or inside the battery door |
| Thermostat | Behind the faceplate, on the wall-mount bracket |
| Lock | Inside the battery compartment, on the interior escutcheon |
| Hub / bridge | The underside |
2. On the box
Almost every manufacturer prints the code on the retail packaging, typically on a flap or the base, next to the barcode. If you keep boxes for the warranty period, this is often the easiest copy to reach.
3. In the manual or on a setup card
Look for a dedicated sticker or a printed panel labelled “HomeKit Setup Code”, “Setup Code” or “Scan to set up”. Some accessories ship a separate wallet-sized card with nothing on it but the QR code.
How to recover a code you have misplaced
If the accessory and its packaging are no help, work through these in order.
- Search your photos. A lot of people photograph the code or the QR label during setup so they can scan it from the screen. Search your camera roll around the date you installed the device.
- Check your purchase records. The order confirmation or invoice sometimes lists it, and for a few brands the code is tied to the serial number, which is on the invoice — support can then look it up.
- Ask the manufacturer. Contact support with the model and serial number and ask for the HomeKit setup code. Success varies by brand, but it costs nothing to ask.
- Look for a companion-app export. Some ecosystems (certain Aqara, Eve and Nanoleaf devices) show the pairing code inside their own app while the accessory is still paired to them, even though Apple Home will not.
When the code is genuinely gone
If there is no readable copy anywhere, the accessory is not bricked — but adding it back to Apple Home takes a detour:
- Factory reset the accessory, following the manufacturer’s instructions (usually a button hold, or a power-cycle sequence).
- Pair it through the manufacturer’s own app first, if it has one. Matter accessories in particular can open a fresh commissioning window from the vendor app, which issues a new, temporary pairing code you can then use to add the device to Apple Home as well.
- For HomeKit-only accessories with no app, a reset alone will not conjure a code — you still need the original printed one. This is the case where recovering the number from a photo or from support is the only path, and it is why keeping a copy matters.
A quick checklist
- The code is
XXX-XX-XXX(HomeKit) or eleven digits (Matter). - It is on the device, the box, and the manual — check all three.
- It never changes and a reset does not affect it.
- Apple Home will not show it to you after pairing, by design.
- No printed copy and no app fallback means reset and re-pair, or recover the number from a photo, receipt or the manufacturer.
- Once you have it back, write it down somewhere permanent.