From 75127c197ad2cda802fc354363971c62e0f243ba Mon Sep 17 00:00:00 2001 From: Villhellm Date: Thu, 10 Dec 2020 11:39:09 -0800 Subject: [PATCH] Remove warning about using `now()` (#15878) Remove warning about using `now()` in template triggers --- source/_docs/automation/trigger.markdown | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 595cbdbcf8a..4d7466069d8 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -381,26 +381,7 @@ automation: The `for` template(s) will be evaluated when the `value_template` becomes `true`. -
- -Rendering templates with time (`now()`) is dangerous as trigger templates are only updated based on entity state changes. - -
- -As an alternative, providing you include the sensor [time](/integrations/time_date/) in your configuration, you can use the following template: - -{% raw %} - -```yaml -automation: - trigger: - platform: template - value_template: "{{ (states.sensor.time.last_changed - states.YOUR.ENTITY.last_changed).total_seconds() > 300 }}" -``` - -{% endraw %} - -which will evaluate to `True` if `YOUR.ENTITY` changed more than 300 seconds ago. +Templates that don't contain an entity will be rendered once per minute. ### Time trigger