Files
Shubham Patil 73b457477d examples/sensors: Example to demonstrate few sensors
Added the temperature, humidity, and occupancy sensor on different
endpoints.

Fixes https://github.com/espressif/esp-matter/issues/1105
2024-11-11 11:25:56 +05:30

1.6 KiB

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