ESP RainMaker Matter Controller
| Technical solution | Classic + Matter |
|---|---|
| Use case | Appliances & Controls |
Matter devices only talk over the home network, so on their own they cannot be reached from outside. This example turns an ESP32-S3 into an always-on Matter controller. It joins your ESP RainMaker home, lists the Matter devices in it, from any brand, and keeps their state in the cloud, so you can check and control them from anywhere. The flashed image supports Wi-Fi devices; Thread needs the border-router build with an ESP32-H2. A starting point for wall panels, gateways and speakers that run a whole home.
Product use cases
- At home: the ESP RainMaker Matter Controller as a wall panel switches your Matter devices directly over Matter, without the cloud.
- Away from home: the ESP RainMaker Home App reaches the same devices through the cloud and the Matter controller.
Overview
| Processor | ESP32-S3 (8 MB flash, octal PSRAM) |
|---|---|
| Connectivity | Wi-Fi + BLE |
| Vcc | 3.3V |
| IDF Version | ESP-IDF v5.5.x |
| SDK | ESP-Matter v1.5 on ESP RainMaker |
You will need
- ESP32-S3 DevKit with 8 MB flash and octal PSRAM
- USB data cable
- Chrome or Edge (Web Serial)
- ESP RainMaker Home App (web or phone) and esp-rainmaker-cli
- Matter devices (Wi-Fi, any brand) added to your home with the ESP RainMaker Home phone app
What you can try
- Joins Your Home: Add it with the ESP RainMaker Home App and bind it to your home.
- Sees Every Device: Lists the Matter devices in your home, from any brand, and keeps their online status and state up to date in the cloud.
- Control From Anywhere: Switch devices on or off and read their state through ESP RainMaker, even when you are away from home.
- Local Commands: Send Matter commands straight from the device console, handy for testing on your bench.
- Thread Ready: Add an ESP32-H2 and a rebuild to make the controller a Thread Border Router, so it can reach Thread devices too.
- Remote Management: Reboot, reset Wi-Fi or restore factory settings remotely, and update the firmware over the air.
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
Choose your deployment
Public deployment
Hosted by Espressif for evaluation. Free, with nothing to set up.
- Flash: Connect the ESP32-S3, choose Erase and flash, then press Reset. A QR code appears in the console.
- Add to the ESP RainMaker Home App: In the Home App panel, tap +, add the device over Bluetooth with the PoP from the console, join your Wi-Fi and accept the authorization prompt. On a phone, scan the QR code instead.
- Bind to your home: Check Device identifiers below the console. If it shows Needs a home, run the command it gives.
- Control remotely: On another network, open the ESP RainMaker Home phone app (not the webapp) and switch a Matter device marked Controller. Or use esp-rainmaker-cli.
Detailed instructions
1. Before you start
- An ESP32-S3 DevKit with 8 MB flash and octal PSRAM, and a USB data cable.
- An ESP RainMaker account for the Home App, here next to the console or on your phone, and
esp-rainmaker-clisigned in to the same account:pip install esp-rainmaker-cli esp-rainmaker-cli login
- Matter devices (Wi-Fi, any brand) added to your home with the ESP RainMaker Home phone app, such as an ESP RainMaker + Matter device. They can also be added later.
2. Flash the controller
- Click
Connectabove the console and pick the board's serial port. - Click
Flash Device, choose Erase and flash and wait for it to finish. - Press
Reset. A QR code appears in the console.
3. Add it in the ESP RainMaker Home App
- In the Home App panel next to the console, keep the ESP RainMaker Classic deployment and sign in with the account that holds your Matter devices. On the phone app, tap
+and scan the QR code in the console instead, then skip to the Wi-Fi step. - Tap
+, choose I do not have a QR code, then Bluetooth. - In Chrome's Bluetooth window, pick the device whose name matches the one in the console, for example
PROV_ff7bf2. - Enter the PoP when asked. Copy the
"pop"value from theQRCODE:line of the console exactly. - Join the same Wi-Fi network as your Matter devices.
- If the app asks, pick the home that holds your Matter devices and accept the prompt to authorize the controller.
4. Bind it to your home
- Watch Device identifiers below the console. Controller setup turns Ready when the controller has joined your home.
- If it shows Needs a home, list your homes and note the ID of the one that holds your Matter devices:
esp-rainmaker-cli group list
- Run the command shown in the panel with that ID in place of
<home-group-id>. A controller can be bound only once, so double-check the ID.
5. Check your devices
- Matter devices in the panel lists each device in your home, with its online status. After adding or removing a device, run the refresh command shown there.
- Copy the controller's RainMaker node ID and a device's Matter node ID with the copy buttons. You need both for the esp-rainmaker-cli commands next.
6. Control a device from anywhere
- Take your phone off your home Wi-Fi, for example onto mobile data, and open the ESP RainMaker Home phone app. Your Matter devices are marked Controller, because the app reaches them through it. Switch one on or off. Use the phone app for this, not the web app.
- Or use
esp-rainmaker-cli. Toggle the device through the controller:esp-rainmaker-cli create_cmd_request <rainmaker-node-id> 4352 \ '{"objects":[{"matter_node_id":"<matter-node-id>","matter_endpoint_id":"0x1"}], "request_payload":{"cluster_id":"0x6","command_id":"0x2","command_fields":{}}}' --timeout 60 - Fetch the result with the request ID it prints. A
successstatus means the device received the command:esp-rainmaker-cli get_cmd_requests <request-id>
- Read the device's state back the same way:
esp-rainmaker-cli create_cmd_request <rainmaker-node-id> 4354 \ '{"matter_node_id":"<matter-node-id>", "attribute_paths":[{"endpoint_id":"0x1","cluster_id":"0x6","attribute_id":"0x0"}]}' --timeout 60 - For a quick local test, type this in the console instead:
matter esp controller invoke-cmd <matter-node-id> 0x1 0x6 0x2
Private deployment
Your own ESP RainMaker Classic deployment. Register nodes with the Admin CLI, not the dashboard.
- Register: With the ESP RainMaker Admin CLI, generate device certificates and register them with node_certs.csv.
- Load credentials: Zip the CLI batch folder (Mfg-…) or pick one node's .bin from its bin/ folder, and drop it into Device credentials.
- Flash: Write the firmware and the credentials in one pass. The board resets when done.
- Pair: Sign in to your private Classic deployment in the Home App, then add the device with the PoP from the console.
Detailed instructions
1. Before you start
- A private ESP RainMaker Classic deployment (you need its deployment base URL and super-admin email from setup).
- The ESP RainMaker Admin CLI installed on your computer (esp-rainmaker-admin-cli).
- An ESP32-family DevKit that matches this example, a USB data cable, and Chrome or Edge.
2. Generate and register device certificates
- Follow the Admin CLI user guide. Set your deployment endpoint and log in:
python rainmaker_admin_cli.py account serverconfig --endpoint <your-deployment-base-url> python rainmaker_admin_cli.py account login --email <super-admin-email>
- Generate certificates for your boards (factory NVS images land under
bin/in the output folder):python rainmaker_admin_cli.py certs devicecert generate --count <n> --prov ble --outdir <outdir>
- Register them with the cloud using the batch's
common/node_certs.csv:python rainmaker_admin_cli.py certs devicecert register --inputfile <outdir>/<date>/Mfg-<no>/common/node_certs.csv
- Save the
request_idfrom the register command and check status when needed:python rainmaker_admin_cli.py certs devicecert getcertstatus --requestid <request_id>
- The output holds private keys. Keep it out of chats and repositories, and delete it when you are done.
3. Load the device credentials
- From the Admin CLI output folder, zip the
Mfg-<no>batch folder, or pick onebin/node-….binfile. - Drop that ZIP or
.binonto Device credentials above the console. It is read in your browser and never uploaded. - With the ZIP, pick the node for this board. Every board needs its own node: two boards with the same one connect as the same device.
- The credentials are flashed at
0x700000, where this example keeps itsfctrypartition.
4. Connect and flash
- Connect the board over USB, click
Connectabove the console and pick its port. - Click
Flash Deviceand choose Erase, then flash firmware + credentials. The firmware image goes to0x0and the credentials to0x700000in one pass, so the erase cannot wipe them. - The board resets when flashing is done. Type
get-node-idin the console when the firmware supports it: it prints the node you picked. - To give a board another node later, or restore one after a full erase, load the credentials and choose Credentials only. The firmware on the board is kept.
- To reflash only the firmware, choose Flash only. The credentials on the board are kept.
5. Sign in on your deployment
- In the Home App panel next to the console, sign in to your private ESP RainMaker Classic deployment (the base URL from your deployment setup).
- You can also use the ESP RainMaker phone app (iOS / Android); point it at the same deployment if your build supports a custom endpoint.
- Use a regular user account for day-to-day testing, not the super-admin account used with the Admin CLI.
6. Provision the device in the Home App
- Tap
+, choose I do not have a QR code, then Bluetooth. - In Chrome's Bluetooth window, pick the device whose name matches the one in the console, for example
PROV_ff7bf2. - Enter the PoP when asked. It is the
"pop"value in theQRCODE:line of the console, for example{"ver":"v1","name":"PROV_xxxxxx","pop":"xxxxxxxx","transport":"ble"}. - Pick your Wi-Fi network, enter its password and wait for provisioning to finish. The device then appears under My Devices.
- Control the device from the app.
The controller only sees Matter devices in the home it is bound to, for example an ESP RainMaker + Matter device. After adding or removing a device, refresh the list with the command in Device identifiers.
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
- Verify that your device is in flashing mode
- Get the latest ESP RainMaker phone application here