最近在研究home assistant自动化的编写,本文将不断的更新,汇集常见的条件和触发器
condition: template
value_template: >-
{{ as_timestamp(now()) -
as_timestamp(state_attr('binary_sensor.68abbc58bd0e_motion',
'last_triggered')) > 300 }}
alias: 桌面夜灯300秒无动作
代码以template添加:
condition: template
value_template: "{{ now().weekday() in (0,1,2,3,4) }}"
alias: 周一至周五