- alias: automation04_01
id: 厨房有人→打开厨房灯
initial_state: 'true'
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_kitchen
from: 'off'
to: 'on'
condition: []
action:
- service: homeassistant.turn_on
data:
entity_id: light.light_kitchen
- alias: automation04_02
id: 厨房没人→延时3分钟关闭厨房灯
initial_state: 'true'
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_kitchen
from: 'on'
to: 'off'
for: 00:03:00
condition:
- condition: state
entity_id: binary_sensor.motion_sensor_kitchen
state: 'off'
action:
- service: homeassistant.turn_off
data:
entity_id: light.light_kitchen
|