Skip to content

Update _index.md for Binary Sensor #5270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: current
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions content/components/binary_sensor/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Advanced options:

- **trigger_on_initial_state** (*Optional*, boolean): If true, any applicable triggers will be fired when the binary sensor
state changes from `unknown` to a valid state. This applies to the first valid state set, and any valid state set after
a `binary_sensor.invalidate_state` action has been excuted. The default is `false`.
a `binary_sensor.invalidate_state` action has been executed. The default is `false`.
**publish_initial_state** (*Optional*, boolean): A deprecated equivalent to `trigger_on_initial_state`.

- **entity_category** (*Optional*, string): The category of the entity.
Expand All @@ -88,23 +88,7 @@ Advanced options:
Set to `""` to remove the default entity category.

- If MQTT enabled, all other options from [MQTT Component](#config-mqtt-component).
- If Webserver enabled and version 3 is selected, All other options from Webserver Component.. See [Webserver Version 3](#config-webserver-version-3-options).

## Actions

{{< anchor "binary_sensor-invalidate_state-action" >}}

### `binary_sensor.invalidate_state` Action

This action will invalidate the current state of the sensor. It is most useful with the Template binary sensor.
After the state is invalidated, it will be reported to Home Assistant as `unknown`. Example:

```yaml
on_...:
binary_sensor.invalidate_state: my_binary_sensor_id
```

The state may also be invalidated by an API call in a lambda - see the API reference linked below.
- If Webserver enabled and version 3 is selected, All other options from Webserver Component. See [Webserver Version 3](#config-webserver-version-3-options).

{{< anchor "binary_sensor-filters" >}}

Expand Down Expand Up @@ -469,6 +453,22 @@ on_multi_click:
- logger.log: "Single Short Clicked"
```

## Referencing Binary Sensors

{{< anchor "binary_sensor-invalidate_state-action" >}}

### `binary_sensor.invalidate_state` Action

This action will invalidate the current state of the sensor. It is most useful with the Template binary sensor.
After the state is invalidated, it will be reported to Home Assistant as `unknown`. Example:

```yaml
on_...:
binary_sensor.invalidate_state: my_binary_sensor_id
```

The state may also be invalidated by an API call in a lambda - see the API reference linked below.

{{< anchor "binary_sensor-is_on_condition" >}}
{{< anchor "binary_sensor-is_off_condition" >}}

Expand Down