Matter and HomeKit setup codes explained

Smart-home setup codes carry the passcode that pairs a device with your home app. Here's what's inside them, how to use them, and why the sticker is worth keeping.

A smart-home setup code is a QR code (with a numeric code next to it) that holds the passcode your home app needs to pair the device. Matter codes start with MT:, HomeKit codes with X-HM://, and Wi-Fi Easy Connect codes with DPP:. Keep the code: you need it again after a reset.

Matter setup codes

Matter is the smart-home standard from the Connectivity Standards Alliance (CSA). A Matter device carries a QR code and a manual pairing code, on the device, its box or in the manual.

The QR code: MT:

The QR code’s text is MT: followed by a payload encoded in Base38 (digits, capital letters, - and .). Decoded, the Matter specification’s onboarding payload holds:

Field What it’s for
Version The payload format version
Vendor ID Who made the device
Product ID Which model it is
Commissioning flow Whether pairing mode starts at power-on, after a button press, or as the maker’s app says
Discovery capabilities How the phone can find the device while pairing: Bluetooth LE, the device’s own Wi-Fi, or your home network
Discriminator A 12-bit number that tells devices in pairing mode apart
Passcode The 27-bit setup passcode that proves you hold the device

A box with several devices can carry one code with a payload for each, joined by *.

The manual pairing code

Next to the QR code is a numeric code for typing in: 11 digits, or 21 digits when it also includes the vendor and product IDs. It’s usually printed in groups, like 1234-567-8901. The last digit is a check digit, so a typo is usually caught. Both codes carry the same passcode.

HomeKit setup codes

Apple Home accessories use an 8-digit setup code, printed as XXX-XX-XXX, often with a QR code beside it. The QR code’s text is X-HM:// followed by nine characters that encode the setup code, a few pairing flags and the accessory category (light bulb, door lock and so on), then a four-character setup ID.

When you add an accessory in the Home app, Apple’s guide says you may scan its QR code, enter the 8-digit setup code, or, for a Matter accessory, enter its 11- or 21-digit code.

Wi-Fi Easy Connect codes

Wi-Fi Easy Connect, from the Wi-Fi Alliance, lets you put a device without a screen (a camera, a plug, a printer) on your Wi-Fi by scanning a product QR code. The code’s text starts with DPP: and ends with ;;. It holds the device’s public key (K:), and can also hold its Wi-Fi channels (C:), its MAC address (M:), maker information (I:) and the version (V:).

Scanning it with a phone that supports Easy Connect sends your Wi-Fi network’s details to that device. On Android this goes through the Wi-Fi settings. Scan only codes on your own devices, since the code hands your Wi-Fi details to whatever device it belongs to.

Adding a device to your home app

The steps differ a little between apps, but the pattern is the same:

  1. Power on the device and put it in pairing mode as the manual says.
  2. In Google Home, Apple Home, SmartThings or another Matter app, choose to add a device. Some phones also show a pop-up when a new Matter device is nearby.
  3. Scan the QR code, or choose the option to type the numeric code.
  4. Follow the app to name the device, pick a room and join it to your network. Matter devices that use Thread need a Thread border router (such as some smart speakers and hubs) on your network.

Matter devices can be shared with more than one home app. To add a device that’s already set up to a second app, use the sharing option in the first app, which makes a new temporary pairing code, rather than the code on the sticker.

Keep the code, but keep it private

  • Keep it. After a factory reset, when you move to another home app, or when you sell the device, you need the code again. Keep the box, take the sticker off and file it with the manual, or keep a private copy.
  • Don’t post it. Anyone with the code can add the device to their own home while it’s in pairing mode. Crop or cover it before you share photos of the device or its packaging.
  • Damaged sticker? Type the numeric code instead of scanning.

Reading a setup code with QR App

QR App for Android reads these codes on the phone. For a Matter or HomeKit code it shows the numeric code to type into your home app in large type, how the device connects, the vendor and product IDs (Matter) or the accessory category (HomeKit), and how pairing mode starts. Copy setup code copies it, and Save as card keeps a copy for after a reset. It also flags a setup code that isn’t valid (such as a passcode the standard doesn’t allow), which can mean a damaged or fake label, and notes when a vendor ID is reserved for test devices.

For a Wi-Fi Easy Connect code it shows the device information, and Set up on Wi-Fi hands the code to Android’s Wi-Fi settings on phones with Android 10 or newer that support it. Android asks for your screen lock and then sends your Wi-Fi network’s details to the device; the app doesn’t see or keep your Wi-Fi password.

QR App doesn’t pair Matter or HomeKit devices itself: that’s the home app’s job. For a regular Wi-Fi network code, see the Wi-Fi QR code guide.

Questions and answers

I lost the setup code sticker. Can I still add the device?

Check the box, the manual and the device itself, as the code is often printed in more than one place. If it's gone, contact the maker; some devices that are already set up can also share themselves with another home app from the app that controls them.

Do I need the setup code again after a factory reset?

Yes. After a reset the device has to be paired again, and pairing asks for the setup code, either as the QR code or the numeric code.

Is it risky to post a photo of my device's setup code?

Anyone with the code can add the device to their own home while it's in pairing mode. Crop or cover the code before you share photos of the device or its box.

What's the difference between the Matter QR code and the numeric code?

Both carry the same passcode. The QR code also holds the vendor and product IDs and how the device can be found, while the 11-digit manual code carries what's needed to pair, for typing when a camera can't read the label.

Can one QR code set up a device on Wi-Fi without its own app?

A Wi-Fi Easy Connect (DPP:) code lets a phone send your Wi-Fi details to a device without a screen. On Android this goes through the Wi-Fi settings, on phones that support Easy Connect.

Sources