# Konfiguration für DEBO CAM ESP32 mit OV2640 2MP Kamera Modul,
# bestellt 2022-09 bei reichelt.de
# Konfiguration gefunden bei: 
# - https://smarthomeyourself.de/wiki/esphome/esp32-cam-mit-esphome-als-guenstige-kamera-fuer-home-assistant/
# lt. Datenblatt von Joy-IT:
# - Artikelnummer SBC-ESP32-Cam
# - EAN: 4250236818016
#
# Stromversorgung: 5V, Pins: 5V, GND (1 und 2) 

esphome:
  name: esp32campool
  platform: ESP32
  board: esp32dev

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: ""

ota:
  password: ""

wifi:
  ssid: "LBMerle9_EXT2ghz"
  password: "TurdusMerula"
  fast_connect: true
  manual_ip:
    static_ip: 192.168.1.16
    gateway: 192.168.1.1
    subnet: 255.255.255.0
    dns1: 192.168.1.1

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32Cam01 Fallback Hotspot"
    password: "PiaYmWK2Uget"

captive_portal:

# ESP32-CAM config
esp32_camera:
  name: poolcam
  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: 1024x768
#  resolution: 1600x1200
  jpeg_quality: 10
  vertical_flip: false
  horizontal_mirror: false

esp32_camera_web_server:
#  - port: 8080
#    mode: stream
  - port: 8081
    mode: snapshot
    
# additional config:
binary_sensor:
  - platform: status
    name: "ESP32CamPool status"
  
sensor:
  - platform: wifi_signal
    name: "ESP32CamPool WiFi Signal"
    update_interval: 60s  

output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4

light:
  - platform: binary
    output: gpio_4
    name: "ESP32CamPool light"
