From 0ec95a994a4c53686e5831f09b39f0db1f776b03 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Fri, 26 Feb 2021 10:49:35 +0100 Subject: [PATCH] Fix MQTT trigger value_template example (#16755) --- source/_docs/automation/trigger.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index 6356474ae17..55ee1a5d69d 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -100,6 +100,8 @@ automation: The `payload` option can be combined with a `value_template` to process the message received on the given MQTT topic before matching it with the payload. The trigger in the example below will trigger only when the message received on `living_room/switch/ac` is valid JSON, with a key `state` which has the value `"on"`. +{% raw %} + ```yaml automation: trigger: @@ -109,6 +111,8 @@ automation: value_template: "{{ value_json.state }}" ``` +{% endraw %} + It's also possible to use [limited templates](/docs/configuration/templating/#limited-templates) in the `topic` and `payload` options.