Edit esp-bedside-panel.yaml
This commit is contained in:
+183
-21
@@ -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.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.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.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
|
# V1.1 2026-07-16 Increased Clock to 280px and date to 64px
|
||||||
@@ -97,12 +98,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. 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"
|
device_area: "Bedroom"
|
||||||
|
|
||||||
# Project Naming
|
# Project Naming
|
||||||
project_name: "Guition.JC1060P470C_I_W_Y"
|
project_name: "Guition.JC1060P470C_I_W_Y"
|
||||||
project_version: "v1.3"
|
project_version: "v1.4"
|
||||||
|
|
||||||
# Passwords & Secrets
|
# Passwords & Secrets
|
||||||
api_key: !secret esp-api_key
|
api_key: !secret esp-api_key
|
||||||
@@ -132,6 +133,7 @@ substitutions:
|
|||||||
home_assistant_internal_url: "http://homeassistant.local:8123"
|
home_assistant_internal_url: "http://homeassistant.local:8123"
|
||||||
security_camera_refresh_interval: "5s"
|
security_camera_refresh_interval: "5s"
|
||||||
security_doorbell_camera_entity: "camera.view_road_front_door_fluent"
|
security_doorbell_camera_entity: "camera.view_road_front_door_fluent"
|
||||||
|
security_driveway_camera_entity: "camera.camera5"
|
||||||
|
|
||||||
# Home Assistant Entities - Status / Environment
|
# Home Assistant Entities - Status / Environment
|
||||||
moon_phase_entity: "sensor.astroweather_moon_phase"
|
moon_phase_entity: "sensor.astroweather_moon_phase"
|
||||||
@@ -809,6 +811,12 @@ globals:
|
|||||||
restore_value: false
|
restore_value: false
|
||||||
initial_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:
|
# SCRIPTS:
|
||||||
# Refresh all state-dependent LVGL button colours
|
# Refresh all state-dependent LVGL button colours
|
||||||
@@ -1250,8 +1258,35 @@ script:
|
|||||||
? lv_color_hex(0x6B4A86)
|
? lv_color_hex(0x6B4A86)
|
||||||
: lv_color_hex(0x28313D);
|
: lv_color_hex(0x28313D);
|
||||||
|
|
||||||
# Download a current Doorbell image through the authenticated proxy path
|
# Highlight the selected Security camera.
|
||||||
# supplied by the Home Assistant camera entity.
|
- 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
|
- id: refresh_security_camera
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
@@ -1264,11 +1299,18 @@ script:
|
|||||||
);
|
);
|
||||||
|
|
||||||
then:
|
then:
|
||||||
|
- script.execute: refresh_security_camera_buttons
|
||||||
|
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
lambda: |-
|
lambda: |-
|
||||||
const auto path =
|
std::string path;
|
||||||
id(ha_doorbell_entity_picture).state;
|
|
||||||
|
if (id(security_camera_selection) == 2) {
|
||||||
|
path = id(ha_driveway_entity_picture).state;
|
||||||
|
} else {
|
||||||
|
path = id(ha_doorbell_entity_picture).state;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
!path.empty() &&
|
!path.empty() &&
|
||||||
@@ -1279,13 +1321,21 @@ script:
|
|||||||
then:
|
then:
|
||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
id: security_camera_status_label
|
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:
|
- online_image.set_url:
|
||||||
id: security_camera_image
|
id: security_camera_image
|
||||||
url: !lambda |-
|
url: !lambda |-
|
||||||
const std::string path =
|
std::string path;
|
||||||
id(ha_doorbell_entity_picture).state;
|
|
||||||
|
if (id(security_camera_selection) == 2) {
|
||||||
|
path = id(ha_driveway_entity_picture).state;
|
||||||
|
} else {
|
||||||
|
path = id(ha_doorbell_entity_picture).state;
|
||||||
|
}
|
||||||
|
|
||||||
std::string url;
|
std::string url;
|
||||||
|
|
||||||
@@ -1317,7 +1367,10 @@ script:
|
|||||||
else:
|
else:
|
||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
id: security_camera_status_label
|
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
|
- id: release_climate_profile_optimistic
|
||||||
mode: restart
|
mode: restart
|
||||||
@@ -1475,8 +1528,8 @@ text_sensor:
|
|||||||
then:
|
then:
|
||||||
- script.execute: refresh_climate_controls
|
- script.execute: refresh_climate_controls
|
||||||
|
|
||||||
# Home Assistant supplies a short-lived authenticated camera proxy URL in
|
# Home Assistant supplies short-lived authenticated camera proxy URLs in
|
||||||
# the entity_picture attribute. This avoids storing an HA token in firmware.
|
# each entity_picture attribute. This avoids storing an HA token in firmware.
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
id: ha_doorbell_entity_picture
|
id: ha_doorbell_entity_picture
|
||||||
entity_id: "${security_doorbell_camera_entity}"
|
entity_id: "${security_doorbell_camera_entity}"
|
||||||
@@ -1487,7 +1540,28 @@ text_sensor:
|
|||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
lambda: |-
|
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:
|
then:
|
||||||
- script.execute: refresh_security_camera
|
- script.execute: refresh_security_camera
|
||||||
@@ -2069,6 +2143,7 @@ lvgl:
|
|||||||
brightness: "${control_brightness}"
|
brightness: "${control_brightness}"
|
||||||
transition_length: 250ms
|
transition_length: 250ms
|
||||||
|
|
||||||
|
- script.execute: refresh_security_camera_buttons
|
||||||
- script.execute: refresh_security_camera
|
- script.execute: refresh_security_camera
|
||||||
|
|
||||||
- button:
|
- button:
|
||||||
@@ -2799,10 +2874,14 @@ lvgl:
|
|||||||
text_font: font_button
|
text_font: font_button
|
||||||
text_color: 0xFFFFFF
|
text_color: 0xFFFFFF
|
||||||
on_click:
|
on_click:
|
||||||
|
- lambda: |-
|
||||||
|
id(security_camera_selection) = 1;
|
||||||
|
|
||||||
|
- script.execute: refresh_security_camera_buttons
|
||||||
- script.execute: refresh_security_camera
|
- script.execute: refresh_security_camera
|
||||||
|
|
||||||
- button:
|
- button:
|
||||||
id: security_camera_2_button
|
id: security_driveway_button
|
||||||
x: 272
|
x: 272
|
||||||
y: 18
|
y: 18
|
||||||
width: 220
|
width: 220
|
||||||
@@ -2810,14 +2889,22 @@ lvgl:
|
|||||||
bg_color: 0x28313D
|
bg_color: 0x28313D
|
||||||
bg_opa: COVER
|
bg_opa: COVER
|
||||||
border_width: 2
|
border_width: 2
|
||||||
border_color: 0x445365
|
border_color: 0x9A6666
|
||||||
radius: 16
|
radius: 16
|
||||||
|
pressed:
|
||||||
|
bg_color: 0x654949
|
||||||
widgets:
|
widgets:
|
||||||
- label:
|
- label:
|
||||||
align: CENTER
|
align: CENTER
|
||||||
text: "Camera2"
|
text: "Driveway"
|
||||||
text_font: font_button
|
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:
|
- button:
|
||||||
id: security_camera_3_button
|
id: security_camera_3_button
|
||||||
@@ -2856,10 +2943,85 @@ lvgl:
|
|||||||
text_color: 0x8D98A6
|
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:
|
- obj:
|
||||||
x: 190
|
x: 348
|
||||||
y: 98
|
y: 98
|
||||||
width: 644
|
width: 644
|
||||||
height: 364
|
height: 364
|
||||||
@@ -2873,7 +3035,7 @@ lvgl:
|
|||||||
|
|
||||||
- image:
|
- image:
|
||||||
id: security_camera_widget
|
id: security_camera_widget
|
||||||
x: 192
|
x: 350
|
||||||
y: 100
|
y: 100
|
||||||
width: 640
|
width: 640
|
||||||
height: 360
|
height: 360
|
||||||
@@ -2884,7 +3046,7 @@ lvgl:
|
|||||||
|
|
||||||
- label:
|
- label:
|
||||||
id: security_camera_status_label
|
id: security_camera_status_label
|
||||||
x: 192
|
x: 350
|
||||||
y: 260
|
y: 260
|
||||||
width: 640
|
width: 640
|
||||||
text: "Waiting for Doorbell camera"
|
text: "Waiting for Doorbell camera"
|
||||||
|
|||||||
Reference in New Issue
Block a user