esphome:
  name: airterk-intake
  friendly_name: "Airterk intake"
  project: 
    name: "smartlab.airterk"
    version: 0.0.1

esp8266:
  board: esp01_1m

# Enable logging
logger:
  level: VERBOSE

uart:
  baud_rate: 9600
  tx_pin: GPIO2
  rx_pin: GPIO13

web_server:
  port: 8088
  auth: 
    username: admin
    password: "@dmin321"

# Enable Home Assistant API
api:
  encryption:
    key: "gp4FkogEnYtH5VHEdetTpCoPR6y9i++aZIxnHohtCbM="

ota:
  password: "a2901221c0620fe677425c4e8d9c2f58"

wifi:
  # ssid: !secret wifi_ssid
  # password: !secret wifi_password
  networks: 
    - ssid: !secret wifi_ssid
      password: !secret wifi_password
      priority: 1
    - ssid: !secret wifi_backup_ssid
      password: !secret wifi_backup_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Airterk-Intake Fallback Hotspot"
    password: "112345678"

captive_portal:

sensor:
  - platform: pmsx003
    type: PMSX003
    pm_2_5:
      name: "PM 2.5 outside"
      id: "pm2_5_outside"
      filters: 
        - median: 
            send_every:  5
            send_first_at: 4
            window_size: 20
        - clamp: 
            min_value: 0
            max_value: 999

button:
  - platform: restart
    name: "Restart Button"
    id: "restart_button"

switch:
  - platform: output
    output: output_intake_relay
    name: "Switch intake fan"
    id: switch_intake_fan
    restore_mode: RESTORE_DEFAULT_OFF

output:
  - platform: gpio
    id: output_intake_relay
    pin: GPIO12
    inverted: False
