esphome:
  name: esphome-eg-bad
  min_version: 2024.11.0
  name_add_mac_suffix: false

esp32:
  board: esp32dev
  framework:
    type: esp-idf

# Enable logging
logger:

# Enable Home Assistant API
api: 
  encryption: 
    key: Ku+4KjIICSm9KbnE9cFKWir3c3wlmXONKHFCi2CaLCk=

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

i2c:
  sda: GPIO21
  scl: GPIO22
  scan: true
  id: bus_a
  frequency: 50kHz

sensor:
  - platform: scd4x
    address: 0x62
    update_interval: 10s
    co2:
      name: "CO2"
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO12
      inverted: false
      mode:
        input: true
        pullup: true
    name: "Presence"
    device_class: motion