You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/matter/ep_occupancy_sensor.rst
+96-2Lines changed: 96 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ The ``MatterOccupancySensor`` class provides an occupancy sensor endpoint for Ma
10
10
**Features:**
11
11
* Occupancy state reporting (occupied/unoccupied)
12
12
* Multiple sensor type support (PIR, Ultrasonic, Physical Contact)
13
+
* HoldTime attribute for configuring how long the sensor holds the "occupied" state
14
+
* HoldTimeLimits (min, max, default) for validation and controller guidance
15
+
* HoldTime change callback for real-time updates from Matter controllers
13
16
* Simple boolean state
14
17
* Read-only sensor (no control functionality)
15
18
* Automatic state updates
@@ -104,6 +107,83 @@ Gets the current occupancy state.
104
107
105
108
This function will return ``true`` if occupied, ``false`` if unoccupied.
106
109
110
+
HoldTime Control
111
+
****************
112
+
113
+
setHoldTime
114
+
^^^^^^^^^^^
115
+
116
+
Sets the HoldTime value (in seconds). The HoldTime determines how long the sensor maintains the "occupied" state after the last detection.
117
+
118
+
.. code-block:: arduino
119
+
120
+
bool setHoldTime(uint16_t _holdTime_seconds);
121
+
122
+
* ``_holdTime_seconds`` - HoldTime value in seconds
123
+
124
+
**Important:** This function must be called after ``Matter.begin()`` has been called, as it requires the Matter event loop to be running.
125
+
126
+
This function will return ``true`` if successful, ``false`` otherwise.
127
+
128
+
getHoldTime
129
+
^^^^^^^^^^^
130
+
131
+
Gets the current HoldTime value (in seconds).
132
+
133
+
.. code-block:: arduino
134
+
135
+
uint16_t getHoldTime();
136
+
137
+
This function will return the current HoldTime value in seconds.
138
+
139
+
setHoldTimeLimits
140
+
^^^^^^^^^^^^^^^^^
141
+
142
+
Sets the HoldTime limits (minimum, maximum, and default values). These limits define the valid range for HoldTime values and provide metadata for Matter controllers.
* ``_holdTimeMin_seconds`` - Minimum HoldTime value in seconds
149
+
* ``_holdTimeMax_seconds`` - Maximum HoldTime value in seconds
150
+
* ``_holdTimeDefault_seconds`` - Default/recommended HoldTime value in seconds (informational metadata for controllers)
151
+
152
+
**Important:**
153
+
* This function must be called after ``Matter.begin()`` has been called, as it requires the Matter event loop to be running.
154
+
* The ``holdTimeDefault_seconds`` parameter is informational metadata for Matter controllers (recommended default value). It does NOT automatically set the HoldTime attribute - use ``setHoldTime()`` to set the actual value.
155
+
* If the current HoldTime value is outside the new limits, it will be automatically adjusted to the nearest limit (minimum or maximum).
156
+
157
+
This function will return ``true`` if successful, ``false`` otherwise.
158
+
159
+
onHoldTimeChange
160
+
^^^^^^^^^^^^^^^^
161
+
162
+
Sets a callback function that will be called when the HoldTime value is changed by a Matter Controller.
* **Matter Occupancy Sensor** - Creates a Matter-compatible occupancy sensor device with automatic simulation of occupancy state changes. `View Matter Occupancy Sensor code on GitHub <https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples/MatterOccupancySensor>`_
208
+
* **Matter Occupancy Sensor with HoldTime** - Creates a Matter-compatible occupancy sensor device with HoldTime functionality, automatic simulation of occupancy state changes, HoldTime configuration with persistence across reboots, and HoldTime change callback for real-time updates from Matter controllers. `View Matter Occupancy Sensor with HoldTime code on GitHub <https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples/MatterOccupancyWithHoldTime>`_
208
209
* **Matter Water Leak Detector** - Creates a Matter-compatible water leak detector device with automatic simulation of water leak detection state changes. `View Matter Water Leak Detector code on GitHub <https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples/MatterWaterLeakDetector>`_
209
210
* **Matter Water Freeze Detector** - Creates a Matter-compatible water freeze detector device with automatic simulation of water freeze detection state changes. `View Matter Water Freeze Detector code on GitHub <https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples/MatterWaterFreezeDetector>`_
210
211
* **Matter Rain Sensor** - Creates a Matter-compatible rain sensor device with automatic simulation of rain detection state changes. `View Matter Rain Sensor code on GitHub <https://github.com/espressif/arduino-esp32/tree/master/libraries/Matter/examples/MatterRainSensor>`_
0 commit comments