Matter Light Switch

Technical solutionMatter
Use caseLighting
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 chipsESP32-C3
ConnectivityWi-Fi, BLE for pairing
FrameworkESP-Matter
Controllerchip-tool

You will need

What you can try

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.

  1. Connect: Plug in the board over USB and pick its serial port.
  2. Flash: Write the prebuilt Matter firmware straight from the browser.
  3. Pair: Pair the switch and a Matter Light board with chip-tool.
  4. Bind: Bind the switch to the light, then press BOOT to toggle it.

Detailed instructions

1. Connect and flash

  1. Connect the board over USB, click Connect above the terminal and pick its port.
  2. 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

  1. Click Reset.
  2. Wait for Commissioning window opened in the console. The board is now ready to pair.

3. Pair both boards with chip-tool

  1. Flash a second ESP32-C3 with the Matter Light (Wi-Fi) example.
  2. Install chip-tool (Linux: sudo snap install chip-tool).
  3. 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

  1. 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
  2. Press BOOT on the switch: the light board toggles, with no phone or hub involved.

5. Pair again

  1. To start over, remove the device from the app, then hold the BOOT button for about 10 seconds to factory reset it.
  2. 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 code3497-011-2332
QRMT:Y.K9042C00KA0648G00
Works withApple 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?