mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 16:27:19 +00:00
New core state track feature (#3313)
* Update binary_sensor.template.markdown * Update trigger.markdown * Update trigger.markdown
This commit is contained in:
parent
c3736c2fd9
commit
964b6224b0
@ -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 %}
|
||||
|
||||
@ -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
|
||||
|
@ -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'>
|
||||
|
Loading…
x
Reference in New Issue
Block a user