mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 13:56:53 +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.
|
You need to setup a unique trigger for each event you sent to IFTTT.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml Automation entry
|
# Example configuration.yaml Automation entry
|
||||||
automation:
|
automation:
|
||||||
@ -75,9 +76,11 @@ automation:
|
|||||||
service: ifttt.trigger
|
service: ifttt.trigger
|
||||||
data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
|
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.
|
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
|
```yaml
|
||||||
# Example configuration.yaml Automation entry
|
# Example configuration.yaml Automation entry
|
||||||
automation:
|
automation:
|
||||||
@ -89,17 +92,20 @@ automation:
|
|||||||
service: script.ifttt_notify
|
service: script.ifttt_notify
|
||||||
data_template:
|
data_template:
|
||||||
value1: 'HA Status:'
|
value1: 'HA Status:'
|
||||||
value2: {% raw %}"{{ trigger.event.data.entity_id.split('_')[1] }} is "{% endraw %}
|
value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is "
|
||||||
value3: {% raw %}"{{ trigger.event.data.to_state.state }}"{% endraw %}
|
value3: "{{ trigger.event.data.to_state.state }}"
|
||||||
```
|
```
|
||||||
|
{% endraw %}
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
#Example Script to send TestHA_Trigger to IFTTT but with some other data (homeassistant UP).
|
#Example Script to send TestHA_Trigger to IFTTT but with some other data (homeassistant UP).
|
||||||
ifttt_notify:
|
ifttt_notify:
|
||||||
sequence:
|
sequence:
|
||||||
- service: ifttt.trigger
|
- 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 %}
|
### {% linkable_title Sending events from IFTTT to Home Assistant %}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user