Move escaping

This commit is contained in:
Fabian Affolter 2017-11-28 20:41:36 +01:00
parent 20c74bea55
commit a3a19f3089
No known key found for this signature in database
GPG Key ID: DDF3D6F44AAB1336

View File

@ -64,6 +64,7 @@ Choose "Webhooks" as service.
You need to setup a unique trigger for each event you sent to IFTTT.
</p>
{% raw %}
```yaml
# Example configuration.yaml Automation entry
automation:
@ -75,9 +76,11 @@ automation:
service: ifttt.trigger
data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
```
{% endraw %}
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.
{% raw %}
```yaml
# Example configuration.yaml Automation entry
automation:
@ -89,17 +92,20 @@ automation:
service: script.ifttt_notify
data_template:
value1: 'HA Status:'
value2: {% raw %}"{{ trigger.event.data.entity_id.split('_')[1] }} is "{% endraw %}
value3: {% raw %}"{{ trigger.event.data.to_state.state }}"{% endraw %}
value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is "
value3: "{{ trigger.event.data.to_state.state }}"
```
{% endraw %}
{% raw %}
```yaml
#Example Script to send TestHA_Trigger to IFTTT but with some other data (homeassistant UP).
ifttt_notify:
sequence:
- service: ifttt.trigger
data_template: {"event":"TestHA_Trigger", "value1":"{% raw %}{{ value1 }}{% endraw %}", "value2":"{% raw %}{{ value2 }}{% endraw %}", "value3":"{% raw %}{{ value3 }}{% endraw %}"}
data_template: {"event":"TestHA_Trigger", "value1":"{{ value1 }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"}
```
{% endraw %}
### {% linkable_title Sending events from IFTTT to Home Assistant %}