#洗手台距离感应低于70打开洗手台柜灯#
- id: xishoutai_balcony_down_auto_on
alias: xishoutai_balcony_down_auto_on
trigger:
- platform: numeric_state
entity_id: sensor.sonoff_ultrasonic_distance
below: 70
action:
service: light.turn_on
entity_id: light.xishoutai_balcony_down
#洗手台距离感应高于130超过1分钟关闭洗手台柜灯#
- id: xishoutai_balcony_down_auto_off
alias: xishoutai_balcony_down_auto_off
trigger:
- platform: numeric_state
entity_id: sensor.sonoff_ultrasonic_distance
above: 130
for:
minutes: 1
action:
service: light.turn_off
entity_id: light.xishoutai_balcony_down
用的SR04做距离判断,可以自动开灯,但是关灯的自动化怎么也触发不了。不知道哪里做错了。求大神指教
|