Matter Door Lock over Wi-Fi
| Technical solution | Matter |
|---|---|
| Use case | Security & Access |
A Matter door lock built on the ESP-Matter data model, running on the cost-optimised ESP32-C2. Lock and unlock it from Apple Home, Google Home, Alexa or SmartThings, and see its state on the board.
Product use case: A Matter door lock on the ESP32-C2: lock and unlock from any Matter app, with the state shown live.
Overview
| Supported chips | ESP32-C2 |
|---|---|
| Connectivity | Wi-Fi, BLE for pairing |
| Framework | ESP-Matter |
| Controller | Any Matter ecosystem app |
You will need
- ESP32-C2 DevKit
- USB data cable
- Chrome or Edge (Web Serial)
- Phone with a Matter app (Apple Home, Google Home, Alexa or SmartThings) on 2.4 GHz Wi-Fi
What you can try
- Lock and unlock: Control the lock from any Matter app.
- Lock state: The app shows locked or unlocked in real time.
- Button control: Press BOOT to toggle the lock on the board.
- Cost-optimised: Runs on the ESP32-C2 with Wi-Fi and BLE.
Try it on a real board
Get an official DevKit from Espressif or one of its distributors, then flash this example straight from this page. Shop Espressif DevKits
Flash and try it
Flash the prebuilt firmware from the browser, then pair the board with any Matter app on your phone. Works in Chrome and Edge over USB.
- Connect: Plug in the board over USB and pick its serial port.
- Flash: Write the prebuilt Matter firmware straight from the browser.
- Reset: Reboot the board. It opens its Matter pairing window.
- Pair: Scan the Matter QR code with Apple Home, Google Home, Alexa or SmartThings.
Detailed instructions
1. Connect and flash
- Connect the board over USB, click
Connectabove the terminal and pick its port. - Click
Flash Device, choose Erase and flash and wait for it to finish. The flasher checks the chip against the supported list.
2. Reset the board
- Click
Reset. - Wait for
Commissioning window openedin the console. The board is now ready to pair.
3. Pair with a Matter app
- Keep your phone on the 2.4 GHz Wi-Fi network the board should join.
- In Apple Home, Google Home, Amazon Alexa, SmartThings, choose Add device → Matter.
- Scan the QR code in the Pair with Matter panel, or enter the code
34970112332. - This is a development build, so the app warns that the device is not certified. Tap Add anyway.
4. Try it
- Lock and unlock the door from the app.
- Press
BOOTon the board to toggle the lock locally; the app updates within a second. - On DevKits with an RGB LED, it shows the state: red locked, green unlocked, amber while moving.
5. Pair again
- To start over, remove the device from the app, then hold the
BOOTbutton for about 10 seconds to factory reset it. - Every board uses the same test pairing code, so keep only one unpaired board powered while pairing.
Pair with Matter
| Manual pairing code | 3497-011-2332 |
|---|---|
| QR | MT:Y.K9042C00KA0648G00 |
| Works with | Apple Home, Google Home, Amazon Alexa, SmartThings |
Development build with a test certificate. Tap Add anyway when the app asks. Setup PIN 20202021, discriminator 3840.
Having trouble connecting?
- Ensure your device is properly connected via USB
- Check if the correct drivers are installed
- Try a different USB port or cable
- Pairing fails? Confirm the phone has Bluetooth on and is close to the board
- Wi-Fi builds join 2.4 GHz networks only