mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-12 20:06:52 +00:00
Simplifying the for:
section (#8416)
The `for:` piece can be confusing for folks, providing the examples as human readable time, and mentioning that days and milliseconds are also supported.
This commit is contained in:
parent
91472b1889
commit
66f65d6a94
@ -73,7 +73,7 @@ automation:
|
|||||||
above: 17
|
above: 17
|
||||||
below: 25
|
below: 25
|
||||||
|
|
||||||
# If given, will trigger when condition has been for X time.
|
# If given, will trigger when condition has been for X time, can also use days and milliseconds.
|
||||||
for:
|
for:
|
||||||
hours: 1
|
hours: 1
|
||||||
minutes: 10
|
minutes: 10
|
||||||
@ -86,6 +86,25 @@ Listing above and below together means the numeric_state has to be between the t
|
|||||||
In the example above, a numeric_state that goes to 17.1-24.9 (from 17 or below, or 25 or above) would fire this trigger.
|
In the example above, a numeric_state that goes to 17.1-24.9 (from 17 or below, or 25 or above) would fire this trigger.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
The `for:` can also be specified as `HH:MM:SS` like this:
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
|
```yaml
|
||||||
|
automation:
|
||||||
|
trigger:
|
||||||
|
platform: numeric_state
|
||||||
|
entity_id: sensor.temperature
|
||||||
|
# Optional
|
||||||
|
value_template: '{{ state.attributes.battery }}'
|
||||||
|
# At least one of the following required
|
||||||
|
above: 17
|
||||||
|
below: 25
|
||||||
|
|
||||||
|
# If given, will trigger when condition has been for X time.
|
||||||
|
for: '01:10:05'
|
||||||
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
### {% linkable_title State trigger %}
|
### {% linkable_title State trigger %}
|
||||||
|
|
||||||
Triggers when the state of a given entity changes. If only `entity_id` is given trigger will activate for all state changes, even if only state attributes change.
|
Triggers when the state of a given entity changes. If only `entity_id` is given trigger will activate for all state changes, even if only state attributes change.
|
||||||
@ -101,10 +120,7 @@ automation:
|
|||||||
to: 'home'
|
to: 'home'
|
||||||
|
|
||||||
# If given, will trigger when state has been the to state for X time.
|
# If given, will trigger when state has been the to state for X time.
|
||||||
for:
|
for: '01:10:05'
|
||||||
hours: 1
|
|
||||||
minutes: 10
|
|
||||||
seconds: 5
|
|
||||||
```
|
```
|
||||||
|
|
||||||
<p class='note warning'>
|
<p class='note warning'>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user