This example demonstrates a dynamic Matter device application that allows you to configure the device type at runtime via CLI commands. The selected device type is persisted in NVS (Non-Volatile Storage) and automatically restored on subsequent boots.
This application supports WiFi-based ESP32 SoCs only
Note: Thread devices are not supported by this example.
Please setup ESP-IDF and CHIP Environment and refer building and commissioning guides to get started.
On first boot, the application will display:
================================================== No stored device type found. Use command: devtype set <device-type> ==================================================
Use the shell command to set and initialize a device type:
devtype set <device-type>
Example:
devtype set contact-sensor
On successful initialization, the device type is saved to NVS and the Matter server starts.
On subsequent boots, the application automatically:
================================================== Found stored device type: contact-sensor Auto-initializing... ==================================================
The available device types depend on what's registered in the DeviceFactory. Check all-devices-common/devices/device-factory/DeviceFactory.h for the list of supported types.
To change the device type after it has been set, you need to perform a factory reset to clear the NVS:
matter device factoryreset
After factory reset, reboot the device and set a new device type using the devtype set command.