From 1ef64b2cc5c52c3cc64d46d8a42f711e7b3a5755 Mon Sep 17 00:00:00 2001 From: David De Sloovere Date: Sat, 25 Nov 2017 23:39:23 +0100 Subject: [PATCH] Add automation example with templating (#4066) * Add automation example with templating * Fix escaping --- source/_docs/automation/examples.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/_docs/automation/examples.markdown b/source/_docs/automation/examples.markdown index a1eb7ddfae7..9e28e0b3e76 100644 --- a/source/_docs/automation/examples.markdown +++ b/source/_docs/automation/examples.markdown @@ -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 %}