mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-13 20:36:52 +00:00
Document merging lists of triggers (#34404)
* Update trigger.markdown * Update trigger.markdown * use new caution flags * Update trigger.markdown
This commit is contained in:
parent
0d1beaf273
commit
06ff6e1387
@ -31,6 +31,8 @@ An {% term automation %} can be triggered by an {% term event %}, a certain {% t
|
||||
- [Sentence trigger](#sentence-trigger)
|
||||
- [Multiple triggers](#multiple-triggers)
|
||||
- [Multiple Entity IDs for the same Trigger](#multiple-entity-ids-for-the-same-trigger)
|
||||
- [Disabling a trigger](#disabling-a-trigger)
|
||||
- [Merging lists of triggers](#merging-lists-of-triggers)
|
||||
|
||||
## Trigger ID
|
||||
|
||||
@ -1045,3 +1047,28 @@ blueprint:
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
## Merging lists of triggers
|
||||
|
||||
{% caution %}
|
||||
This feature requires Home Assistant version 2024.10 or later. If using this in a blueprint, set the `min_version` for the blueprint to at least this version.
|
||||
{% endcaution %}
|
||||
|
||||
In some advanced cases (like for blueprints with trigger selectors), it may be necessary to insert a second list of triggers into the main trigger list. This can be done by adding a dictionary in the main trigger list with the sole key `triggers`, and the value for that key contains a second list of triggers. These will then be flattened into a single list of triggers. For example:
|
||||
|
||||
```yaml
|
||||
blueprint:
|
||||
name: Nested Trigger Blueprint
|
||||
domain: automation
|
||||
input:
|
||||
usertrigger:
|
||||
selector:
|
||||
trigger:
|
||||
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: manual_event
|
||||
- triggers: !input usertrigger
|
||||
```
|
||||
|
||||
This blueprint automation can then be triggered either by the fixed manual_event trigger, or additionally by any triggers selected in the trigger selector. This is also applicable for `wait_for_trigger` action.
|
||||
|
Loading…
x
Reference in New Issue
Block a user