Enhance camera image tuning and add gain ceiling selection for improved chamber monitoring

This commit is contained in:
Joshua King
2026-09-08 14:48:07 -04:00
parent 6f09682071
commit b1fa10e78e
+41 -9
View File
@@ -80,17 +80,21 @@ esp32_camera:
vertical_flip: true
horizontal_mirror: false
# Image tuning for chamber monitoring through tinted door
brightness: 1
contrast: -1
# Image tuning for chamber monitoring through tinted door.
# Low contrast + high brightness lifts the shadows; the LED strips are
# allowed to blow out since the chamber is what matters.
brightness: 2
contrast: -2
saturation: 0
# Auto-Exposure & Gain tuning (AEC2 + AE Level lift shadows away from bright LEDs)
# Auto-Exposure & Gain tuning (AEC2 + AE Level lift shadows away from bright LEDs).
# The gain ceiling is the main lever for the tinted door: 8X was capping how
# far AGC could amplify, leaving everything outside the LED strips black.
aec_mode: auto
aec2: true
ae_level: 1
ae_level: 2
agc_mode: auto
agc_gain_ceiling: 8X
agc_gain_ceiling: 128X
wb_mode: auto
# Camera endpoints:
@@ -160,7 +164,7 @@ number:
min_value: -2
max_value: 2
step: 1
initial_value: 1
initial_value: 2
optimistic: true
set_action:
- lambda: |-
@@ -172,7 +176,7 @@ number:
min_value: -2
max_value: 2
step: 1
initial_value: -1
initial_value: -2
optimistic: true
set_action:
- lambda: |-
@@ -184,10 +188,38 @@ number:
min_value: -2
max_value: 2
step: 1
initial_value: 1
initial_value: 2
optimistic: true
set_action:
- lambda: |-
sensor_t *s = esp_camera_sensor_get();
if (s) s->set_ae_level(s, (int)x);
select:
# Caps how far AGC may amplify. Higher = brighter but noisier; back this off
# if the chamber image gets too grainy at 128X.
- platform: template
name: "${friendly_name} Gain Ceiling"
optimistic: true
initial_option: "128X"
options:
- "2X"
- "4X"
- "8X"
- "16X"
- "32X"
- "64X"
- "128X"
set_action:
- lambda: |-
sensor_t *s = esp_camera_sensor_get();
if (!s) return;
int idx = 6;
if (x == "2X") idx = 0;
else if (x == "4X") idx = 1;
else if (x == "8X") idx = 2;
else if (x == "16X") idx = 3;
else if (x == "32X") idx = 4;
else if (x == "64X") idx = 5;
s->set_gainceiling(s, (gainceiling_t)idx);