本帖最后由 roffee 于 2021-11-8 21:52 编辑
sensor:
- platform: vl53l0x
name: "Sensor 1"
id: sens_1
update_interval: 350ms
long_range: true
on_value:
then:
- if:
condition:
binary_sensor.is_off: toilet_status
then:
- if:
condition:
for:
time: 12s
condition:
lambda: 'return id(sens_1).state < 0.68f;'
then:
- wait_until:
for:
time: 2s
condition:
lambda: 'return id(sens_1).state > 0.68f;'
- switch.turn_on: water_open
- delay: 4s
- switch.turn_off: water_open
- delay: 1s
- switch.turn_on: water_close
- delay: 6s
- switch.turn_off: water_close
我说one item里面有2个actions,所以出错,单看了一下是嵌套的if语句,为啥错了呢? |