135 lines
2.7 KiB
YAML
135 lines
2.7 KiB
YAML
|
|
substitutions:
|
||
|
|
device_name: jordyn-a1-camera
|
||
|
|
friendly_name: "Jordyn A1 Camera"
|
||
|
|
|
||
|
|
esphome:
|
||
|
|
name: ${device_name}
|
||
|
|
friendly_name: ${friendly_name}
|
||
|
|
|
||
|
|
esp32:
|
||
|
|
board: esp32dev
|
||
|
|
framework:
|
||
|
|
type: esp-idf
|
||
|
|
#cpu_frequency: 240MHZ
|
||
|
|
|
||
|
|
# Enable logging
|
||
|
|
logger:
|
||
|
|
|
||
|
|
# Enable Home Assistant API
|
||
|
|
api:
|
||
|
|
encryption:
|
||
|
|
key: "PDB5LTKAcNWMC+MeE03/SKpqX42pcnITzmfwu761LjI="
|
||
|
|
|
||
|
|
ota:
|
||
|
|
- platform: esphome
|
||
|
|
password: "d207583702e4b979e28a43f6f52d19ae"
|
||
|
|
|
||
|
|
wifi:
|
||
|
|
ssid: !secret wifi_iot_ssid
|
||
|
|
password: !secret wifi_password
|
||
|
|
|
||
|
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||
|
|
ap:
|
||
|
|
ssid: "Jordyn-A1-Camera"
|
||
|
|
password: "jN4rzGokp5mt"
|
||
|
|
|
||
|
|
# Prevents aggressive reconnection attempts
|
||
|
|
power_save_mode: none # Use 'light' for battery devices
|
||
|
|
|
||
|
|
# Slower but more reliable connection
|
||
|
|
fast_connect: true
|
||
|
|
|
||
|
|
# Handle connection failures gracefully
|
||
|
|
on_connect:
|
||
|
|
- logger.log: "Wi-Fi connected!"
|
||
|
|
on_disconnect:
|
||
|
|
- logger.log: "Wi-Fi disconnected!"
|
||
|
|
|
||
|
|
# Reduce mDNS traffic
|
||
|
|
mdns:
|
||
|
|
disabled: false # Set to true if you use static IPs and don't need discovery
|
||
|
|
|
||
|
|
#captive_portal:
|
||
|
|
|
||
|
|
web_server:
|
||
|
|
port: 80
|
||
|
|
|
||
|
|
i2c:
|
||
|
|
- id: camera_i2c
|
||
|
|
sda: GPIO26
|
||
|
|
scl: GPIO27
|
||
|
|
|
||
|
|
psram:
|
||
|
|
mode: quad
|
||
|
|
speed: 80MHz
|
||
|
|
|
||
|
|
esp32_camera:
|
||
|
|
external_clock:
|
||
|
|
pin: GPIO0
|
||
|
|
frequency: 20MHz
|
||
|
|
i2c_id: camera_i2c
|
||
|
|
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
|
||
|
|
jpeg_quality: 20
|
||
|
|
vertical_flip: False
|
||
|
|
horizontal_mirror: False
|
||
|
|
max_framerate: 40 fps
|
||
|
|
idle_framerate: 0.05 fps
|
||
|
|
|
||
|
|
# Image settings
|
||
|
|
name: esp32-jordyn-a1-cam
|
||
|
|
# brightness: 1
|
||
|
|
# #contrast: 0
|
||
|
|
# agc_gain_ceiling: 2X
|
||
|
|
# agc_mode: MANUAL
|
||
|
|
# agc_value: 5
|
||
|
|
# ...
|
||
|
|
|
||
|
|
esp32_camera_web_server:
|
||
|
|
- port: 80
|
||
|
|
mode: STREAM
|
||
|
|
- port: 8080
|
||
|
|
mode: SNAPSHOT
|
||
|
|
|
||
|
|
switch:
|
||
|
|
- platform: gpio
|
||
|
|
name: "jordyn-a1-cam-flash"
|
||
|
|
pin: 4
|
||
|
|
|
||
|
|
# Diagnostic sensors
|
||
|
|
sensor:
|
||
|
|
- platform: wifi_signal
|
||
|
|
name: "${device_name} WiFi Signal"
|
||
|
|
update_interval: 60s
|
||
|
|
|
||
|
|
- platform: uptime
|
||
|
|
name: "${device_name} Uptime"
|
||
|
|
update_interval: 60s
|
||
|
|
|
||
|
|
text_sensor:
|
||
|
|
- platform: wifi_info
|
||
|
|
ip_address:
|
||
|
|
name: "${device_name} IP Address"
|
||
|
|
ssid:
|
||
|
|
name: "${device_name} Connected SSID"
|
||
|
|
bssid:
|
||
|
|
name: "${device_name} BSSID"
|
||
|
|
|
||
|
|
# Watchdog to auto-reboot if things go wrong
|
||
|
|
interval:
|
||
|
|
- interval: 5min
|
||
|
|
then:
|
||
|
|
- if:
|
||
|
|
condition:
|
||
|
|
and:
|
||
|
|
- lambda: 'return millis() > 300000;' # >5 min uptime
|
||
|
|
- not:
|
||
|
|
wifi.connected:
|
||
|
|
then:
|
||
|
|
- logger.log: "Wi-Fi not connected for 5 min, rebooting..."
|
||
|
|
- delay: 10s
|
||
|
|
- lambda: 'App.safe_reboot();'
|