Skip to content

Commit 3daa8c8

Browse files
authored
Update scripts.markdown
1 parent 9447693 commit 3daa8c8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

source/_docs/scripts.markdown

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ The following automation shows how to raise a custom event called `event_light_t
136136
- alias: Fire Event
137137
trigger:
138138
platform: state
139-
entity_id: light.kitchen
139+
entity_id: switch.kitchen
140140
to: 'on'
141141
action:
142-
event: event_light_turned_on
142+
event: event_light_state_changed
143143
event_data:
144-
entity_id: "{{ trigger.entity_id }}"
144+
state: "on"
145145
```
146146
{% endraw %}
147147

@@ -152,11 +152,11 @@ The following automation shows how to capture the custom event `event_light_turn
152152
- alias: Capture Event
153153
trigger:
154154
platform: event
155-
event_type: light_turned_on
155+
event_type: event_light_state_changed
156156
action:
157157
- service: notify.notify
158158
data_template:
159-
message: "{{ trigger.event.data.entity_id }} is turned on."
159+
message: "kitchen light is turned {{ trigger.event.data.state }}"
160160
```
161161
{% endraw %}
162162

0 commit comments

Comments
 (0)