File tree Expand file tree Collapse file tree 1 file changed +15
-30
lines changed Expand file tree Collapse file tree 1 file changed +15
-30
lines changed Original file line number Diff line number Diff line change @@ -16,37 +16,22 @@ This recipe will turn on a light when there is motion and turn off the light whe
16
16
17
17
``` yaml
18
18
automation :
19
- alias : Turn on kitchen lights when there is movement
19
+ - alias : Turn on kitchen light when there is movement
20
20
trigger :
21
- - platform : state
22
- entity_id : sensor.motion_sensor
23
- to : ' on'
21
+ platform : state
22
+ entity_id : sensor.motion_sensor
23
+ to : ' on'
24
24
action :
25
25
service : homeassistant.turn_on
26
- entity_id : script.timed_lamp
26
+ entity_id : light.kitchen
27
27
28
- script :
29
- timed_lamp :
30
- alias : " Turn on lamp and set timer"
31
- sequence :
32
- # Cancel ev. old timers
33
- - service : script.turn_off
34
- data :
35
- entity_id : script.timer_off
36
- - service : light.turn_on
37
- data :
38
- entity_id : light.kitchen
39
- # Set new timer
40
- - service : script.turn_on
41
- data :
42
- entity_id : script.timer_off
43
-
44
- timer_off :
45
- alias : " Turn off lamp after 10 minutes"
46
- sequence :
47
- - delay :
48
- minutes : 10
49
- - service : light.turn_off
50
- data :
51
- entity_id : light.kitchen
52
- ` ` `
28
+ - alias : Turn off kitchen light 10 minutes after last movement
29
+ trigger :
30
+ platform : state
31
+ entity_id : sensor.motion_sensor
32
+ to : ' off'
33
+ for :
34
+ minutes : 10
35
+ action :
36
+ service : homeassistant.turn_off
37
+ entity_id : light.kitchen_light
You can’t perform that action at this time.
0 commit comments