本帖最后由 南柯醉一梦丶 于 2017-10-17 17:01 编辑
精简版
- alias: switch sync
initial_state: false
trigger:
platform: state
entity_id: switch.xxx, switch.yyy
action:
service_template: "switch.turn_{{ 'on' if trigger.to_state.state == 'on' else 'off' }}"
data_template:
entity_id: "switch.{{ 'yyy' if trigger.entity_id == 'switch.xxx' else 'xxx' }}"
|