Add automation example with templating (#4066)
* Add automation example with templating * Fix escaping
This commit is contained in:
parent
1396b6410f
commit
1ef64b2cc5
1 changed files with 17 additions and 0 deletions
|
@ -12,6 +12,7 @@ redirect_from: /getting-started/automation-examples/
|
||||||
|
|
||||||
Just some sample automation rules to get you started.
|
Just some sample automation rules to get you started.
|
||||||
|
|
||||||
|
{% raw %}
|
||||||
```yaml
|
```yaml
|
||||||
# Example of entry in configuration.yaml
|
# Example of entry in configuration.yaml
|
||||||
automation:
|
automation:
|
||||||
|
@ -64,4 +65,20 @@ automation:
|
||||||
service: notify.notify
|
service: notify.notify
|
||||||
data:
|
data:
|
||||||
message: 'Paulus left the house'
|
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 %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue