You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Triggers are what starts the processing of an automation rule. It is possible to specify [multiple triggers](/docs/automation/trigger/#multiple-triggers) for the same rule - when _any_ of the triggers becomes true then the automation will start. Once a trigger starts, Home Assistant will validate the conditions, if any, and call the action.
7
+
### What are triggers
8
+
Triggers are what starts the processing of an automation rule. When _any_ of the automation's triggers becomes true (trigger _fires_), Home Assistant will validate the [conditions](/docs/automation/condition/), if any, and call the [action](/docs/automation/action/).
8
9
9
10
### Event trigger
10
11
11
-
Triggers when an event is being processed. Events are the raw building blocks of Home Assistant. You can match events on just the event name or also require specific event data to be present.
12
+
Fires when an event is being received. Events are the raw building blocks of Home Assistant. You can match events on just the event name or also require specific event data to be present.
12
13
13
14
Events can be fired by integrations or via the API. There is no limitation to the types. A list of built-in events can be found [here](/docs/configuration/events/).
14
15
@@ -24,7 +25,7 @@ automation:
24
25
25
26
### Home Assistant trigger
26
27
27
-
Triggers when Home Assistant starts up or shuts down.
28
+
Fires when Home Assistant starts up or shuts down.
28
29
29
30
```yaml
30
31
automation:
@@ -36,7 +37,7 @@ automation:
36
37
37
38
### MQTT trigger
38
39
39
-
Triggers when a specific message is received on given topic. Optionally can match on the payload being sent over the topic. The default payload encoding is 'utf-8'. For images and other byte payloads use `encoding: ''` to disable payload decoding completely.
40
+
Fires when a specific message is received on given MQTT topic. Optionally can match on the payload being sent over the topic. The default payload encoding is 'utf-8'. For images and other byte payloads use `encoding: ''` to disable payload decoding completely.
40
41
41
42
```yaml
42
43
automation:
@@ -50,7 +51,7 @@ automation:
50
51
51
52
### Numeric state trigger
52
53
53
-
Triggers when numeric value of an entity's state crosses a given threshold. On state change of a specified entity, attempts to parse the state as a number and triggers once if value is changing from above to below or from below to above the given threshold.
54
+
Fires when numeric value of an entity's state crosses a given threshold. On state change of a specified entity, attempts to parse the state as a number and fires if value is changing from above to below or from below to above the given threshold.
54
55
55
56
{% raw %}
56
57
@@ -76,7 +77,7 @@ automation:
76
77
77
78
<div class='note'>
78
79
Listing above and below together means the numeric_state has to be between the two values.
79
-
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.
80
+
In the example above, the trigger would fire if a numeric_state goes to 17.1-24.9 (from 17 or below, or 25 or above).
80
81
</div>
81
82
82
83
The `for:` can also be specified as `HH:MM:SS` like this:
@@ -128,7 +129,7 @@ The `for` template(s) will be evaluated when an entity changes as specified.
128
129
129
130
### State trigger
130
131
131
-
Triggers when the state of any of given entities changes. If only `entity_id` is given trigger will activate for all state changes, even if only state attributes change.
132
+
Fires when the state of any of given entities changes. If only `entity_id` is given trigger will fire for all state changes, even if only state attributes change.
132
133
133
134
<div class='note'>
134
135
@@ -182,9 +183,9 @@ Use quotes around your values for `from` and `to` to avoid the YAML parser inter
182
183
183
184
#### Sunset / Sunrise trigger
184
185
185
-
Triggers when the sun is setting or rising, i.e., when the sun elevation reaches 0°.
186
+
Fires when the sun is setting or rising, i.e., when the sun elevation reaches 0°.
186
187
187
-
An optional time offset can be given to have it trigger a set time before or after the sun event (e.g., 45 minutes before sunset).
188
+
An optional time offset can be given to have it fire a set time before or after the sun event (e.g., 45 minutes before sunset).
188
189
189
190
<div class='note'>
190
191
@@ -206,7 +207,7 @@ automation:
206
207
207
208
#### Sun elevation trigger
208
209
209
-
Sometimes you may want more granular control over an automation than simply sunset or sunrise and specify an exact elevation of the sun. This can be used to layer automations to occur as the sun lowers on the horizon or even after it is below the horizon. This is also useful when the "sunset" event is not dark enough outside and you would like the automation to run later at a precise solar angle instead of the time offset such as turning on exterior lighting. For most things intended to trigger during dusk or dawn, a number between 0° and -6° is suitable; -4° is used in this example:
210
+
Sometimes you may want more granular control over an automation than simply sunset or sunrise and specify an exact elevation of the sun. This can be used to layer automations to occur as the sun lowers on the horizon or even after it is below the horizon. This is also useful when the "sunset" event is not dark enough outside and you would like the automation to run later at a precise solar angle instead of the time offset such as turning on exterior lighting. For most automations intended to run during dusk or dawn, a number between 0° and -6° is suitable; -4° is used in this example:
210
211
211
212
{% raw %}
212
213
@@ -241,7 +242,7 @@ A very thorough explanation of this is available in the Wikipedia article about
241
242
242
243
### Template trigger
243
244
244
-
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 (or anything other than true) before it will fire again.
245
+
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 (or anything other than true) before the trigger will fire again.
245
246
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 %}`)
246
247
247
248
{% raw %}
@@ -276,7 +277,7 @@ automation:
276
277
The `for` template(s) will be evaluated when the `value_template` becomes `true`.
277
278
278
279
<div class='note warning'>
279
-
Rendering templates with time (`now()`) is dangerous as trigger templates only update based on entity state changes.
280
+
Rendering templates with time (`now()`) is dangerous as trigger templates are only updated based on entity state changes.
280
281
</div>
281
282
282
283
@@ -297,7 +298,7 @@ which will evaluate to `True` if `YOUR.ENTITY` changed more than 300 seconds ago
297
298
298
299
### Time trigger
299
300
300
-
The time trigger is configured to run once at a specific point in time each day.
301
+
The time trigger is configured to fire once at a specific point in time each day.
301
302
302
303
```yaml
303
304
automation:
@@ -340,7 +341,7 @@ Do not prefix numbers with a zero - using `'00'` instead of '0' for example will
340
341
341
342
### Webhook trigger
342
343
343
-
Webhook triggers are triggered by web requests made to the webhook endpoint: `/api/webhook/<webhook_id>`. This endpoint does not require authentication besides knowing the webhook id. You can either send encoded form or JSON data, available in the template as either `trigger.json` or `trigger.data`. URL query parameters are available in the template as `trigger.query`.
344
+
Webhook trigger fires when a web request is made to the webhook endpoint: `/api/webhook/<webhook_id>`. This endpoint does not require authentication besides knowing the webhook id. You can either send encoded form or JSON data, available in the template as either `trigger.json` or `trigger.data`. URL query parameters are available in the template as `trigger.query`.
344
345
345
346
```yaml
346
347
automation:
@@ -349,11 +350,11 @@ automation:
349
350
webhook_id: some_hook_id
350
351
```
351
352
352
-
You could test triggering the above automation by sending a POST HTTP request to `http://your-home-assistant:8123/api/webhook/some_hook_id`. An example with no data sent to a SSL/TLS secured installation and using the command-line curl program is `curl -d "" https://your-home-assistant:8123/api/webhook/some_hook_id`.
353
+
You could run the above automation by sending a POST HTTP request to `http://your-home-assistant:8123/api/webhook/some_hook_id`. An example with no data sent to a SSL/TLS secured installation and using the command-line curl program is `curl -d "" https://your-home-assistant:8123/api/webhook/some_hook_id`.
353
354
354
355
### Zone trigger
355
356
356
-
Zone triggers can trigger when an entity is entering or leaving the zone. For zone automation to work, you need to have setup a device tracker platform that supports reporting GPS coordinates. This includes [GPS Logger](/integrations/gpslogger/), the [OwnTracks platform](/integrations/owntracks/) and the [iCloud platform](/integrations/icloud/).
357
+
Zone trigger fires when an entity is entering or leaving the zone. For zone automation to work, you need to have setup a device tracker platform that supports reporting GPS coordinates. This includes [GPS Logger](/integrations/gpslogger/), the [OwnTracks platform](/integrations/owntracks/) and the [iCloud platform](/integrations/icloud/).
357
358
358
359
```yaml
359
360
automation:
@@ -367,8 +368,8 @@ automation:
367
368
368
369
### Geolocation trigger
369
370
370
-
Geolocation triggers can trigger when an entity is appearing in or disappearing from a zone. Entities that are created by a [Geolocation](/integrations/geo_location/) platform support reporting GPS coordinates.
371
-
Because entities are generated and removed by these platforms automatically, the entity id normally cannot be predicted. Instead, this trigger requires the definition of a `source` which is directly linked to one of the Geolocation platforms.
371
+
Geolocation trigger fires when an entity is appearing in or disappearing from a zone. Entities that are created by a [Geolocation](/integrations/geo_location/) platform support reporting GPS coordinates.
372
+
Because entities are generated and removed by these platforms automatically, the entity id normally cannot be predicted. Instead, this trigger requires the definition of a `source`, which is directly linked to one of the Geolocation platforms.
372
373
373
374
```yaml
374
375
automation:
@@ -382,7 +383,7 @@ automation:
382
383
383
384
### Multiple triggers
384
385
385
-
When your want your automation rule to have multiple triggers, just prefix the first line of each trigger with a dash (-) and indent the next lines accordingly. Whenever one of the triggers fires, your rule is executed.
386
+
It is possible to specify multiple triggers for the same rule. To do so just prefix the first line of each trigger with a dash (-) and indent the next lines accordingly. Whenever one of the triggers fires, [processing](#what-are-triggers) of your automation rule begins.
0 commit comments