没有现成的语法结构 ,你可以取巧。用两个sciprt 然后配置 delay去实现。但这样的方式很傻。
script:
light_flash:
alias: Light flash on
sequence:
- service: homeassistant.turn_on
data:
entity_id: light.back_porch
- delay:
# time for flash light on
seconds: 1
- service: homeassistant.turn_off
data:
entity_id: light.back_porch
- service: script.turn_on
data:
entity_id: script.light_loop
light_loop:
alias: Light flash loop
sequence:
- delay:
# time for flash light off
seconds: 1
- service: script.turn_on
data:
entity_id: script.light_flash
|