diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 090c754ede4..1ce1f869139 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -73,7 +73,7 @@ automation: above: 17 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: hours: 1 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.

+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 %} 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' # If given, will trigger when state has been the to state for X time. - for: - hours: 1 - minutes: 10 - seconds: 5 + for: '01:10:05' ```