This project creates a Matter-capable PWM-controlled light, that can be controlled using capacitive buttons or using Home Assistant/Apple HomeKit/Google Home through Matter API.
- connectedhomeip (aka Matter) repository is already properly configured and working on your ubuntu machine.
- Create third_party folder softlink to matter repository
ln -s ${HOME}/esp/connectedhomeip ./third_party
- Set up environment
source ~/esp/esp-idf/export.sh
export IDF_CCACHE_ENABLE=1
source ~/esp/connectedhomeip/scripts/activate.sh
- Build project
idf.py flash monitor
- Commission the matter device as per normal according to Home Assistant/Apple HomeKit/Google Home Matter device onboarding procedures. A Matter controller/router must already be setup beforehand in your home network.
Manual pairing code: 10596512353
Prototype using a power delivery chip to supply 12V to power the IRS4427S MOSFET driver, and 24 (4S6P) 5730 LEDs. A buck converter steps down the voltage to 5V to power the ESP32. The AMS1117 voltage regulator on the ESP32 DevKitC board further steps down the voltage to 3.3V to power the INA226 power monitoring module.
esptool.py erase_region 0x10000 0xD000
Matter ZAP files are used to create the endpoints and clusters on the device.
- Start ZAP Tool
${HOME}/esp/connectedhomeip/scripts/tools/zap/run_zaptool.sh
- Create Endpoint 0 with Matter Root Node
- Create Endpoint 1,2,3,... for the actual device
- File -> Save As -> Choose Project/Common Folder to save at -> Filename should end with
.zap
${HOME}/esp/connectedhomeip/scripts/tools/zap/run_zaptool.sh $PATH_TO_ZAP_FILE
${HOME}/esp/connectedhomeip/scripts/tools/zap/generate.py $PATH_TO_ZAP_FILE
- Change --input-glob
*matter-desk-light-app*
to the filename of.zap
and.matter
- Change --external-root to parent directory of
.zap
and.matter
files
${HOME}/esp/connectedhomeip/scripts/codepregen.py --input-glob "*matter-desk-light-app*" --input-glob "*controller-clusters*" --input-glob "*protocol_messages*" --external-root ${HOME}/Documents/ESP-IDF_Projects/matter-desk-light/ ${OUTPUT_DIRECTORY:-./zzz_pregenerated/}
Tested on:
- OS: Ubuntu 22.04
- Note: Matter can only be built on linux systems.
- ESP-IDF v5.2
- GCC 13.2
- GNU++23
- GNU17