Skip to content

Binary Sensor

Base Example
binary_sensor:
- platform: ... # [!code highlight]
name: 'My Binary Sensor'
device_class: presence

Common attributes are documented in Common Component Properties.

PropertyDescriptionExample
device_classHome Assistant binary sensor class (for example presence, motion, door).presence
on_pressTrigger block that runs when state changes to true.then: - switch.turn_on: "screen"
on_releaseTrigger block that runs when state changes to false.then: - switch.turn_off: "screen"
FilterDescription
invertInverts the boolean value (true <-> false).
delayed_onDelays propagation of true values by the configured duration.
delayed_offDelays propagation of false values by the configured duration.
PlatformNotes
ShellReads boolean state from command output.
GPIOReads binary state from GPIO pin events.

For platform-specific configuration options, use the linked platform pages.

Similar to ESPHome: Binary Sensor