PlaceOS::Driver::Presence::Smoother
Inherits Reference < Object
Smooths the output of an unreliable presence sensor over a sliding time window, latching the state and only switching once the opposing signal dominates the window. Compose one instance per sensor.
Constructors
Instance methods
Returns confidence in the current smoothed output state, from 0.0 to 1.0.
Calling this also evaluates whether the smoothed state should change.
Returns confidence in the current smoothed output state as a percentage.
For example, 56.3 means 56.3% confidence.
Records a raw sensor state.
The first observation establishes the initial smoothed output state. Repeated observations of the same state are ignored because the state continues accumulating time without requiring another transition.
Evaluates the current sliding window and returns the smoothed state, confidence and supporting information.
Returns nil until the first sensor observation.