욕실 다운라이트 설치



욕실과 화장실에 다운라이트 설치. 홀쏘(75mm)는 오래전에 준비해뒀고 한달전 다운라이트 도착했는데 미루다 이제 작업.
배선은 스위치에서 땋아 올려보낸 활선과 환풍기의 중성선을 땋아 3구 콘센트에 상시전원이 들어가도록 연결. 환풍기는 스위치에 직결되고 콘센트에는 스마트 플러그를 꽂고 다운라이트와 연결해 플러그로 원격 제어. 

HA 자동화로 새벽 시간(22시-07시) 화장실 이용할 때 약한 빛의 다운라이트만 켜지도록 세팅.
욕실과 화장실 전등스위치는 한번 짧게 누르면 메인등이 켜지고 길게 누르면 다운라이트 켜지도록 ESPHome 펌업.

디밍지원하는 조명과 스위치가 베스트겠지만 저렴한 비용의 다운라이트로 타협. 2.5인치 다운라이트에 75mm 홀은 약간 크고 유격도 좀 있지만 허용범위.



욕실 자동화:
- id: 움직임-욕실on
  alias: 움직임-욕실on
  trigger:
  - platform: state
    entity_id: binary_sensor.ba_door_contact
    to: 'on'
  - platform: state
    entity_id: binary_sensor.ba_motion_occupancy
    from: 'off'
    to: 'on'
  condition:
  - condition: state
    entity_id: light.bathroom_button1
    state: 'off'
  - condition: state
    entity_id: binary_sensor.ba_door_contact
    state: 'on'
  action:
    - choose:
      - conditions:
        - condition: time
          after: '22:00'
          before: '07:00'
        sequence:
          - service: homeassistant.turn_on
            entity_id:
              - light.bathroom_downlight
              - switch.bathroom_button2
          - service: timer.cancel
            entity_id: timer.bathroom_button2
      default:
        - service: homeassistant.turn_on
          entity_id:
            - light.bathroom_button1
            - switch.bathroom_button2
        - service: timer.cancel
          entity_id: timer.bathroom_button2
  mode: single