Files
zorruno-homeassistant/esphome/esp-bedside-panel.yaml
T
ESPHome Device Builder 905a16236b Edit esp-bedside-panel.yaml
2026-07-16 17:58:24 +12:00

1227 lines
36 KiB
YAML

#:########################################################################################:#
# TITLE: ESP BEDSIDE PANEL
# zorruno.com layout v1.1 2026
#:########################################################################################:#
# REPO:
# https://home.fox.co.nz/gitea/zorruno/zorruno-homeassistant/src/branch/master/esphome/esp-bedside-panel.yaml
#:########################################################################################:#
# VERSIONS:
# V0.8f 2026-07-15 Added minimal Climate page with two placeholders and Back button
# V0.8e 2026-07-15 Centred Bedroom button captions only; no additional pages
# V0.8b 2026-07-15 Changed proven V0.8a clock to 24-hour format and removed AM/PM
# V0.8a 2026-07-14 Reduced LVGL memory load after V0.8 OTA rollback
# Added lean large-clock idle page and Bedroom controls
# V0.8 2026-07-14 Added large bedside clock, idle dimming and first bedroom control page
# V0.7 2026-07-14 Added first landscape LVGL page and Home Assistant test button
# V0.6 2026-07-14 Added GT911 touchscreen and touch-coordinate logging
# V0.5 2026-07-14 Added corrected JC1060P470 MIPI display configuration and text test
# V0.4 2026-07-14 Removed MIPI display test after setup watchdog boot loop; retained backlight-only test
# V0.3 2026-07-14 Added backlight control and first MIPI display text test
# V0.2 2026-07-14 Added ESP32 hosted WiFi via ESP32-C6 co-processor
# V0.1 2026-07-14 Initial ESPHome bring-up for Guition JC1060P470C_I_W_Y ESP32-P4 panel
#:########################################################################################:#
# HARDWARE:
# - Guition JC1060P470C_I_W_Y
# - 7 inch 1024x600 capacitive touch display
# - ESP32-P4 main processor
# - ESP32-C6 wireless co-processor
# - 16MB flash
# - 32MB PSRAM
# - 100 Mbps Ethernet
# - Dual USB-C ports
#
# Confirmed hardware details:
# - Display model: JC1060P470
# - Display interface: MIPI-DSI
# - Display reset: GPIO5
# - Display backlight PWM: GPIO23
# - Touch controller: GT911
# - Touch I2C SDA: GPIO7
# - Touch I2C SCL: GPIO8
# - Touch interrupt: GPIO21
# - Touch reset: GPIO22
# - Touch I2C address: 0x5D
#:########################################################################################:#
# OPERATION NOTES:
# - This build returns to the proven V0.8a structure.
# - The only functional clock changes are:
# - 24-hour HH:MM display
# - AM/PM label and update removed
# - The clock font remains at the proven 170px size.
# - The display remains in its native 1024x600 landscape orientation.
# - The default page contains nine Bedroom / nearby controls.
# - After the configured idle period:
# - The large clock page is displayed.
# - Backlight brightness is reduced.
# - Touching the clock:
# - Returns to the Bedroom controls.
# - Restores normal brightness.
# - Climate and Downstairs pages remain intentionally omitted.
#:########################################################################################:#
# OFFLINE NOTES:
# - LVGL, the clock, touch and backlight operate locally.
# - Home Assistant control buttons require an API connection.
# - The clock continues using the most recently synchronised time.
#:########################################################################################:#
#:########################################################################################:#
# SUBSTITUTIONS:
# Specific device variable substitutions
# If NOT using a secrets file, just replace these with the passwords etc (in quotes)
#:########################################################################################:#
substitutions:
# Device Naming
device_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. Minimal Climate page test. (Layout V1.1)"
device_area: "Bedroom"
# Project Naming
project_name: "Guition.JC1060P470C_I_W_Y"
project_version: "v0.8f"
# Passwords & Secrets
api_key: !secret esp-api_key
ota_pass: !secret esp-ota_pass
# Device Settings
log_level: "INFO"
update_interval: "60s"
# Display Settings
backlight_pin: "GPIO23"
backlight_frequency: "1220Hz"
# Touchscreen Settings
touch_sda_pin: "GPIO7"
touch_scl_pin: "GPIO8"
touch_interrupt_pin: "GPIO21"
touch_reset_pin: "GPIO22"
# Clock / Screen Settings
clock_idle_timeout: "60s"
control_brightness: "80%"
clock_brightness: "4%"
# Home Assistant Entities - Environment
bedroom_temperature_entity: "sensor.bedroom_1_environment_z19th_temperature"
bedroom_humidity_entity: "sensor.bedroom_1_environment_z19th_humidity"
# Home Assistant Entities - Bedroom / Nearby Controls
north_lights_entity: "light.tasmo_ifan02_3793_bedrm1_1"
south_lights_entity: "switch.master_bedroom_master_bedroom_main_lights_south_relay_2_master_bedroom_south_lights"
bedside_lamp_entity: "switch.master_bedroom_bedside_lamp_arlec_bulb_master_bedroom_bedside_lamp_arlec_bulb_jump_fade_up_down"
hall_floor_entity: "switch.main_hallway_nightlights_1_relay_1_main_hallway_nightlights"
hall_lights_entity: "switch.main_hallway_lightswitch_relay_1_main_hallway_lights"
bathroom_lights_entity: "switch.main_bathroom_lightswitch_3_2_all_main_bathroom_lights"
patio_lights_entity: "switch.esp_garageentrylights_relay_2_patio_lights"
garage_lights_entity: "switch.esp_garageentrylights_relay_3_garage_lights"
bathroom_fan_entity: "switch.esp_mainbathfancombo_relay_1_extract_fan"
# Home Assistant Entities - Status
garage_door_entity: "binary_sensor.garage_roller_door_x18rs_contact"
quiet_time_entity: "input_boolean.quiet_time"
# Home Assistant Entities - Actions
bedtime_button_entity: "input_button.bedtime_mode"
#:########################################################################################:#
# PACKAGES:
# Included Common Packages
# https://esphome.io/components/packages.html
#:########################################################################################:#
packages:
#### WIFI, Network DHCP, Fallback AP, Safemode ####
common_wifi: !include
file: common/network_common_dhcp.yaml
vars:
local_device_name: "${device_name}"
local_ota_pass: "${ota_pass}"
#### HOME ASSISTANT API ####
common_api: !include
file: common/api_common.yaml
#file: common/api_common_noencryption.yaml
vars:
local_api_key: "${api_key}"
#### MQTT ####
#common_mqtt: !include
# file: common/mqtt_common.yaml
# vars:
# local_device_name: "${device_name}"
#### WEB PORTAL ####
#common_webportal: !include common/webportal_common_nopass.yaml
#### SNTP ####
#common_sntp: !include common/sntp_common.yaml
#### DIAGNOSTICS Sensors ####
#diag_basic: !include common/include_basic_diag_sensors.yaml
#diag_more: !include common/include_more_diag_sensors.yaml
#diag_debug: !include common/include_debug_diag_sensors.yaml
#diag_resetcount: !include common/include_resetcount_diag_sensors.yaml
#:########################################################################################:#
# ESPHOME:
# https://esphome.io/components/esphome.html
#:########################################################################################:#
esphome:
name: "${device_name}"
friendly_name: "${friendly_name}"
comment: "${description_comment}"
area: "${device_area}"
project:
name: "${project_name}"
version: "${project_version}"
#:########################################################################################:#
# ESP PLATFORM AND FRAMEWORK:
# https://esphome.io/components/esp32.html
#:########################################################################################:#
esp32:
variant: ESP32P4
engineering_sample: true
cpu_frequency: 360MHz
flash_size: 16MB
framework:
type: esp-idf
advanced:
enable_idf_experimental_features: true
disable_vfs_support_termios: false
disable_vfs_support_select: false
disable_vfs_support_dir: false
sdkconfig_options:
CONFIG_SPIRAM_XIP_FROM_PSRAM: "y"
CONFIG_SDMMC_HOST_DEFAULT: "y"
#:########################################################################################:#
# PSRAM:
# https://esphome.io/components/psram.html
#:########################################################################################:#
psram:
mode: hex
speed: 200MHz
#:########################################################################################:#
# ESP32 HOSTED WIFI COPROCESSOR:
# https://esphome.io/components/esp32_hosted.html
#:########################################################################################:#
esp32_hosted:
variant: ESP32C6
reset_pin: GPIO54
cmd_pin: GPIO19
clk_pin: GPIO18
d0_pin: GPIO14
d1_pin: GPIO15
d2_pin: GPIO16
d3_pin: GPIO17
active_high: true
#:########################################################################################:#
# ESP LDO:
# Supplies the ESP32-P4 MIPI-DSI PHY
#:########################################################################################:#
esp_ldo:
- channel: 3
id: dsi_phy_enable
voltage: 2.5V
adjustable: true
#:########################################################################################:#
# LOGGER:
# https://esphome.io/components/logger.html
#:########################################################################################:#
logger:
level: "${log_level}"
baud_rate: 115200
hardware_uart: USB_SERIAL_JTAG
#:########################################################################################:#
# HOME ASSISTANT API:
#:########################################################################################:#
api:
on_client_connected:
then:
- logger.log:
level: INFO
format: "API connected: ESP Bedside Panel is online"
- lvgl.label.update:
id: bedroom_connection_label
text: "HA connected"
text_color: 0x65D483
on_client_disconnected:
then:
- logger.log:
level: WARN
format: "API disconnected: ESP Bedside Panel is offline from Home Assistant"
- lvgl.label.update:
id: bedroom_connection_label
text: "HA offline"
text_color: 0xF06A6A
#:########################################################################################:#
# OTA:
# https://esphome.io/components/ota/esphome.html
#:########################################################################################:#
ota:
- platform: esphome
password: "${ota_pass}"
#:########################################################################################:#
# TIME:
# https://esphome.io/components/time/homeassistant.html
#:########################################################################################:#
time:
- platform: homeassistant
id: ha_time
#:########################################################################################:#
# I2C:
# https://esphome.io/components/i2c.html
#:########################################################################################:#
i2c:
- id: touch_i2c
sda: "${touch_sda_pin}"
scl: "${touch_scl_pin}"
frequency: 400kHz
scan: true
#:########################################################################################:#
# OUTPUT:
# https://esphome.io/components/output/ledc.html
#:########################################################################################:#
output:
- platform: ledc
pin: "${backlight_pin}"
id: backlight_output
frequency: "${backlight_frequency}"
#:########################################################################################:#
# LIGHT:
# https://esphome.io/components/light/monochromatic.html
#:########################################################################################:#
light:
- platform: monochromatic
output: backlight_output
name: "Backlight"
id: display_backlight
icon: "mdi:brightness-6"
restore_mode: RESTORE_DEFAULT_ON
default_transition_length: 500ms
gamma_correct: 1.0
#:########################################################################################:#
# DISPLAY:
# https://esphome.io/components/display/mipi_dsi.html
#:########################################################################################:#
display:
- platform: mipi_dsi
model: JC1060P470
id: main_display
color_order: RGB
reset_pin:
number: GPIO5
hsync_pulse_width: 20
update_interval: never
auto_clear_enabled: false
#:########################################################################################:#
# TOUCHSCREEN:
# https://esphome.io/components/touchscreen/gt911.html
#:########################################################################################:#
touchscreen:
- platform: gt911
id: main_touchscreen
display: main_display
i2c_id: touch_i2c
address: 0x5D
interrupt_pin:
number: "${touch_interrupt_pin}"
mode:
input: true
reset_pin:
number: "${touch_reset_pin}"
mode:
output: true
#:########################################################################################:#
# FONTS:
# Reduced font set for lower startup memory use
# https://esphome.io/components/font.html
#:########################################################################################:#
font:
- file: "gfonts://Roboto"
id: font_clock
size: 170
glyphs:
- "0123456789:"
- file: "gfonts://Roboto"
id: font_title
size: 36
glyphs:
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789, .:/-%°"
- file: "gfonts://Roboto"
id: font_button
size: 24
glyphs:
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789 .:/-"
- file: "gfonts://Roboto"
id: font_small
size: 20
glyphs:
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz"
- "0123456789, .:/-%°"
#:########################################################################################:#
# HOME ASSISTANT NUMERIC SENSORS:
# https://esphome.io/components/sensor/homeassistant.html
#:########################################################################################:#
sensor:
- platform: uptime
name: "${friendly_name} Uptime"
id: uptime_sensor
update_interval: "${update_interval}"
- platform: wifi_signal
name: "${friendly_name} WiFi Signal"
id: wifi_signal_sensor
update_interval: "${update_interval}"
- platform: homeassistant
id: bedroom_temperature
entity_id: "${bedroom_temperature_entity}"
internal: true
on_value:
then:
- lvgl.label.update:
id: clock_temperature_label
text:
format: "%.1f°C"
args: [x]
- lvgl.label.update:
id: bedroom_temperature_label
text:
format: "%.1f°C"
args: [x]
- platform: homeassistant
id: bedroom_humidity
entity_id: "${bedroom_humidity_entity}"
internal: true
on_value:
then:
- lvgl.label.update:
id: clock_humidity_label
text:
format: "%.0f%%"
args: [x]
- lvgl.label.update:
id: bedroom_humidity_label
text:
format: "%.0f%%"
args: [x]
#:########################################################################################:#
# HOME ASSISTANT BINARY SENSORS:
# Imported states used to colour LVGL buttons
#:########################################################################################:#
binary_sensor:
- platform: homeassistant
id: ha_north_lights
entity_id: "${north_lights_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: north_lights_button
bg_color: !lambda |-
return x
? lv_color_hex(0xB88918)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_south_lights
entity_id: "${south_lights_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: south_lights_button
bg_color: !lambda |-
return x
? lv_color_hex(0xB88918)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_bedside_lamp
entity_id: "${bedside_lamp_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: bedside_lamp_button
bg_color: !lambda |-
return x
? lv_color_hex(0xB88918)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_hall_floor
entity_id: "${hall_floor_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: hall_floor_button
bg_color: !lambda |-
return x
? lv_color_hex(0x92702D)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_hall_lights
entity_id: "${hall_lights_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: hall_lights_button
bg_color: !lambda |-
return x
? lv_color_hex(0xB88918)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_bathroom_lights
entity_id: "${bathroom_lights_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: bathroom_lights_button
bg_color: !lambda |-
return x
? lv_color_hex(0xB88918)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_patio_lights
entity_id: "${patio_lights_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: patio_lights_button
bg_color: !lambda |-
return x
? lv_color_hex(0xA87500)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_garage_lights
entity_id: "${garage_lights_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: garage_lights_button
bg_color: !lambda |-
if (id(ha_garage_door).state) {
return lv_color_hex(0xC25B13);
}
return x
? lv_color_hex(0xB88918)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_garage_door
entity_id: "${garage_door_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: garage_lights_button
bg_color: !lambda |-
if (x) {
return lv_color_hex(0xC25B13);
}
return id(ha_garage_lights).state
? lv_color_hex(0xB88918)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_bathroom_fan
entity_id: "${bathroom_fan_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: bathroom_fan_button
bg_color: !lambda |-
return x
? lv_color_hex(0x1668A8)
: lv_color_hex(0x28313D);
- platform: homeassistant
id: ha_quiet_time
entity_id: "${quiet_time_entity}"
internal: true
on_state:
then:
- lvgl.widget.update:
id: bedtime_button
bg_color: !lambda |-
return x
? lv_color_hex(0x705295)
: lv_color_hex(0x3B3048);
- lvgl.label.update:
id: clock_status_label
text: !lambda |-
return x
? std::string("Quiet Time active")
: std::string("");
#:########################################################################################:#
# INTERVAL:
# Update minute-resolution clock values locally
#:########################################################################################:#
interval:
- interval: 10s
then:
- if:
condition:
lambda: |-
return id(ha_time).now().is_valid();
then:
- lvgl.label.update:
id: clock_time_label
text: !lambda |-
auto now = id(ha_time).now();
char buffer[8];
now.strftime(buffer, sizeof(buffer), "%H:%M");
return std::string(buffer);
- lvgl.label.update:
id: clock_date_label
text: !lambda |-
auto now = id(ha_time).now();
char weekday[16];
char month[16];
now.strftime(weekday, sizeof(weekday), "%A");
now.strftime(month, sizeof(month), "%B");
char buffer[48];
snprintf(
buffer,
sizeof(buffer),
"%s, %d %s",
weekday,
now.day_of_month,
month
);
return std::string(buffer);
#:########################################################################################:#
# TEXT SENSOR COMPONENT:
# https://esphome.io/components/text_sensor/
#:########################################################################################:#
text_sensor:
- platform: version
name: "${friendly_name} ESPHome Version"
hide_timestamp: true
- platform: wifi_info
ip_address:
name: "${friendly_name} IP Address"
ssid:
name: "${friendly_name} Connected SSID"
bssid:
name: "${friendly_name} Connected BSSID"
mac_address:
name: "${friendly_name} MAC Address"
#:########################################################################################:#
# LVGL:
# https://esphome.io/components/lvgl/
#:########################################################################################:#
lvgl:
id: panel_lvgl
displays:
- main_display
touchscreens:
- touchscreen_id: main_touchscreen
long_press_time: 1200ms
long_press_repeat_time: 500ms
rotation: 0
buffer_size: 8%
log_level: WARN
default_font: font_button
page_wrap: false
theme:
dark_mode: true
on_idle:
- timeout: "${clock_idle_timeout}"
then:
- lvgl.page.show:
id: clock_page
animation: FADE_IN
time: 250ms
- light.turn_on:
id: display_backlight
brightness: "${clock_brightness}"
transition_length: 1500ms
pages:
#:####################################################################################:#
# BEDROOM PAGE
#:####################################################################################:#
- id: bedroom_page
bg_color: 0x10151D
bg_opa: COVER
widgets:
- label:
x: 35
y: 18
text: "Bedroom"
text_font: font_title
text_color: 0xFFFFFF
- label:
id: bedroom_temperature_label
x: 700
y: 25
text: "--.-°C"
text_font: font_title
text_color: 0x8FC6EE
- label:
id: bedroom_humidity_label
x: 865
y: 25
text: "--%"
text_font: font_title
text_color: 0x83C7AA
- label:
id: bedroom_connection_label
x: 38
y: 67
text: "Waiting for HA"
text_font: font_small
text_color: 0xF0A45D
- button:
id: north_lights_button
x: 35
y: 105
width: 300
height: 105
widgets:
- label:
id: north_lights_button_label
align: CENTER
text: "North Lights"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: light.toggle
data:
entity_id: "${north_lights_entity}"
- button:
id: south_lights_button
x: 362
y: 105
width: 300
height: 105
widgets:
- label:
id: south_lights_button_label
align: CENTER
text: "South Lights"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${south_lights_entity}"
- button:
id: bedside_lamp_button
x: 689
y: 105
width: 300
height: 105
widgets:
- label:
id: bedside_lamp_button_label
align: CENTER
text: "Bedside Lamp"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${bedside_lamp_entity}"
- button:
id: hall_floor_button
x: 35
y: 228
width: 300
height: 105
widgets:
- label:
id: hall_floor_button_label
align: CENTER
text: "Hall Floor"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${hall_floor_entity}"
- button:
id: hall_lights_button
x: 362
y: 228
width: 300
height: 105
widgets:
- label:
id: hall_lights_button_label
align: CENTER
text: "Hall Lights"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${hall_lights_entity}"
- button:
id: bathroom_lights_button
x: 689
y: 228
width: 300
height: 105
widgets:
- label:
id: bathroom_lights_button_label
align: CENTER
text: "Bathroom Lights"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${bathroom_lights_entity}"
- button:
id: patio_lights_button
x: 35
y: 351
width: 300
height: 105
widgets:
- label:
id: patio_lights_button_label
align: CENTER
text: "Patio Lights"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${patio_lights_entity}"
- button:
id: garage_lights_button
x: 362
y: 351
width: 300
height: 105
widgets:
- label:
id: garage_lights_button_label
align: CENTER
text: "Garage Lights"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${garage_lights_entity}"
- button:
id: bathroom_fan_button
x: 689
y: 351
width: 300
height: 105
widgets:
- label:
id: bathroom_fan_button_label
align: CENTER
text: "Bathroom Fan"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
pressed:
bg_color: 0x425166
on_click:
- homeassistant.action:
action: switch.toggle
data:
entity_id: "${bathroom_fan_entity}"
- button:
id: clock_now_button
x: 35
y: 485
width: 280
height: 82
widgets:
- label:
id: clock_now_button_label
align: CENTER
text: "Show Clock"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x214F72
bg_opa: COVER
border_width: 2
border_color: 0x3E7FA7
radius: 16
on_click:
- lvgl.page.show:
id: clock_page
animation: FADE_IN
time: 250ms
- light.turn_on:
id: display_backlight
brightness: "${clock_brightness}"
transition_length: 1500ms
- button:
id: spare_navigation_button
x: 340
y: 485
width: 280
height: 82
widgets:
- label:
id: spare_navigation_button_label
align: CENTER
text: "Climate"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x315843
bg_opa: COVER
border_width: 2
border_color: 0x548C6C
radius: 16
on_click:
- lvgl.page.show:
id: climate_page
animation: MOVE_LEFT
time: 220ms
- button:
id: bedtime_button
x: 645
y: 485
width: 344
height: 82
widgets:
- label:
id: bedtime_button_label
align: CENTER
text: "Hold for Bedtime"
text_font: font_button
text_color: 0xFFFFFF
bg_color: 0x3B3048
bg_opa: COVER
border_width: 2
border_color: 0x735E88
radius: 16
on_long_press:
then:
- homeassistant.action:
action: input_button.press
data:
entity_id: "${bedtime_button_entity}"
- lvgl.label.update:
id: bedtime_button_label
text: "Bedtime Activated"
- delay: 2s
- lvgl.label.update:
id: bedtime_button_label
text: "Hold for Bedtime"
#:####################################################################################:#
# CLIMATE PAGE
#:####################################################################################:#
- id: climate_page
bg_color: 0x111923
bg_opa: COVER
widgets:
- label:
align: TOP_MID
y: 55
text: "Bedroom Climate"
text_font: font_title
text_color: 0xFFFFFF
- button:
id: climate_placeholder_left
x: 120
y: 180
width: 340
height: 150
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
widgets:
- label:
align: CENTER
text: "Climate Controls"
text_font: font_button
text_color: 0xAEB8C4
- button:
id: climate_placeholder_right
x: 564
y: 180
width: 340
height: 150
bg_color: 0x28313D
bg_opa: COVER
border_width: 2
border_color: 0x445365
radius: 18
widgets:
- label:
align: CENTER
text: "More Soon"
text_font: font_button
text_color: 0xAEB8C4
- button:
id: climate_back_button
align: BOTTOM_MID
y: -70
width: 360
height: 95
bg_color: 0x315843
bg_opa: COVER
border_width: 2
border_color: 0x548C6C
radius: 18
pressed:
bg_color: 0x416F55
widgets:
- label:
align: CENTER
text: "Back to Bedroom"
text_font: font_button
text_color: 0xFFFFFF
on_click:
- lvgl.page.show:
id: bedroom_page
animation: MOVE_RIGHT
time: 220ms
#:####################################################################################:#
# CLOCK PAGE
#:####################################################################################:#
- id: clock_page
skip: true
bg_color: 0x020304
bg_opa: COVER
widgets:
- button:
id: clock_wake_button
x: 0
y: 0
width: 1024
height: 600
bg_opa: TRANSP
border_width: 0
shadow_width: 0
radius: 0
text: ""
on_click:
then:
- lvgl.page.show:
id: bedroom_page
animation: FADE_OUT
time: 250ms
- light.turn_on:
id: display_backlight
brightness: "${control_brightness}"
transition_length: 500ms
- label:
id: clock_time_label
align: TOP_MID
y: 70
text: "--:--"
text_font: font_clock
text_color: 0xE4DDD2
clickable: false
- label:
id: clock_date_label
align: TOP_MID
y: 325
text: "Waiting for time"
text_font: font_title
text_color: 0xA8A198
clickable: false
- label:
id: clock_temperature_label
x: 335
y: 420
text: "--.-°C"
text_font: font_title
text_color: 0x8FAFC8
clickable: false
- label:
id: clock_humidity_label
x: 600
y: 420
text: "--%"
text_font: font_title
text_color: 0x7FAE9B
clickable: false
- label:
id: clock_status_label
align: BOTTOM_MID
y: -45
text: ""
text_font: font_small
text_color: 0x887799
clickable: false