Add automation example with templating (#4066)

* Add automation example with templating

* Fix escaping
This commit is contained in:
David De Sloovere 2017-11-25 23:39:23 +01:00 committed by Fabian Affolter
parent 1396b6410f
commit 1ef64b2cc5

View File

@ -12,6 +12,7 @@ redirect_from: /getting-started/automation-examples/
Just some sample automation rules to get you started.
{% raw %}
```yaml
# Example of entry in configuration.yaml
automation:
@ -64,4 +65,20 @@ automation:
service: notify.notify
data:
message: 'Paulus left the house'
# Send a notification via Pushover with the event of a Xiaomi cube. Custom event from the Xiaomi component.
- alias: 'Xiaomi Cube Action'
hide_entity: false
initial_state: false
trigger:
platform: event
event_type: cube_action
event_data:
entity_id: binary_sensor.cube_158d000103a3de
action:
- service_template: notify.pushover
data_template:
title: "Cube event detected"
message: "Cube has triggered this event: {{ trigger.event }}"
```
{% endraw %}