本帖最后由 ptlzx 于 2018-12-30 17:40 编辑
HA版本0.84.6
以前用如下代码正常的,现在新版的就失效了:
- alias: switch.sonoff_4_on
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d00016db923
from: 'off'
to: 'on'
condition:
condition: and
conditions:
- condition: state
entity_id: sun.sun
state: "below_horizon"
- condition: time
after: '17:00:00'
before: '05:00:00'
action:
- service: switch.turn_on
entity_id: switch.sonoff_4
用UI设置自动化代码,也一样没有效果:
- id: 600ce25b2bd94bf5b533b8dee0127d6d
alias: switch.sonoff_4_on
trigger:
- entity_id: binary_sensor.motion_sensor_158d00016db923
from: 'off'
platform: state
to: 'on'
condition:
- after: '17:00:00'
before: 05:00:00
condition: time
action:
- data:
entity_id:
- switch.sonoff_4
service: switch.turn_on
|