A virtual smart home device using the Waveshare ESP32-C6-GEEK that can be turned ON and OFF from smartphones and smart home ecosystems via the Matter protocol. You can verify the operation with real-time LCD state animations without connecting any physical PC hardware.
- Matter Protocol Compatible — Native support for Apple Home, Google Home, Amazon Alexa, and Home Assistant.
- Real-Time LCD Display — Animated 20 fps screen showing ON/OFF state, WiFi connection status, and assigned IP address.
- Automatic Backlight Dimming — Illuminates at full brightness for 10 seconds on events, then smoothly fades out over 22 seconds.
- Virtual / Physical Mode Switch — Seamlessly toggle between virtual software simulation and actual PC power button control (via optocoupler GPIO) with a single configuration line.
- OTA Update Support — Firmware can be updated over-the-air.
| Component | Model |
|---|---|
| Microcontroller | Waveshare ESP32-C6-GEEK |
| LCD Display | ST7789 (Integrated 135×240px) |
Note: Physical hardware mode (
PC_VIRTUAL_MODE 0) requires an external optocoupler circuit (e.g. PC817).
| Tool | Version |
|---|---|
| ESP-IDF | v5.4.1 |
| ESP-Matter | Latest (GN build tool required) |
| Python | 3.12.3+ |
| LovyanGFX | Bundled in components/ |
Edit main/wifi_creds.h:
#define WIFI_SSID "your-ssid" // WiFi SSID
#define WIFI_PASSWORD "your-password" // WiFi Password# Export ESP-IDF & ESP-Matter environment
source /path/to/esp-idf/export.sh
source /path/to/esp-matter/export.sh
# Build project
idf.py buildidf.py -p /dev/ttyACM0 flash-
Power on the device and wait until the LCD displays
Ready(the assigned IP address will appear in the footer). -
Open your smart home app (Apple Home, Google Home, etc.) and select "Add Device".
-
Scan the QR code displayed on screen (short-press the boot button on GPIO 9 to toggle QR display), or enter the 11-digit manual pairing code:
34970112332
You can also check pairing info via serial monitor:
idf.py -p /dev/ttyACM0 monitorLook for the
Manual pairing code:line in the startup logs.
Boot
└─ connecting... (Connecting to WiFi)
└─ Ready (IP acquired, waiting for Matter commands)
├─ ON (Received ON command from Matter)
└─ OFF (Received OFF command from Matter)
The footer displays the device's IP address and connection status.
In main/pc_control.h:
#define PC_VIRTUAL_MODE 1 // 1 = Virtual Mode (default), 0 = Physical GPIO ControlWhen set to 0 (Physical Mode), the board controls the PC power button via an optocoupler on GPIO 20.
In main/lcd_display.cpp:
#define BL_MAX 220 // Brightness immediately after event (0-255)
#define BL_HOLD_MS 10000 // Duration to hold full brightness [ms]
#define BL_FADE_STEP_MS 100 // Fade step interval [ms] (smaller = faster)Virtualdev/
├── CMakeLists.txt
├── partitions.csv Custom partition table with OTA support
├── sdkconfig.defaults Default build configurations
├── sdkconfig.defaults.esp32c6 ESP32-C6 specific configurations
├── main/
│ ├── app_main.cpp Matter node init and event callbacks
│ ├── lcd_display.cpp/hpp LovyanGFX LCD rendering & backlight control
│ ├── pc_control.c/h Virtual / physical power state management
│ ├── qr_code.h Commissioning QR bitmap
│ └── wifi_creds.h WiFi credentials configuration
├── components/
│ └── LovyanGFX/ High-performance graphics library
├── managed_components/ ESP-IDF managed components
└── doc/
├── readme.md Documentation copy
└── BUILD_INSTRUCTIONS.md Detailed build & troubleshooting instructions
This project is licensed under the Apache License 2.0. Third-party components:
- ESP-IDF, ESP-Matter: Apache License 2.0
- LovyanGFX: MIT License
- ESP-Matter — Official Espressif Matter SDK
- LovyanGFX — High-performance graphics driver library