From 3daa8c815d14d20f1c844549c5e45d5f8f6018af Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Thu, 25 Jan 2018 18:16:46 -0500 Subject: [PATCH] Update scripts.markdown --- source/_docs/scripts.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/_docs/scripts.markdown b/source/_docs/scripts.markdown index ff74d5f12d7..e66b326c86e 100644 --- a/source/_docs/scripts.markdown +++ b/source/_docs/scripts.markdown @@ -136,12 +136,12 @@ The following automation shows how to raise a custom event called `event_light_t - alias: Fire Event trigger: platform: state - entity_id: light.kitchen + entity_id: switch.kitchen to: 'on' action: - event: event_light_turned_on + event: event_light_state_changed event_data: - entity_id: "{{ trigger.entity_id }}" + state: "on" ``` {% endraw %} @@ -152,11 +152,11 @@ The following automation shows how to capture the custom event `event_light_turn - alias: Capture Event trigger: platform: event - event_type: light_turned_on + event_type: event_light_state_changed action: - service: notify.notify data_template: - message: "{{ trigger.event.data.entity_id }} is turned on." + message: "kitchen light is turned {{ trigger.event.data.state }}" ``` {% endraw %}