Skip to content

New core state track feature #3313

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

Merged
merged 3 commits into from
Sep 7, 2017
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions source/_components/binary_sensor.template.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Configuration variables:
- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **entity_id** (*Optional*): Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state.
- **on_delay** (*Optional*): The amount of time the template state must be met before this sensor will switch to on.
- **off_delay** (*Optional*): The amount of time the template state must be not met before this sensor will switch to off.

## {% linkable_title Examples %}

Expand Down Expand Up @@ -110,6 +112,20 @@ sensor:
icon_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}mdi:weather-sunny{% else %}mdi:weather-night{% endif %}'{% endraw %}
```

### {% linkable_title Washing Machine Running %}

This example creates a washing machine "load running" sensor by monitoring an energy meter connected to the washer. During the washer's operation, the energy meter will fluctuate wildly, hitting zero frequently even before the load is finished. By utilizing `off_delay`, we can have this sensor only turn off if there has been no washer activity for 5 minutes.

```yaml
# Determine when the washing machine has a load running.
binary_sensor:
- platform: template
name: Washing Machine
value_template: {% raw %}'{{ sensor.washing_machine_power > 0 }}'{% endraw %}
off_delay:
minutes: 5
```

### {% linkable_title Is anyone home? %}

This example is determining if anyone is home based on the combination
Expand Down
6 changes: 6 additions & 0 deletions source/_docs/automation/trigger.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ automation:
# At least one of the following required
above: 17
below: 25

# If given, will trigger when condition has been for X time.
for:
hours: 1
minutes: 10
seconds: 5
```

<p class='note'>
Expand Down