注意,测试环境条件,是按当前环境状态作为测试条件的,比如你的环境条件是8-11点,但你点击测试的时间是11:01分或更迟,那么肯定会返回不满足环境条件
不执行也可以检查一下触发条件,可以参考:
trigger:
- platform: numeric_state
entity_id: sensor.####################_temperature
above: 34
condition:
- condition: time
after: "08:00:00"
before: "11:00:00"
action:
- service: fan.turn_on
data: {}
target:
entity_id: fan.##################
或者干脆用自定义模板作为触发条件,这样也包括满足时间条件了
{{ states('sensor.####################_temperature') |int >= 35 and today_at('8:00') <now() <today_at('11:00')}}
|