mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 01:06:52 +00:00
Additional info on when template triggers fire (#8927)
Suggested change to remove any ambiguity when it comes to the conditions on when a template trigger will fire. This misunderstanding of the documentation has been posted on the forums before: Case 1: https://community.home-assistant.io/t/trigger-template-limitation/68663/5 Case 2: https://community.home-assistant.io/t/template-trigger-only-work-in-templates-editor/24962
This commit is contained in:
parent
15016f2f72
commit
0d47b3f829
@ -172,7 +172,7 @@ A very thorough explanation of this is available in the Wikipedia article about
|
|||||||
|
|
||||||
### {% linkable_title Template trigger %}
|
### {% linkable_title Template trigger %}
|
||||||
|
|
||||||
Template triggers work by evaluating a [template](/docs/configuration/templating/) on every state change for all of the recognized entities. The trigger will fire if the state change caused the template to render 'true'. This is achieved by having the template result in a true boolean expression (`{% raw %}{{ is_state('device_tracker.paulus', 'home') }}{% endraw %}`) or by having the template render 'true' (example below).
|
Template triggers work by evaluating a [template](/docs/configuration/templating/) on every state change for all of the recognized entities. The trigger will fire if the state change caused the template to render 'true'. This is achieved by having the template result in a true boolean expression (`{% raw %}{{ is_state('device_tracker.paulus', 'home') }}{% endraw %}`) or by having the template render 'true' (example below). Being a boolean expression the template must evaluate to false before it will fire again.
|
||||||
With template triggers you can also evaluate attribute changes by using is_state_attr (`{% raw %}{{ is_state_attr('climate.living_room', 'away_mode', 'off') }}{% endraw %}`)
|
With template triggers you can also evaluate attribute changes by using is_state_attr (`{% raw %}{{ is_state_attr('climate.living_room', 'away_mode', 'off') }}{% endraw %}`)
|
||||||
|
|
||||||
{% raw %}
|
{% raw %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user