presence-detector
Description
The presence-detector block detects presence based on multiple logic inputs. As long as at least one connected input returns the logical value true, the block outputs true at its only output.
After presence disappears from all inputs, the block does not switch off immediately. Instead, it starts a timer and keeps the true state for the configured amount of time. If any input returns true again during that period, the timer is stopped and the block continues reporting presence without interruption.
The block has one input and one output. Multiple other blocks may be connected to its input.
Configuration parameters
| Parameter name | Value |
|---|---|
time_limit |
Required presence hold time after sensor presence disappears. The minimum value is 0.1 seconds, the maximum value is 64800 seconds (18 hours). Step 0.1 seconds. |
Input handling
The block allows multiple connections to its only input.
Each new input change causes the state to be recalculated according to the following rules:
- if at least one input currently has the logical value true, the block outputs true
- if no input currently has the logical value true, but presence had been detected before, the block starts the timer and continues outputting true
- if any input becomes logical true again while the timer is running, the timer is stopped and the block continues outputting true
- if the timer reaches the end and still no input has the logical value true, the block outputs false
The block recognizes presence only from logical true values. Values false, null, and values of other types do not mean presence.
If the timer is already counting down after presence disappeared and additional non-true values arrive during that time, the timer is not restarted and continues counting from the original start moment.
If no other block is connected to the block input, the block reports the Input disconnected. error.
Block outputs
The block has one boolean output:
- true when presence is currently detected on at least one input
- true when the inputs no longer detect presence but the hold timer is still active
- false when presence is not detected and the hold timer is inactive
The description visible below the block reflects the current state:
true: presence detectedmeans presence is detected by at least one inputtrue: presence hold activemeans the inputs no longer detect presence, but the timer is still holding the true statefalse: no presence detectedmeans presence is not detected
Errors visible to the user
The block can display the following error messages:
| Error code | Error description |
|---|---|
Invalid time_limit configuration. |
The time_limit parameter has an invalid value. It must be a positive numeric value with a 0.1 second step and must not exceed 64800 seconds. |
Input disconnected. |
No other block is connected to the block input. |
Examples
- If three inputs are connected to the block and at least one of them has the value true, the output becomes true and the description becomes
true: presence detected. - If all inputs change to values other than true, the block starts the timer and still outputs true with the description
true: presence hold active. - If one of the inputs becomes true again before the countdown ends, the timer is stopped and the description returns to
true: presence detected. - If the
time_limittime elapses and still no input has the value true, the output becomes false and the description changes tofalse: no presence detected.