ESPHome在Home Assistant中的应用实例:esp32cam

esphome:
  name: 3d-cam
  friendly_name: 3D-cam

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "SyY/NMK8iNi17mGzvf8VbBu2tuZKUEiK8qOC8k1fQJo="

ota:
  password: "bbe6f1768c1b334206f9ca4c31fd6218"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "3D-Cam Fallback Hotspot"
    password: "qBrYOZNHxrXO"

captive_portal:

# Integrated Web Server for OTA, Flash etc.
web_server:
  port: 80

# Light for integrated Flash
light:
  - platform: binary
    name: "Integrated Flash"
    output: flash_out
output:
  - id: flash_out
    platform: gpio
    pin: GPIO4

# Enable Cam with 800x600 resolution
esp32_camera:
  name: ESP32Cam
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32
  resolution: 800x600
  jpeg_quality: 17
  vertical_flip: true
  horizontal_mirror: false
  brightness: 1
  aec2: True
  ae_level: 1
  contrast: 1
# Enable Stream and Snapshot URLs
esp32_camera_web_server:
  - port: 8080
    mode: stream
  - port: 8081
    mode: snapshot