Add web server configuration and enhance camera settings for ESP32-H2C

This commit is contained in:
Joshua King
2026-02-13 10:41:08 -05:00
parent 703b5117df
commit ed0648866a
3 changed files with 173 additions and 9 deletions

View File

@@ -31,6 +31,9 @@ wifi:
ssid: "${friendly_name} Fallback"
password: !secret fallback_password
web_server:
port: 80
captive_portal:
i2c:
@@ -63,15 +66,15 @@ esp32_camera:
name: ${device_name}
brightness: 1
#contrast: 0
agc_gain_ceiling: 2X
agc_mode: MANUAL
agc_value: 5
# agc_gain_ceiling: 2X
# agc_mode: MANUAL
# agc_value: 5
# ...
esp32_camera_web_server:
- port: 80
mode: STREAM
- port: 8080
mode: STREAM
- port: 8081
mode: SNAPSHOT
switch:

View File

@@ -55,10 +55,10 @@ esp32_camera:
pixel_clock_pin: GPIO15
# Start conservative for reliability; increase later if stable.
resolution: 640x480
jpeg_quality: 12
max_framerate: 10 fps
idle_framerate: 0.2 fps
resolution: 800x600
jpeg_quality: 15
max_framerate: 20 fps
idle_framerate: 0.05 fps
frame_buffer_count: 1
# Common orientation defaults for this module.

161
home-energy-monitor.yaml Normal file
View File

@@ -0,0 +1,161 @@
substitutions:
friendly_name: "Home Energy Monitor"
device_name: home-energy-monitor
update_time: 10s
# SCT-013-000 (100A/50mA) calibration value
current_cal: '27518'
# Jameco 9VAC Transformer (board v1.3+)
voltage_cal: '7305'
esphome:
name: ${device_name}
friendly_name: ${friendly_name}
esp32:
board: nodemcu-32s
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !secret api_encryption_key
# Enable OTA updates
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Optional: static IP for reliability
# manual_ip:
# static_ip: 192.168.1.50
# gateway: 192.168.1.1
# subnet: 255.255.255.0
# Fallback hotspot if Wi-Fi fails
ap:
ssid: ${device_name}
password: !secret wifi_password
captive_portal:
web_server:
port: 80
# SPI bus configuration
spi:
clk_pin: 18
miso_pin: 19
mosi_pin: 23
sensor:
# Wi-Fi signal strength
- platform: wifi_signal
name: ${device_name} WiFi Signal
update_interval: 60s
# ──────────────────────────────────
# IC1: Channels 1-3 (CS pin 5)
# ──────────────────────────────────
- platform: atm90e32
cs_pin: 5
phase_a:
voltage:
name: ${device_name} Volts
id: ic1Volts
accuracy_decimals: 1
current:
name: ${device_name} CT1 Amps
id: ct1Amps
power:
name: ${device_name} CT1 Watts
id: ct1Watts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
phase_b:
current:
name: ${device_name} CT2 Amps
id: ct2Amps
power:
name: ${device_name} CT2 Watts
id: ct2Watts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
phase_c:
current:
name: ${device_name} CT3 Amps
id: ct3Amps
power:
name: ${device_name} CT3 Watts
id: ct3Watts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
frequency:
name: ${device_name} Frequency
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
# ──────────────────────────────────
# IC2: Channels 4-6 (CS pin 4)
# ──────────────────────────────────
- platform: atm90e32
cs_pin: 4
phase_a:
current:
name: ${device_name} CT4 Amps
id: ct4Amps
power:
name: ${device_name} CT4 Watts
id: ct4Watts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
phase_b:
current:
name: ${device_name} CT5 Amps
id: ct5Amps
power:
name: ${device_name} CT5 Watts
id: ct5Watts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
phase_c:
current:
name: ${device_name} CT6 Amps
id: ct6Amps
power:
name: ${device_name} CT6 Watts
id: ct6Watts
gain_voltage: ${voltage_cal}
gain_ct: ${current_cal}
line_frequency: 60Hz
gain_pga: 1X
update_interval: ${update_time}
# ──────────────────────────────────
# Calculated: Total Home Power
# (CT1 = Main Leg 1, CT2 = Main Leg 2)
# ──────────────────────────────────
- platform: template
name: ${device_name} Total Watts
id: totalWatts
lambda: "return id(ct1Watts).state + id(ct2Watts).state;"
accuracy_decimals: 1
unit_of_measurement: W
device_class: power
update_interval: ${update_time}
- platform: total_daily_energy
name: ${device_name} Total Daily Energy
power_id: totalWatts
unit_of_measurement: kWh
accuracy_decimals: 2
filters:
- multiply: 0.001
time:
- platform: homeassistant
id: homeassistant_time