mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 17:27:19 +00:00
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:
parent
7ed24693fc
commit
ee87edc6bf
@ -79,3 +79,19 @@ action:
|
|||||||
- service: homeassistant.turn_off
|
- service: homeassistant.turn_off
|
||||||
entity_id: switch.vision_zm1601eu5_battery_operated_siren_switch_9_0
|
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 %}
|
||||||
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user