Skip to content

Commit a3a19f3

Browse files
committed
Move escaping
1 parent 20c74be commit a3a19f3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

source/_components/ifttt.markdown

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Choose "Webhooks" as service.
6464
You need to setup a unique trigger for each event you sent to IFTTT.
6565
</p>
6666

67+
{% raw %}
6768
```yaml
6869
# Example configuration.yaml Automation entry
6970
automation:
@@ -75,9 +76,11 @@ automation:
7576
service: ifttt.trigger
7677
data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
7778
```
79+
{% endraw %}
7880

7981
IFTTT can also be used in scripts and with `data_template`. Here is the above automation broken into an automation and script using variables and data_templates.
8082

83+
{% raw %}
8184
```yaml
8285
# Example configuration.yaml Automation entry
8386
automation:
@@ -89,17 +92,20 @@ automation:
8992
service: script.ifttt_notify
9093
data_template:
9194
value1: 'HA Status:'
92-
value2: {% raw %}"{{ trigger.event.data.entity_id.split('_')[1] }} is "{% endraw %}
93-
value3: {% raw %}"{{ trigger.event.data.to_state.state }}"{% endraw %}
95+
value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is "
96+
value3: "{{ trigger.event.data.to_state.state }}"
9497
```
98+
{% endraw %}
9599

100+
{% raw %}
96101
```yaml
97102
#Example Script to send TestHA_Trigger to IFTTT but with some other data (homeassistant UP).
98103
ifttt_notify:
99104
sequence:
100105
- service: ifttt.trigger
101-
data_template: {"event":"TestHA_Trigger", "value1":"{% raw %}{{ value1 }}{% endraw %}", "value2":"{% raw %}{{ value2 }}{% endraw %}", "value3":"{% raw %}{{ value3 }}{% endraw %}"}
106+
data_template: {"event":"TestHA_Trigger", "value1":"{{ value1 }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"}
102107
```
108+
{% endraw %}
103109

104110
### {% linkable_title Sending events from IFTTT to Home Assistant %}
105111

0 commit comments

Comments
 (0)