도어가 하나라도 열려 있으면 점등.
모든 도어가 닫혀을 때만 소등되는 자동화.
esp32보드의 상태led를 알림등으로 사용중.
- id: 알림-도어열림
alias: 알림-도어열림
trigger:
- entity_id: binary_sensor.0x00158d00035c69c9_contact
platform: state
to:
- 'on'
- 'off'
- entity_id: binary_sensor.0x00158d00035c6970_contact
platform: state
to:
- 'on'
- 'off'
- entity_id: binary_sensor.0x00158d0003ced153_contact
platform: state
to:
- 'on'
- 'off'
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.to_state.state == ''on'' }}'
sequence:
- entity_id: light.esp32_sb
service: light.turn_on
- conditions:
- condition: state
entity_id: binary_sensor.0x00158d00035c69c9_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00158d00035c6970_contact
state: 'off'
- condition: state
entity_id: binary_sensor.0x00158d0003ced153_contact
state: 'off'
sequence:
- entity_id: light.esp32_sb
service: light.turn_off
mode: single