ESPHome binary sensors represent any input that has exactly two states:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/esphome/esphome.io/llms.txt
Use this file to discover all available pages before exploring further.
ON or OFF. They map naturally to physical phenomena like a button being pressed, a door being open, motion being detected, or a GPIO pin being pulled high. Binary sensors appear automatically in Home Assistant and support rich automation triggers for press, release, click, double-click, and complex multi-click sequences.
Base Binary Sensor Configuration
All binary sensor platforms inherit these configuration variables.Manually specify the ID for code generation. At least one of
id and name must be specified.The name for the binary sensor in Home Assistant. Set to
None to inherit the device’s friendly_name.The Home Assistant device class (e.g.
motion, door, window, occupancy). Controls the icon and friendly state text.Manually override the MDI icon shown in the frontend.
A list of binary sensor filters applied in sequence.
If
true, the sensor is not exposed to Home Assistant. Setting only an id implicitly sets this to true. Defaults to false.If
true, the entity is added but hidden in Home Assistant until manually enabled. Defaults to false.If
true, automation triggers fire when the binary sensor transitions from unknown to its first valid state. Defaults to false.The entity category (
config, diagnostic). Set to "" to remove the default.Binary Sensor Filters
Filters modify how state changes propagate through the pipeline. They are applied in the order listed.invert
Flips every state: ON becomes OFF and vice versa. Useful when hardware logic is active-low.
delayed_on / delayed_off
Require the signal to remain stable for the specified duration before publishing the change. Essential for debouncing mechanical switches.
delayed_on_off
A combined debounce filter: publishes a change only after the signal has held the new state for the given duration.
autorepeat
Implements hold-to-repeat behavior. After the initial press, the output toggles at increasing frequency until released.
settle
Publishes the value immediately but ignores further changes until the signal has settled for the specified period.
Binary Sensor Automations
ESPHome binary sensors use mouse-button-inspired terminology: a press is the leading edge (ON), a release is the trailing edge (OFF).on_press
Fires on the leading edge (button down).
on_release
Fires on the trailing edge (button up).
on_state
Fires on any state change (combines press and release). The new state is available as boolean x.
on_click
Fires when the button is held for min_length to max_length.
Multiple
on_click entries are allowed and evaluated independently. Use different time ranges to distinguish short and long clicks.on_double_click
Fires when the button is pressed twice within the specified timing window.
on_multi_click
Matches complex press sequences using a timing grammar.
binary_sensor.is_on / binary_sensor.is_off Condition
Actions
Lambda Calls
Popular Binary Sensor Platforms
GPIO Binary Sensor
The most fundamental binary sensor: reads a digital GPIO pin. Supports pull-up/pull-down and inverted logic.
Status
Reports whether the device is connected to Home Assistant. Useful for connection watchdogs.
Touchscreen
Define rectangular touch zones on a display that act as virtual buttons.
Remote Receiver
Triggers ON/OFF when a specific IR or RF remote code is received.
ESP32 BLE Tracker
Detects BLE device presence by MAC address or RSSI threshold.
Template
Compute a binary state from any C++ lambda expression, sensor value, or switch state.