Matter Light Switch
| Technical solution | Matter |
|---|---|
| Use case | Lighting |
| Advanced | ✓ |
An on/off light switch that controls other Matter lights directly over the network, with no hub or phone in the loop. Bind it to a second board running the Matter Light example and press the button to switch the light. Binding is set up with chip-tool, the Matter developer controller.
Product use case: Matter lights from different brands in one home, all controlled together from one Matter controller.
Overview
| Supported chips | ESP32-C3 |
|---|---|
| Connectivity | Wi-Fi, BLE for pairing |
| Framework | ESP-Matter |
| Controller | chip-tool |
You will need
- Two ESP32-C3 DevKits (one flashed with Matter Light)
- USB data cable
- Chrome or Edge (Web Serial)
- chip-tool on a Linux or macOS computer with Bluetooth
- 2.4 GHz Wi-Fi network
What you can try
- Device-to-device: The switch commands the light directly once bound.
- Bindings: Link the switch to one light or a whole group.
- Button control: Press BOOT on the switch to toggle the bound light.
- Developer tooling: Configured with chip-tool, the Matter reference controller.
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 and bind it to a Matter Light board with chip-tool. 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.
- Pair: Pair the switch and a Matter Light board with chip-tool.
- Bind: Bind the switch to the light, then press BOOT to toggle it.
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 both boards with chip-tool
- Flash a second ESP32-C3 with the Matter Light (Wi-Fi) example.
- Install
chip-tool(Linux:sudo snap install chip-tool). - Both boards share the test pairing code, so pair one at a time with only that board powered. Light first, then the switch:
chip-tool pairing ble-wifi 0x5164 <ssid> <password> 20202021 3840 chip-tool pairing ble-wifi 0x7283 <ssid> <password> 20202021 3840
4. Try it
- Allow the switch to control the light, then bind it:
chip-tool accesscontrol write acl '[{"privilege": 5, "authMode": 2, "subjects": [112233, 29315], "targets": null}]' 0x5164 0x0 chip-tool binding write binding '[{"node": 20836, "endpoint": 1, "cluster": 6}]' 0x7283 0x1 - Press
BOOTon the switch: the light board toggles, with no phone or hub involved.
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.
Advanced: needs two ESP32-C3 boards (one flashed with Matter Light) and chip-tool on your computer. Consumer Matter apps cannot create switch-to-light bindings.
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