From e4dade1b295cbdcb9d5819e14e509405ae286460 Mon Sep 17 00:00:00 2001 From: David Beitey Date: Wed, 14 Jul 2021 18:37:19 +1000 Subject: [PATCH] Document automation trigger ID template variables (#18497) This documents the trigger IDs and index variables available in trigger_data for all trigger platforms (https://github.com/home-assistant/core/blob/master/homeassistant/helpers/trigger.py#L79) which was mentioned in the [2021.7 release notes](https://www.home-assistant.io/blog/2021/07/07/release-20217/#trigger-conditions-and-trigger-ids). --- source/_docs/automation/templating.markdown | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/_docs/automation/templating.markdown b/source/_docs/automation/templating.markdown index 937aa423b91..6f1d89e1ab6 100644 --- a/source/_docs/automation/templating.markdown +++ b/source/_docs/automation/templating.markdown @@ -9,6 +9,15 @@ Automations support [templating](/docs/configuration/templating/) in the same wa The following tables show the available trigger data per platform. +### All + +The following describes trigger data associated with all platforms. + +| Template variable | Data | +| ---- | ---- | +| `trigger.id` | Optional trigger `id`, or index of the trigger. +| `trigger.idx` | Index of the trigger. + ### Event | Template variable | Data | @@ -113,12 +122,15 @@ automation: trigger: - platform: state entity_id: device_tracker.paulus + id: paulus_device action: - service: notify.notify data: message: > Paulus just changed from {{ trigger.from_state.state }} to {{ trigger.to_state.state }} + + This was triggered by {{ trigger.id }} automation 2: trigger: