本帖最后由 Aiden1 于 2019-10-16 22:45 编辑
- alias: 'turn_on' //开灯
initial_state: true
trigger:
- platform: state
entity_id: light.A
from: 'off'
to: 'on'
condition:
- condition: state
entity_id: light.B
state: 'off'
action:
- service: light.turn_on
entity_id: light.B
- alias: 'turn_off' //关灯
initial_state: true
trigger:
- platform: state
entity_id: light.A
from: 'on'
to: 'off'
condition:
- condition: state
entity_id: light.B
state: 'on'
action:
- service: light.turn_off
entity_id: light.B
|