Edit esp-bedside-panel.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-16 22:54:59 +12:00
parent 324cefef4c
commit 3dc72898c9
+183 -21
View File
@@ -6,6 +6,7 @@
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-bedside-panel.yaml
#:########################################################################################:#
# VERSIONS:
# V1.4 2026-07-16 Moved Security image right, added Driveway and four Future buttons
# V1.3 2026-07-16 Added Security page with 640x360 Doorbell camera snapshot
# V1.2 2026-07-16 Removed Climate title and aligned Heat Pump heading above Off
# V1.1 2026-07-16 Increased Clock to 280px and date to 64px
@@ -97,12 +98,12 @@ substitutions:
# Device Naming
device_name: "esp-bedside-panel"
friendly_name: "ESP Bedside Panel"
description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside control panel. Security page with Home Assistant Doorbell camera snapshots. (Layout V1.1)"
description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside control panel. Security page with Doorbell and Driveway camera snapshots plus Future controls. (Layout V1.1)"
device_area: "Bedroom"
# Project Naming
project_name: "Guition.JC1060P470C_I_W_Y"
project_version: "v1.3"
project_version: "v1.4"
# Passwords & Secrets
api_key: !secret esp-api_key
@@ -132,6 +133,7 @@ substitutions:
home_assistant_internal_url: "http://homeassistant.local:8123"
security_camera_refresh_interval: "5s"
security_doorbell_camera_entity: "camera.view_road_front_door_fluent"
security_driveway_camera_entity: "camera.camera5"
# Home Assistant Entities - Status / Environment
moon_phase_entity: "sensor.astroweather_moon_phase"
@@ -809,6 +811,12 @@ globals:
restore_value: false
initial_value: "false"
# 1 = Doorbell, 2 = Driveway. Camera3 and Camera4 remain placeholders.
- id: security_camera_selection
type: int
restore_value: false
initial_value: "1"
#:########################################################################################:#
# SCRIPTS:
# Refresh all state-dependent LVGL button colours
@@ -1250,8 +1258,35 @@ script:
? lv_color_hex(0x6B4A86)
: lv_color_hex(0x28313D);
# Download a current Doorbell image through the authenticated proxy path
# supplied by the Home Assistant camera entity.
# Highlight the selected Security camera.
- id: refresh_security_camera_buttons
mode: restart
then:
- if:
condition:
lambda: |-
return (
id(lvgl_ready) &&
id(security_page_active)
);
then:
- lvgl.widget.update:
id: security_doorbell_button
bg_color: !lambda |-
return id(security_camera_selection) == 1
? lv_color_hex(0x493535)
: lv_color_hex(0x28313D);
- lvgl.widget.update:
id: security_driveway_button
bg_color: !lambda |-
return id(security_camera_selection) == 2
? lv_color_hex(0x493535)
: lv_color_hex(0x28313D);
# Download the selected Security camera image through the authenticated
# proxy path supplied by Home Assistant.
- id: refresh_security_camera
mode: restart
then:
@@ -1264,11 +1299,18 @@ script:
);
then:
- script.execute: refresh_security_camera_buttons
- if:
condition:
lambda: |-
const auto path =
id(ha_doorbell_entity_picture).state;
std::string path;
if (id(security_camera_selection) == 2) {
path = id(ha_driveway_entity_picture).state;
} else {
path = id(ha_doorbell_entity_picture).state;
}
return (
!path.empty() &&
@@ -1279,13 +1321,21 @@ script:
then:
- lvgl.label.update:
id: security_camera_status_label
text: "Loading Doorbell..."
text: !lambda |-
return id(security_camera_selection) == 2
? std::string("Loading Driveway...")
: std::string("Loading Doorbell...");
- online_image.set_url:
id: security_camera_image
url: !lambda |-
const std::string path =
id(ha_doorbell_entity_picture).state;
std::string path;
if (id(security_camera_selection) == 2) {
path = id(ha_driveway_entity_picture).state;
} else {
path = id(ha_doorbell_entity_picture).state;
}
std::string url;
@@ -1317,7 +1367,10 @@ script:
else:
- lvgl.label.update:
id: security_camera_status_label
text: "Waiting for Doorbell camera"
text: !lambda |-
return id(security_camera_selection) == 2
? std::string("Waiting for Driveway camera")
: std::string("Waiting for Doorbell camera");
- id: release_climate_profile_optimistic
mode: restart
@@ -1475,8 +1528,8 @@ text_sensor:
then:
- script.execute: refresh_climate_controls
# Home Assistant supplies a short-lived authenticated camera proxy URL in
# the entity_picture attribute. This avoids storing an HA token in firmware.
# Home Assistant supplies short-lived authenticated camera proxy URLs in
# each entity_picture attribute. This avoids storing an HA token in firmware.
- platform: homeassistant
id: ha_doorbell_entity_picture
entity_id: "${security_doorbell_camera_entity}"
@@ -1487,7 +1540,28 @@ text_sensor:
- if:
condition:
lambda: |-
return id(security_page_active);
return (
id(security_page_active) &&
id(security_camera_selection) == 1
);
then:
- script.execute: refresh_security_camera
- platform: homeassistant
id: ha_driveway_entity_picture
entity_id: "${security_driveway_camera_entity}"
attribute: entity_picture
internal: true
on_value:
then:
- if:
condition:
lambda: |-
return (
id(security_page_active) &&
id(security_camera_selection) == 2
);
then:
- script.execute: refresh_security_camera
@@ -2069,6 +2143,7 @@ lvgl:
brightness: "${control_brightness}"
transition_length: 250ms
- script.execute: refresh_security_camera_buttons
- script.execute: refresh_security_camera
- button:
@@ -2799,10 +2874,14 @@ lvgl:
text_font: font_button
text_color: 0xFFFFFF
on_click:
- lambda: |-
id(security_camera_selection) = 1;
- script.execute: refresh_security_camera_buttons
- script.execute: refresh_security_camera
- button:
id: security_camera_2_button
id: security_driveway_button
x: 272
y: 18
width: 220
@@ -2810,14 +2889,22 @@ lvgl:
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
border_color: 0x9A6666
radius: 16
pressed:
bg_color: 0x654949
widgets:
- label:
align: CENTER
text: "Camera2"
text: "Driveway"
text_font: font_button
text_color: 0x8D98A6
text_color: 0xFFFFFF
on_click:
- lambda: |-
id(security_camera_selection) = 2;
- script.execute: refresh_security_camera_buttons
- script.execute: refresh_security_camera
- button:
id: security_camera_3_button
@@ -2856,10 +2943,85 @@ lvgl:
text_color: 0x8D98A6
#:################################################################################:#
# 640x360 CAMERA IMAGE
# FUTURE SECURITY CONTROLS
#:################################################################################:#
- button:
id: security_future_1_button
x: 25
y: 105
width: 290
height: 70
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 16
widgets:
- label:
align: CENTER
text: "Future1"
text_font: font_button
text_color: 0x8D98A6
- button:
id: security_future_2_button
x: 25
y: 190
width: 290
height: 70
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 16
widgets:
- label:
align: CENTER
text: "Future2"
text_font: font_button
text_color: 0x8D98A6
- button:
id: security_future_3_button
x: 25
y: 275
width: 290
height: 70
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 16
widgets:
- label:
align: CENTER
text: "Future3"
text_font: font_button
text_color: 0x8D98A6
- button:
id: security_future_4_button
x: 25
y: 360
width: 290
height: 70
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 16
widgets:
- label:
align: CENTER
text: "Future4"
text_font: font_button
text_color: 0x8D98A6
#:################################################################################:#
# 640x360 CAMERA IMAGE - RIGHT SIDE
#:################################################################################:#
- obj:
x: 190
x: 348
y: 98
width: 644
height: 364
@@ -2873,7 +3035,7 @@ lvgl:
- image:
id: security_camera_widget
x: 192
x: 350
y: 100
width: 640
height: 360
@@ -2884,7 +3046,7 @@ lvgl:
- label:
id: security_camera_status_label
x: 192
x: 350
y: 260
width: 640
text: "Waiting for Doorbell camera"