mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-15 13:26:54 +00:00
Move escaping
This commit is contained in:
parent
20c74bea55
commit
a3a19f3089
@ -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 %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user