Analog Threshold Binary Sensor

The analog_threshold binary sensor platform allows you to convert analog values (i.e. sensor readings) into boolean values, using a threshold as a reference. When the signal is above or equal to the threshold the binary sensor is true (this behavior can be changed by adding an invert filter).

It provides an hysteresis option to reduce instability when the source signal is noisy using different limits depending on the current state. Additionally a delay filter could be used to only change after a new state has been kept a minimum time.

If the source sensor is uninitialized at the moment of component creation, the initial state of the binary sensor wil be false, if later it has some reading errors, those invalid source updates will be ignored, and the binary sensor will keep it´s last state.

For example, below configuration would turn the readings of current sensor into a binary sensor.

# Example configuration entry
binary_sensor:
  - platform: analog_threshold
    name: "Garage Door Opening"
    sensor_id: motor_current_sensor
    threshold: 0.5

Configuration variables

  • sensor_id (Required, ID): The ID of the source sensor.

  • threshold (Required, float or mapping): Configures the reference for comparison. Accepts either a shorthand float number that will be used as both upper/lower threshold, or a mapping to define different values for each (to use hysteresis).

    • upper (Required, float): Upper threshold, that needs to be crossed to transition from low to high states.

    • lower (Required, float): Lower threshold, that needs to be crossed to transition from high to low states.

  • All other options from Binary Sensor.

See Also