# 打开客厅电视机
- id: '1577592703128'
alias: 开客厅电视机
description: 打开客厅电视机
initial_state: true
hide_entity: true
trigger:
- platform: state
entity_id:
- switch.sonoff_1000d05043_1 #开关1
- switch.sonoff_1000d05043_2 #开关2
condition:
condition: and #同时满足如下条件,则开夜灯
conditions:
- condition: state
entity_id: switch.ztc1_2_d0bae4643783 #插座1关
state: 'off'
- condition: state
entity_id: switch.ztc1_6_d0bae4643783 #插座2关
state: 'off'
action:
- service: script.turn_on
data_template:
entity_id: >
{% if is_state('switch.sonoff_1000d05043_1', 'on') and is_state('switch.sonoff_1000d05043_2', 'on') %}
switch.ztc1_2_d0bae4643783
switch.ztc1_6_d0bae4643783
switch.ztc1_5_d0bae4643783
switch.ztc1_4_d0bae4643783
switch.ztc1_3_d0bae4643783
{% endif %}
翻了不少贴子,我的想法是:打开二个开关后,打开多路指定插座。以上设置不起作用,搞了好久,实在不知道怎么写,请教大神指点。先谢过
|