Edit esp-bedside-panel.yaml
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-bedside-panel.yaml
|
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-bedside-panel.yaml
|
||||||
#:########################################################################################:#
|
#:########################################################################################:#
|
||||||
# VERSIONS:
|
# VERSIONS:
|
||||||
|
# V1.35 2026-07-19 Added an adjustable Blackout range below 2 lx
|
||||||
# V1.34 2026-07-19 Added three ambient-light ranges and periodic backlight rechecking
|
# V1.34 2026-07-19 Added three ambient-light ranges and periodic backlight rechecking
|
||||||
# V1.33 2026-07-19 Raised the default night lux threshold after TEMT6000 testing
|
# V1.33 2026-07-19 Raised the default night lux threshold after TEMT6000 testing
|
||||||
# V1.32 2026-07-19 Added persistent ambient-light thresholds, brightness levels and idle delays
|
# V1.32 2026-07-19 Added persistent ambient-light thresholds, brightness levels and idle delays
|
||||||
@@ -119,7 +120,7 @@
|
|||||||
# - Sleep: 2 hrs starts a local 120-minute countdown and turns the heat pump off.
|
# - Sleep: 2 hrs starts a local 120-minute countdown and turns the heat pump off.
|
||||||
# - Pressing the active Sleep button again cancels the countdown.
|
# - Pressing the active Sleep button again cancels the countdown.
|
||||||
# - TEMT6000 voltage and approximate lux are exposed for calibration.
|
# - TEMT6000 voltage and approximate lux are exposed for calibration.
|
||||||
# - Ambient light is divided into Dark, Normal and Bright ranges.
|
# - Ambient light is divided into Blackout, Dark, Normal and Bright ranges.
|
||||||
# - Touch immediately restores the active brightness for the current range.
|
# - Touch immediately restores the active brightness for the current range.
|
||||||
# - The current page dims after a configurable idle delay.
|
# - The current page dims after a configurable idle delay.
|
||||||
# - A second configurable delay changes to the large Clock page.
|
# - A second configurable delay changes to the large Clock page.
|
||||||
@@ -143,12 +144,12 @@ substitutions:
|
|||||||
# Device Naming
|
# Device Naming
|
||||||
device_name: "esp-bedside-panel"
|
device_name: "esp-bedside-panel"
|
||||||
friendly_name: "ESP Bedside Panel"
|
friendly_name: "ESP Bedside Panel"
|
||||||
description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside control panel. Three-range adaptive touch and clock brightness with periodic ambient rechecking. (Layout V1.1)"
|
description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside control panel. Four-range adaptive brightness including an adjustable blackout level below 2 lx. (Layout V1.1)"
|
||||||
device_area: "Bedroom"
|
device_area: "Bedroom"
|
||||||
|
|
||||||
# Project Naming
|
# Project Naming
|
||||||
project_name: "Guition.JC1060P470C_I_W_Y"
|
project_name: "Guition.JC1060P470C_I_W_Y"
|
||||||
project_version: "v1.34"
|
project_version: "v1.35"
|
||||||
|
|
||||||
# Passwords & Secrets
|
# Passwords & Secrets
|
||||||
api_key: !secret esp-api_key
|
api_key: !secret esp-api_key
|
||||||
@@ -185,9 +186,13 @@ substitutions:
|
|||||||
# Bright light: approximately 642-643 lx
|
# Bright light: approximately 642-643 lx
|
||||||
ambient_lux_multiplier_default: "200"
|
ambient_lux_multiplier_default: "200"
|
||||||
|
|
||||||
|
display_blackout_lux_threshold_default: "2"
|
||||||
display_dark_lux_threshold_default: "20"
|
display_dark_lux_threshold_default: "20"
|
||||||
display_bright_lux_threshold_default: "250"
|
display_bright_lux_threshold_default: "250"
|
||||||
|
|
||||||
|
# Blackout brightness is shared by touched and idle/clock modes.
|
||||||
|
display_blackout_brightness_default: "2"
|
||||||
|
|
||||||
display_dark_touch_brightness_default: "25"
|
display_dark_touch_brightness_default: "25"
|
||||||
display_normal_touch_brightness_default: "80"
|
display_normal_touch_brightness_default: "80"
|
||||||
display_bright_touch_brightness_default: "95"
|
display_bright_touch_brightness_default: "95"
|
||||||
@@ -753,6 +758,20 @@ number:
|
|||||||
step: 5
|
step: 5
|
||||||
mode: box
|
mode: box
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
id: display_blackout_lux_threshold
|
||||||
|
name: "${friendly_name} Blackout Lux Threshold"
|
||||||
|
icon: mdi:brightness-1
|
||||||
|
entity_category: config
|
||||||
|
optimistic: true
|
||||||
|
restore_value: true
|
||||||
|
initial_value: "${display_blackout_lux_threshold_default}"
|
||||||
|
unit_of_measurement: "lx"
|
||||||
|
min_value: 0
|
||||||
|
max_value: 20
|
||||||
|
step: 0.5
|
||||||
|
mode: box
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
id: display_dark_lux_threshold
|
id: display_dark_lux_threshold
|
||||||
name: "${friendly_name} Dark Lux Threshold"
|
name: "${friendly_name} Dark Lux Threshold"
|
||||||
@@ -781,6 +800,20 @@ number:
|
|||||||
step: 5
|
step: 5
|
||||||
mode: box
|
mode: box
|
||||||
|
|
||||||
|
- platform: template
|
||||||
|
id: display_blackout_brightness
|
||||||
|
name: "${friendly_name} Blackout Brightness"
|
||||||
|
icon: mdi:brightness-1
|
||||||
|
entity_category: config
|
||||||
|
optimistic: true
|
||||||
|
restore_value: true
|
||||||
|
initial_value: "${display_blackout_brightness_default}"
|
||||||
|
unit_of_measurement: "%"
|
||||||
|
min_value: 1
|
||||||
|
max_value: 20
|
||||||
|
step: 1
|
||||||
|
mode: slider
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
id: display_dark_touch_brightness
|
id: display_dark_touch_brightness
|
||||||
name: "${friendly_name} Dark Touch Brightness"
|
name: "${friendly_name} Dark Touch Brightness"
|
||||||
@@ -1538,10 +1571,11 @@ script:
|
|||||||
# ADAPTIVE DISPLAY BACKLIGHT
|
# ADAPTIVE DISPLAY BACKLIGHT
|
||||||
#:######################################################################################:#
|
#:######################################################################################:#
|
||||||
#
|
#
|
||||||
# Three ambient ranges are used:
|
# Four ambient ranges are used:
|
||||||
# Dark: lux <= Dark Lux Threshold
|
# Blackout: lux < Blackout Lux Threshold
|
||||||
# Normal: between the two thresholds
|
# Dark: Blackout threshold to Dark Lux Threshold
|
||||||
# Bright: lux >= Bright Lux Threshold
|
# Normal: between Dark and Bright thresholds
|
||||||
|
# Bright: lux >= Bright Lux Threshold
|
||||||
#
|
#
|
||||||
# The active and clock/idle brightness levels are independently adjustable
|
# The active and clock/idle brightness levels are independently adjustable
|
||||||
# and restored after reboot.
|
# and restored after reboot.
|
||||||
@@ -1557,12 +1591,21 @@ script:
|
|||||||
brightness: !lambda |-
|
brightness: !lambda |-
|
||||||
const float lux = id(ambient_light_illuminance).state;
|
const float lux = id(ambient_light_illuminance).state;
|
||||||
|
|
||||||
|
float blackout_threshold =
|
||||||
|
id(display_blackout_lux_threshold).state;
|
||||||
float dark_threshold =
|
float dark_threshold =
|
||||||
id(display_dark_lux_threshold).state;
|
id(display_dark_lux_threshold).state;
|
||||||
float bright_threshold =
|
float bright_threshold =
|
||||||
id(display_bright_lux_threshold).state;
|
id(display_bright_lux_threshold).state;
|
||||||
|
|
||||||
if (isnan(dark_threshold)) {
|
if (isnan(blackout_threshold)) {
|
||||||
|
blackout_threshold = 2.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
isnan(dark_threshold) ||
|
||||||
|
dark_threshold <= blackout_threshold
|
||||||
|
) {
|
||||||
dark_threshold = 20.0f;
|
dark_threshold = 20.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1575,7 +1618,11 @@ script:
|
|||||||
|
|
||||||
float brightness_percent;
|
float brightness_percent;
|
||||||
|
|
||||||
if (isnan(lux) || lux <= dark_threshold) {
|
if (!isnan(lux) && lux < blackout_threshold) {
|
||||||
|
brightness_percent =
|
||||||
|
id(display_blackout_brightness).state;
|
||||||
|
id(ambient_light_band_text).publish_state("Blackout");
|
||||||
|
} else if (isnan(lux) || lux <= dark_threshold) {
|
||||||
brightness_percent =
|
brightness_percent =
|
||||||
id(display_dark_touch_brightness).state;
|
id(display_dark_touch_brightness).state;
|
||||||
id(ambient_light_band_text).publish_state("Dark");
|
id(ambient_light_band_text).publish_state("Dark");
|
||||||
@@ -1610,12 +1657,21 @@ script:
|
|||||||
brightness: !lambda |-
|
brightness: !lambda |-
|
||||||
const float lux = id(ambient_light_illuminance).state;
|
const float lux = id(ambient_light_illuminance).state;
|
||||||
|
|
||||||
|
float blackout_threshold =
|
||||||
|
id(display_blackout_lux_threshold).state;
|
||||||
float dark_threshold =
|
float dark_threshold =
|
||||||
id(display_dark_lux_threshold).state;
|
id(display_dark_lux_threshold).state;
|
||||||
float bright_threshold =
|
float bright_threshold =
|
||||||
id(display_bright_lux_threshold).state;
|
id(display_bright_lux_threshold).state;
|
||||||
|
|
||||||
if (isnan(dark_threshold)) {
|
if (isnan(blackout_threshold)) {
|
||||||
|
blackout_threshold = 2.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
isnan(dark_threshold) ||
|
||||||
|
dark_threshold <= blackout_threshold
|
||||||
|
) {
|
||||||
dark_threshold = 20.0f;
|
dark_threshold = 20.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1628,7 +1684,11 @@ script:
|
|||||||
|
|
||||||
float brightness_percent;
|
float brightness_percent;
|
||||||
|
|
||||||
if (isnan(lux) || lux <= dark_threshold) {
|
if (!isnan(lux) && lux < blackout_threshold) {
|
||||||
|
brightness_percent =
|
||||||
|
id(display_blackout_brightness).state;
|
||||||
|
id(ambient_light_band_text).publish_state("Blackout");
|
||||||
|
} else if (isnan(lux) || lux <= dark_threshold) {
|
||||||
brightness_percent =
|
brightness_percent =
|
||||||
id(display_dark_clock_brightness).state;
|
id(display_dark_clock_brightness).state;
|
||||||
id(ambient_light_band_text).publish_state("Dark");
|
id(ambient_light_band_text).publish_state("Dark");
|
||||||
|
|||||||
Reference in New Issue
Block a user