From e48fed44e2ea50f6d7e688d52fb28292953a19cc Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 11 Nov 2020 10:31:55 +0100 Subject: [PATCH] Add missing tag trigger documentation (#15608) --- source/_docs/automation/trigger.markdown | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 68bb4d8298f..c910225550f 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -314,6 +314,37 @@ Although the actual amount of light depends on weather, topography and land cove A very thorough explanation of this is available in the Wikipedia article about the [Twilight](https://en.wikipedia.org/wiki/Twilight). +### Tag trigger + +Fires when a [tag](/integrations/tag) is scanned. For example, a NFC tag is +scanned using the Home Assistant Companion mobile application. + +{% raw %} + +```yaml +automation: + trigger: + platform: tag + tag_id: A7-6B-90-5F +``` + +{% endraw %} + +Additionally, you can also only trigger if a card is scanned by a specific +device/scanner by setting the `device_id`: + +{% raw %} + +```yaml +automation: + trigger: + platform: tag + tag_id: A7-6B-90-5F + device_id: 0e19cd3cf2b311ea88f469a7512c307d +``` + +{% endraw %} + ### 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). Being a boolean expression the template must evaluate to false (or anything other than true) before the trigger will fire again.