Telegram: example to show the use of event_data (#2550)

* Telegram: example to show the use of event_data

... in the action. (took a while to figure out myself)

* Updated pr to avoid render of the template
This commit is contained in:
Daniel Stone 2017-05-05 05:56:40 +01:00 committed by Paulus Schoutsen
parent 7ed24693fc
commit ee87edc6bf

View File

@ -79,3 +79,19 @@ action:
- service: homeassistant.turn_off
entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0
```
An example to show the use of event_data in the action:
```
- alias: 'Kitchen Telegram Speak'
trigger:
platform: event
event_type: telegram_command
event_data:
command: '/speak'
action:
- service: notify.kitchen_echo
data_template:
message: >
Message from {% raw %}{{ trigger.event.data["from_first"] }}. {% for state in trigger.event.data["args"] %} {{ state }} {% endfor %}{% endraw %}
```