本帖最后由 Clark 于 2022-3-26 21:02 编辑
需求很简单,小米无线开关按键触发,然后检查两个灯状态,如果都是关闭状态,则将两个灯全部开启。
如果两个灯有任何一个是开启状态,则两个灯全部关闭。
结果关闭灯的自动化没问题,但是无法打开灯。
automations代码分别如下,没看出哪里有问题或者冲突。
id: '1648213077779'
alias: 小米无线开关三击打开三楼大房间灯
description: ''
trigger:
- platform: state
entity_id: sensor.0x00158d00056a80cb_action
to: triple
condition:
- condition: device
type: is_off
device_id: 27ae080a7bf11b016291ed0234a52fcc
entity_id: switch.b460edcece0d_switch
domain: switch
- condition: device
type: is_off
device_id: 1088bfcfe5d491892d345c3b090f8258
entity_id: switch.dwdz_sw0a01_bdb8
domain: switch
action:
- type: turn_on
device_id: abf0175db9f56d53187c594a6a91d403
entity_id: switch.er_hao_dong_dian_pu_deng_switch
domain: switch
- type: turn_on
device_id: 1088bfcfe5d491892d345c3b090f8258
entity_id: switch.dwdz_sw0a01_bdb8
domain: switch
mode: single
id: '1648212850684'
alias: 小米无线开关三击关闭三楼大房间灯
description: ''
trigger:
- platform: state
entity_id: sensor.0x00158d00056a80cb_action
to: triple
condition:
- condition: state
entity_id: switch.er_hao_dong_dian_pu_deng_switch
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: switch.dwdz_sw0a01_bdb8
state: 'on'
action:
- type: turn_off
device_id: abf0175db9f56d53187c594a6a91d403
entity_id: switch.er_hao_dong_dian_pu_deng_switch
domain: switch
- type: turn_off
device_id: 1088bfcfe5d491892d345c3b090f8258
entity_id: switch.dwdz_sw0a01_bdb8
domain: switch
mode: single
最后两个自动化改成了三个自动化流程,虽然能够解决问题了,但是总觉得以上方案也没有问题。
|