mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 11:03:05 +00:00
7557f0b87f
- Driver specific changes for updated button component in examples. - Updated the device_hal code for button component upgrade. - Updated the idf_component.yml of examples to use latest version of espressif/cmake_utilities.
Matter Sensors
This example demonstrates the integration of temperature and humidity sensors (SHTC3) and an occupancy sensor (PIR).
This application creates the temperature sensor, humidity sensor, and occupancy sensor on endpoint 1, 2, and 3 respectively.
See the docs for more information about building and flashing the firmware.
Connecting the sensors
- Connecting the SHTC3, temperature and humidity sensor
| ESP32-C3 Pin | SHTC3 Pin |
|---|---|
| GND | GND |
| 3V3 | VCC |
| GPIO 4 | SDA |
| GPIO 5 | SCL |
- Connecting the PIR sensor
| ESP32-C3 Pin | PIR Pin |
|---|---|
| GND | GND |
| 3V3 | VCC |
| GPIO 7 | Output |
NOTE::
- Above mentioned wiring connection is configured by default in the example.
- Ensure that the GPIO pins used for the sensors are correctly configured through menuconfig.
- Modify the configuration parameters as needed for your specific hardware setup.
Usage
- Commission the app using Matter controller and read the attributes.
Below, we are using chip-tool to commission and subscribe the sensor attributes.
# Commission
chip-tool pairing ble-wifi 1 (SSID) (PASSPHRASE) 20202021 3840
# Start chip-tool in interactive mode
chip-tool interactive start
# Subscribe to attributes
> temperaturemeasurement subscribe measured-value 3 10 1 1
> relativehumiditymeasurement subscribe measured-value 3 10 1 2
> occupancysensing subscribe occupancy 3 10 1 3