Edit esp-bedside-panel.yaml

This commit is contained in:
ESPHome Device Builder
2026-07-16 19:25:20 +12:00
parent 5403d27f10
commit b8681f7741
+363 -63
View File
@@ -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:
# V0.8l 2026-07-16 Completed primary Climate controls, ceiling fan cycle and Air Filter Low
# V0.8k 2026-07-16 Revised Bedroom header and added five-button navigation row # V0.8k 2026-07-16 Revised Bedroom header and added five-button navigation row
# V0.8j 2026-07-16 Added delayed Home Assistant state synchronisation for button highlighting at startup # V0.8j 2026-07-16 Added delayed Home Assistant state synchronisation for button highlighting at startup
# V0.8i 2026-07-16 Moved Clock date upward, added missing value glyphs and increased Clock to 190px # V0.8i 2026-07-16 Moved Clock date upward, added missing value glyphs and increased Clock to 190px
@@ -79,12 +80,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 clock and Home Assistant control panel. Compact Bedroom status header and five-button navigation row. (Layout V1.1)" description_comment: "Guition JC1060P470C_I_W_Y ESP32-P4 bedside clock and Home Assistant control panel. Heat-pump setpoint, ceiling-fan and air-filter 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: "v0.8k" project_version: "v0.8l"
# Passwords & Secrets # Passwords & Secrets
api_key: !secret esp-api_key api_key: !secret esp-api_key
@@ -133,11 +134,18 @@ substitutions:
# Home Assistant Entities - Actions # Home Assistant Entities - Actions
bedtime_button_entity: "input_button.bedtime_mode" bedtime_button_entity: "input_button.bedtime_mode"
# Home Assistant Entities - Climate Actions # Home Assistant Entities - Climate
climate_entity: "climate.master_bedroom"
climate_requested_mode_entity: "input_select.master_bedroom_hvac_requested_mode"
climate_off_script: "script.master_bedroom_hvac_off" climate_off_script: "script.master_bedroom_hvac_off"
climate_heat_script: "script.master_bedroom_hvac_heat" climate_heat_script: "script.master_bedroom_hvac_heat"
climate_cool_script: "script.master_bedroom_hvac_cool" climate_cool_script: "script.master_bedroom_hvac_cool"
climate_dry_script: "script.master_bedroom_hvac_dry" climate_dry_script: "script.master_bedroom_hvac_dry"
climate_setpoint_adjust_script: "script.master_bedroom_setpoint_adjust"
# Home Assistant Entities - Ceiling Fan / Air Filter
ceiling_fan_entity: "fan.tasmo_ifan02_3793_bedrm1_1"
air_filter_level_entity: "number.bedroom_1_air_filter_bedroom_1_air_filter_speed_level"
#:########################################################################################:# #:########################################################################################:#
# PACKAGES: # PACKAGES:
@@ -398,7 +406,7 @@ font:
glyphs: glyphs:
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz" - "abcdefghijklmnopqrstuvwxyz"
- "0123456789, .:/-%°" - "0123456789, .:/-%°+()"
- file: "gfonts://Roboto" - file: "gfonts://Roboto"
id: font_button id: font_button
@@ -406,7 +414,7 @@ font:
glyphs: glyphs:
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz" - "abcdefghijklmnopqrstuvwxyz"
- "0123456789 .:/-%°" - "0123456789 .:/-%°+()"
- file: "gfonts://Roboto" - file: "gfonts://Roboto"
id: font_small id: font_small
@@ -414,7 +422,7 @@ font:
glyphs: glyphs:
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz" - "abcdefghijklmnopqrstuvwxyz"
- "0123456789, .:/-%°" - "0123456789, .:/-%°+()"
#:########################################################################################:# #:########################################################################################:#
# HOME ASSISTANT NUMERIC SENSORS: # HOME ASSISTANT NUMERIC SENSORS:
@@ -503,6 +511,35 @@ sensor:
format: "%.0f%%" format: "%.0f%%"
args: [x] args: [x]
# Current heat-pump target temperature.
- platform: homeassistant
id: ha_climate_setpoint
entity_id: "${climate_entity}"
attribute: temperature
internal: true
on_value:
then:
- script.execute: refresh_climate_controls
# Current ceiling-fan percentage, normally 33 / 66 / 100.
- platform: homeassistant
id: ha_ceiling_fan_percentage
entity_id: "${ceiling_fan_entity}"
attribute: percentage
internal: true
on_value:
then:
- script.execute: refresh_climate_controls
# Current bedroom air-filter speed level.
- platform: homeassistant
id: ha_air_filter_level
entity_id: "${air_filter_level_entity}"
internal: true
on_value:
then:
- script.execute: refresh_climate_controls
#:########################################################################################:# #:########################################################################################:#
# HOME ASSISTANT BINARY SENSORS: # HOME ASSISTANT BINARY SENSORS:
# Imported states used to colour LVGL buttons # Imported states used to colour LVGL buttons
@@ -646,6 +683,14 @@ binary_sensor:
? lv_color_hex(0x1668A8) ? lv_color_hex(0x1668A8)
: lv_color_hex(0x28313D); : lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_ceiling_fan_on
entity_id: "${ceiling_fan_entity}"
internal: true
on_state:
then:
- script.execute: refresh_climate_controls
- platform: homeassistant - platform: homeassistant
id: ha_quiet_time id: ha_quiet_time
entity_id: "${quiet_time_entity}" entity_id: "${quiet_time_entity}"
@@ -769,6 +814,101 @@ script:
? std::string("Quiet Time active") ? std::string("Quiet Time active")
: std::string(""); : std::string("");
- script.execute: refresh_climate_controls
# Update Climate-page labels and highlight the currently selected settings.
- id: refresh_climate_controls
mode: restart
then:
# Heat-pump mode buttons.
- lvgl.widget.update:
id: climate_off_button
bg_color: !lambda |-
const auto mode = id(ha_climate_requested_mode).state;
return (mode == "Off" || mode == "off")
? lv_color_hex(0x548C6C)
: lv_color_hex(0x28313D);
- lvgl.widget.update:
id: climate_heat_button
bg_color: !lambda |-
const auto mode = id(ha_climate_requested_mode).state;
return (mode == "Heat" || mode == "heat")
? lv_color_hex(0xB76822)
: lv_color_hex(0x28313D);
- lvgl.widget.update:
id: climate_cool_button
bg_color: !lambda |-
const auto mode = id(ha_climate_requested_mode).state;
return (mode == "Cool" || mode == "cool")
? lv_color_hex(0x2E6A96)
: lv_color_hex(0x28313D);
- lvgl.widget.update:
id: climate_dry_button
bg_color: !lambda |-
const auto mode = id(ha_climate_requested_mode).state;
return (
mode == "Dry" ||
mode == "dry" ||
mode == "Dehumidify" ||
mode == "dehumidify"
)
? lv_color_hex(0x32677F)
: lv_color_hex(0x28313D);
# Heat-pump target setpoint.
- lvgl.label.update:
id: climate_setpoint_value_label
text: !lambda |-
const float value = id(ha_climate_setpoint).state;
if (isnan(value)) {
return std::string("--.-°C");
}
char buffer[16];
snprintf(buffer, sizeof(buffer), "%.1f°C", value);
return std::string(buffer);
# One-button ceiling-fan cycle: Off -> 1 -> 2 -> 3 -> Off.
- lvgl.label.update:
id: ceiling_fan_cycle_label
text: !lambda |-
if (!id(ha_ceiling_fan_on).state) {
return std::string("Ceiling Fan: Off");
}
const float percentage = id(ha_ceiling_fan_percentage).state;
if (isnan(percentage) || percentage < 50.0f) {
return std::string("Ceiling Fan: 1");
}
if (percentage < 85.0f) {
return std::string("Ceiling Fan: 2");
}
return std::string("Ceiling Fan: 3");
- lvgl.widget.update:
id: ceiling_fan_cycle_button
bg_color: !lambda |-
return id(ha_ceiling_fan_on).state
? lv_color_hex(0x315E82)
: lv_color_hex(0x28313D);
# Air-filter Low is active when the HA number is set to level 2.
- lvgl.widget.update:
id: air_filter_low_button
bg_color: !lambda |-
const float level = id(ha_air_filter_level).state;
return (!isnan(level) && level > 1.5f && level < 2.5f)
? lv_color_hex(0x315843)
: lv_color_hex(0x28313D);
# Two passes allow time for LVGL creation and Home Assistant state delivery. # Two passes allow time for LVGL creation and Home Assistant state delivery.
- id: startup_button_state_sync - id: startup_button_state_sync
mode: restart mode: restart
@@ -830,6 +970,15 @@ interval:
# https://esphome.io/components/text_sensor/ # https://esphome.io/components/text_sensor/
#:########################################################################################:# #:########################################################################################:#
text_sensor: text_sensor:
# Requested heat-pump mode used for button highlighting.
- platform: homeassistant
id: ha_climate_requested_mode
entity_id: "${climate_requested_mode_entity}"
internal: true
on_value:
then:
- script.execute: refresh_climate_controls
- platform: version - platform: version
name: "${friendly_name} ESPHome Version" name: "${friendly_name} ESPHome Version"
hide_timestamp: true hide_timestamp: true
@@ -1371,34 +1520,36 @@ lvgl:
widgets: widgets:
- label: - label:
x: 35 x: 28
y: 24 y: 18
text: "Bedroom Climate" text: "Bedroom Climate"
text_font: font_title text_font: font_title
text_color: 0xFFFFFF text_color: 0xFFFFFF
- label: - label:
align: TOP_RIGHT align: TOP_RIGHT
x: -38 x: -30
y: 31 y: 27
text: "Mode controls" text: "Heat Pump"
text_font: font_small text_font: font_small
text_color: 0x8FA0B3 text_color: 0x8FA0B3
# HVAC mode row #:################################################################################:#
# HEAT-PUMP MODES
#:################################################################################:#
- button: - button:
id: climate_off_button id: climate_off_button
x: 35 x: 25
y: 105 y: 72
width: 220 width: 220
height: 140 height: 96
bg_color: 0x31443A bg_color: 0x28313D
bg_opa: COVER bg_opa: COVER
border_width: 2 border_width: 2
border_color: 0x5A7A68 border_color: 0x5A7A68
radius: 18 radius: 17
pressed: pressed:
bg_color: 0x456052 bg_color: 0x548C6C
widgets: widgets:
- label: - label:
align: CENTER align: CENTER
@@ -1413,17 +1564,17 @@ lvgl:
- button: - button:
id: climate_heat_button id: climate_heat_button
x: 280 x: 272
y: 105 y: 72
width: 220 width: 220
height: 140 height: 96
bg_color: 0x6A401B bg_color: 0x28313D
bg_opa: COVER bg_opa: COVER
border_width: 2 border_width: 2
border_color: 0xA6672B border_color: 0xA6672B
radius: 18 radius: 17
pressed: pressed:
bg_color: 0x8A5625 bg_color: 0xB76822
widgets: widgets:
- label: - label:
align: CENTER align: CENTER
@@ -1438,15 +1589,15 @@ lvgl:
- button: - button:
id: climate_cool_button id: climate_cool_button
x: 525 x: 519
y: 105 y: 72
width: 220 width: 220
height: 140 height: 96
bg_color: 0x214F72 bg_color: 0x28313D
bg_opa: COVER bg_opa: COVER
border_width: 2 border_width: 2
border_color: 0x3E7FA7 border_color: 0x3E7FA7
radius: 18 radius: 17
pressed: pressed:
bg_color: 0x2E6A96 bg_color: 0x2E6A96
widgets: widgets:
@@ -1463,15 +1614,15 @@ lvgl:
- button: - button:
id: climate_dry_button id: climate_dry_button
x: 770 x: 766
y: 105 y: 72
width: 220 width: 220
height: 140 height: 96
bg_color: 0x244C60 bg_color: 0x28313D
bg_opa: COVER bg_opa: COVER
border_width: 2 border_width: 2
border_color: 0x427B96 border_color: 0x427B96
radius: 18 radius: 17
pressed: pressed:
bg_color: 0x32677F bg_color: 0x32677F
widgets: widgets:
@@ -1486,49 +1637,198 @@ lvgl:
data: data:
entity_id: "${climate_dry_script}" entity_id: "${climate_dry_script}"
# Lightweight placeholders for the next stage #:################################################################################:#
- button: # HEAT-PUMP SETPOINT
id: climate_setpoint_placeholder #:################################################################################:#
x: 120
y: 295
width: 340
height: 135
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
widgets:
- label: - label:
align: CENTER align: TOP_MID
text: "Setpoint - More Soon" y: 187
text_font: font_button text: "Setpoint"
text_color: 0xAEB8C4 text_font: font_small
text_color: 0x8FA0B3
- button: - button:
id: climate_fan_timer_placeholder id: climate_setpoint_down_button
x: 564 x: 100
y: 295 y: 218
width: 340 width: 190
height: 135 height: 105
bg_color: 0x28313D bg_color: 0x28313D
bg_opa: COVER bg_opa: COVER
border_width: 2 border_width: 2
border_color: 0x445365 border_color: 0x526276
radius: 18 radius: 18
pressed:
bg_color: 0x38485A
widgets: widgets:
- label: - label:
align: CENTER align: CENTER
text: "Fan and Timer - More Soon" text: "-0.5"
text_font: font_title
text_color: 0xFFFFFF
on_click:
- homeassistant.action:
action: "${climate_setpoint_adjust_script}"
data:
step: "-0.5"
- button:
id: climate_setpoint_display
x: 315
y: 218
width: 394
height: 105
bg_color: 0x1C2632
bg_opa: COVER
border_width: 2
border_color: 0x5A6C82
radius: 18
widgets:
- label:
id: climate_setpoint_value_label
align: CENTER
text: "--.-°C"
text_font: font_title
text_color: 0xFFFFFF
- button:
id: climate_setpoint_up_button
x: 734
y: 218
width: 190
height: 105
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x526276
radius: 18
pressed:
bg_color: 0x38485A
widgets:
- label:
align: CENTER
text: "+0.5"
text_font: font_title
text_color: 0xFFFFFF
on_click:
- homeassistant.action:
action: "${climate_setpoint_adjust_script}"
data:
step: "0.5"
#:################################################################################:#
# CEILING FAN / AIR FILTER
#:################################################################################:#
- button:
id: ceiling_fan_cycle_button
x: 65
y: 356
width: 430
height: 100
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x47789B
radius: 18
pressed:
bg_color: 0x315E82
widgets:
- label:
id: ceiling_fan_cycle_label
align: CENTER
text: "Ceiling Fan: Off"
text_font: font_button text_font: font_button
text_color: 0xAEB8C4 text_color: 0xFFFFFF
on_click:
# Off -> speed 1
- if:
condition:
lambda: |-
return !id(ha_ceiling_fan_on).state;
then:
- homeassistant.action:
action: fan.set_percentage
data:
entity_id: "${ceiling_fan_entity}"
percentage: "33"
else:
# Speed 1 -> speed 2
- if:
condition:
lambda: |-
const float percentage =
id(ha_ceiling_fan_percentage).state;
return (
isnan(percentage) ||
percentage < 50.0f
);
then:
- homeassistant.action:
action: fan.set_percentage
data:
entity_id: "${ceiling_fan_entity}"
percentage: "66"
else:
# Speed 2 -> speed 3
- if:
condition:
lambda: |-
return (
id(ha_ceiling_fan_percentage).state <
85.0f
);
then:
- homeassistant.action:
action: fan.set_percentage
data:
entity_id: "${ceiling_fan_entity}"
percentage: "100"
# Speed 3 -> Off
else:
- homeassistant.action:
action: fan.turn_off
data:
entity_id: "${ceiling_fan_entity}"
- button:
id: air_filter_low_button
x: 529
y: 356
width: 430
height: 100
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x548C6C
radius: 18
pressed:
bg_color: 0x315843
widgets:
- label:
align: CENTER
text: "Air Filter Low"
text_font: font_button
text_color: 0xFFFFFF
on_click:
- homeassistant.action:
action: number.set_value
data:
entity_id: "${air_filter_level_entity}"
value: "2"
- button: - button:
id: climate_back_button id: climate_back_button
align: BOTTOM_MID x: 365
y: -55 y: 490
width: 360 width: 294
height: 90 height: 78
bg_color: 0x315843 bg_color: 0x315843
bg_opa: COVER bg_opa: COVER
border_width: 2 border_width: 2