11월 28일 진행사항 - sunbang123/Graduation_Project GitHub Wiki

UI

image
  • UI 구성 완료

진행사항

  • 모션센서 실습
    • 커튼 (올리기/내리기)
  • 전등 실습
    • RGB LED (침실 무드등)
    • LED 2개 (거실 전등)
  • LCD 실습
sensor1128.mp4

ESPHOME YAML

dashboard_import:
  package_import_url: github://esphome/example-configs/esphome-web/esp32.yaml@main
  import_full_config: true

esp32_improv:
  authorizer: none

# 모든 output 설정
output:
  # 침실 RGB LED
  - platform: ledc
    pin: GPIO25
    id: rgb_red
    inverted: true
  - platform: ledc
    pin: GPIO26
    id: rgb_green
    inverted: true
  - platform: ledc
    pin: GPIO27
    id: rgb_blue
    inverted: true
    
  # 복도 쿨링모터
  - platform: ledc
    id: cooling_motor
    pin: GPIO32
    
  # 부엌 RGB LED
  - platform: ledc
    pin: GPIO12
    id: stove_red
  - platform: ledc
    pin: GPIO13
    id: stove_green
  - platform: ledc
    pin: GPIO14
    id: stove_blue
    
  # 창문 서보모터
  - platform: ledc
    id: servo_output
    pin: GPIO33
    frequency: 50 Hz

  # 거실 LED 추가
  - platform: ledc
    pin: GPIO18
    id: living_room_led1
  - platform: ledc
    pin: GPIO19
    id: living_room_led2
  - platform: ledc
    pin: GPIO23
    id: living_room_led3

# I2C 설정
i2c:
  sda: GPIO21
  scl: GPIO22
  scan: true

# UART 설정 (PMS5003용)
uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 9600

# 조명 설정
light:
  - platform: rgb
    name: "Bedroom RGB Light"
    red: rgb_red
    green: rgb_green
    blue: rgb_blue
    
  - platform: rgb
    name: "Kitchen Stove Indicator"
    red: stove_red
    green: stove_green
    blue: stove_blue

  # 거실 LED 조명 추가
  - platform: monochromatic
    output: living_room_led1
    name: "Living Room Light 1"
    
  - platform: monochromatic
    output: living_room_led2
    name: "Living Room Light 2"
    
  - platform: monochromatic
    output: living_room_led3
    name: "Living Room Light 3"

# 팬 설정
fan:
  - platform: speed
    output: cooling_motor
    name: "Hallway Cooling Fan"

# 센서 설정
sensor:
  # PMS5003 미세먼지 센서 
  - platform: pmsx003
    type: PMS5003S
    pm_2_5:
      name: "Hallway PM2.5"
    pm_10_0:
      name: "Hallway PM10"
    update_interval: 30s
  
  # DHT 센서
  - platform: dht
    pin: GPIO4
    temperature:
      name: "Hallway Temperature"
    humidity:
      name: "Hallway Humidity"
    update_interval: 60s
  
  # 조도센서
  - platform: adc
    pin: GPIO36
    name: "Living Room Light Level"
    update_interval: 60s

# LCD 디스플레이
display:
  - platform: lcd_pcf8574
    dimensions: 16x2
    address: 0x27
    lambda: |-
      it.printf(0, 0, "Hello World!");
      it.printf(0, 1, "ESPHome!");

# 서보모터 설정
servo:
  - id: window_servo
    output: servo_output
    min_level: 3%
    max_level: 12%

# 버튼 추가로 제어하기
button:
  - platform: template
    name: "Window Open"
    on_press:
      - servo.write:
          id: window_servo
          level: 1.0
          
  - platform: template
    name: "Window Close"
    on_press:
      - servo.write:
          id: window_servo
          level: 0.0
          
  - platform: template
    name: "Window Half"
    on_press:
      - servo.write:
          id: window_servo
          level: 0.5

# 모션센서 설정
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
    name: "Entrance Motion Sensor"
    device_class: motion
⚠️ **GitHub.com Fallback** ⚠️