本帖最后由 情非殇 于 2019-7-14 13:23 编辑
简单,我给你写一下,有能力的话,还是刷三木大佬的esphome固件比较舒服
automation:
## 如果任何s123中任何一个开关关闭,判断是否123都为off,如果是的话关闭总开
- alias: test1
trigger:
- platform: state
entity_id: switch.s1
to: 'off'
- platform: state
entity_id: switch.s2
to: 'off'
- platform: state
entity_id: switch.s3
to: 'off'
condition:
condition: and
conditions:
- condition: state
entity_id: switch.s1
state: 'off'
- condition: state
entity_id: switch.s2
state: 'off'
- condition: state
entity_id: switch.s3
state: 'off'
action:
- service: switch.turn_off
entity_id: switch.总
|