本帖最后由 情非殇 于 2019-2-8 17:04 编辑
#自动化配置
automation:
- alias: test1_dc1
trigger:
platform: numeric_state
entity_id: switch.dc1_shufang
value_template: '{{ state.attributes.p }}'
above: 50 ##功率高于50
for:
seconds: 2 ##等待2秒
condition:
## 如果2或者3是关闭状态
condition: or
conditions:
- condition: state
entity_id: switch.dc1_shufang_s3
state: 'off'
- condition: state
entity_id: switch.dc1_shufang_s3
state: 'off'
action:
## 打开2和3开关
ervice: switch.turn_on
entity_id:
- switch.dc1_shufang_s2
- switch.dc1_shufang_s3
- alias: test2_dc1
trigger:
platform: numeric_state
entity_id: switch.dc1_shufang
value_template: '{{ state.attributes.p }}'
below: 50 ##功率低于50
for:
seconds: 2 ##等待2秒
condition:
## 如果2或者3是打开状态
condition: or
conditions:
- condition: state
entity_id: switch.dc1_shufang_s3
state: 'on'
- condition: state
entity_id: switch.dc1_shufang_s3
state: 'on'
action:
## 关闭2和3开关
ervice: switch.turn_off
entity_id:
- switch.dc1_shufang_s2
- switch.dc1_shufang_s3
|