Refactor chore tracker configuration for improved consistency and clarity

This commit is contained in:
Joshua King
2026-02-28 08:49:25 -05:00
parent eb88e59550
commit c2ad832a82
4 changed files with 209 additions and 158 deletions

View File

@@ -4,19 +4,30 @@
#
# HOME SCREEN BEHAVIOUR:
# Red outline = chores incomplete
# Solid green = all chores done
# Solid green = all chores done
# Resets to red automatically at midnight
#
# Hardware: Waveshare ESP32-S3-Touch-LCD-7 (800x480)
################################################################################
esphome:
name: chore-tracker
friendly_name: "Chore Tracker"
on_boot:
priority: -10
then:
- light.turn_on: backlight
- lvgl.page.show: page_home
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
psram:
mode: octal
speed: 80MHz
wifi:
ssid: !secret wifi_iot_ssid
password: !secret wifi_password
@@ -36,50 +47,58 @@ ota:
- platform: esphome
password: !secret ota_password
# ── Display — Waveshare ESP32-S3 7" (adjust pins for your board revision) ─────
display:
- platform: rpi_dpi_rgb
id: main_display
auto_clear_enabled: false
color_order: RGB
dimensions:
width: 800
height: 480
de_pin: GPIO40
hsync_pin: GPIO39
vsync_pin:
number: GPIO41
pclk_pin: GPIO42
data_pins:
red: [GPIO45, GPIO48, GPIO47, GPIO21, GPIO14]
green: [GPIO5, GPIO6, GPIO7, GPIO15, GPIO16, GPIO4]
blue: [GPIO8, GPIO3, GPIO46, GPIO9, GPIO1]
touchscreen:
- platform: gt911
id: touch
display: main_display
i2c_id: i2c_touch
interrupt_pin: GPIO2
reset_pin: GPIO38
# ── I2C ───────────────────────────────────────────────────────────────────────
i2c:
- id: i2c_touch
sda: GPIO19
scl: GPIO20
frequency: 400kHz
sda: 8
scl: 9
# ── CH422G IO Expander (controls LCD reset, touch reset, backlight) ───────────
ch422g:
- id: ch422g_hub
# ── Display ───────────────────────────────────────────────────────────────────
display:
- platform: mipi_rgb
model: ESP32-S3-TOUCH-LCD-7-800X480
id: main_display
update_interval: never
auto_clear_enabled: false
reset_pin:
ch422g: ch422g_hub
number: 3
mode:
output: true
# ── Touchscreen ───────────────────────────────────────────────────────────────
touchscreen:
platform: gt911
id: touch
update_interval: 120ms
reset_pin:
ch422g: ch422g_hub
number: 1
mode:
output: true
# ── Backlight ─────────────────────────────────────────────────────────────────
output:
- platform: ledc
pin: GPIO17
id: backlight_output
- platform: template
id: lcd_backlight_out
type: binary
write_action:
- if:
condition:
lambda: return state;
then:
- switch.turn_on: lcd_backlight_raw
else:
- switch.turn_off: lcd_backlight_raw
light:
- platform: monochromatic
output: backlight_output
- platform: binary
name: "Display Backlight"
output: lcd_backlight_out
id: backlight
restore_mode: ALWAYS_ON
# ── Midnight reset ────────────────────────────────────────────────────────────
time:
@@ -96,6 +115,7 @@ time:
id(reset_chloe_chores).execute();
- lvgl.page.show: page_home
# ── Fonts (place files in /config/esphome/fonts/) ────────────────────────────
font:
- file: "fonts/Nunito-Black.ttf"
id: font_title
@@ -113,8 +133,17 @@ font:
id: font_tiny
size: 13
# ── Switches — one per chore per kid, synced to HA ───────────────────────────
# ── Switches — backlight raw + one per chore per kid ─────────────────────────
switch:
- platform: gpio
id: lcd_backlight_raw
name: "LCD Backlight Raw"
restore_mode: ALWAYS_ON
pin:
ch422g: ch422g_hub
number: 2
mode:
output: true
# ── Jordyn's chores ──────────────────────────
- platform: template
@@ -497,9 +526,9 @@ script:
lv_label_set_text(id(progress_label_jordyn), buf);
// All-done message in sidebar
lv_label_set_text(id(all_done_label_jordyn), done == total ? "\U0001F389 All done!" : "");
lv_label_set_text(id(all_done_label_jordyn), done == total ? "All done!" : "");
// Home button colour
// Home button: RED outline = incomplete, SOLID GREEN = all done
if (done == total) {
lv_obj_set_style_bg_opa(id(home_btn_jordyn), LV_OPA_COVER, LV_PART_MAIN);
lv_obj_set_style_bg_color(id(home_btn_jordyn), lv_color_hex(0x6BCB77), LV_PART_MAIN);
@@ -598,9 +627,9 @@ script:
lv_label_set_text(id(progress_label_declan), buf);
// All-done message in sidebar
lv_label_set_text(id(all_done_label_declan), done == total ? "\U0001F389 All done!" : "");
lv_label_set_text(id(all_done_label_declan), done == total ? "All done!" : "");
// Home button colour
// Home button: RED outline = incomplete, SOLID GREEN = all done
if (done == total) {
lv_obj_set_style_bg_opa(id(home_btn_declan), LV_OPA_COVER, LV_PART_MAIN);
lv_obj_set_style_bg_color(id(home_btn_declan), lv_color_hex(0x6BCB77), LV_PART_MAIN);
@@ -690,9 +719,9 @@ script:
lv_label_set_text(id(progress_label_chloe), buf);
// All-done message in sidebar
lv_label_set_text(id(all_done_label_chloe), done == total ? "\U0001F389 All done!" : "");
lv_label_set_text(id(all_done_label_chloe), done == total ? "All done!" : "");
// Home button colour
// Home button: RED outline = incomplete, SOLID GREEN = all done
if (done == total) {
lv_obj_set_style_bg_opa(id(home_btn_chloe), LV_OPA_COVER, LV_PART_MAIN);
lv_obj_set_style_bg_color(id(home_btn_chloe), lv_color_hex(0x6BCB77), LV_PART_MAIN);
@@ -823,7 +852,7 @@ lvgl:
widgets:
- label:
align: CENTER
text: "Reset All"
text: "Reset All"
text_color: 0xFFFFFF
text_font: font_tiny
- button:
@@ -1002,7 +1031,7 @@ lvgl:
widgets:
- label:
align: CENTER
text: "Reset"
text: "Reset"
text_color: 0xFFFFFF
text_font: font_small
- button:
@@ -1018,7 +1047,7 @@ lvgl:
widgets:
- label:
align: CENTER
text: "Home"
text: "Home"
text_color: 0xFFFFFF
text_font: font_small
@@ -1277,7 +1306,7 @@ lvgl:
widgets:
- label:
align: CENTER
text: "Reset"
text: "Reset"
text_color: 0xFFFFFF
text_font: font_small
- button:
@@ -1293,7 +1322,7 @@ lvgl:
widgets:
- label:
align: CENTER
text: "Home"
text: "Home"
text_color: 0xFFFFFF
text_font: font_small
@@ -1516,7 +1545,7 @@ lvgl:
widgets:
- label:
align: CENTER
text: "Reset"
text: "Reset"
text_color: 0xFFFFFF
text_font: font_small
- button:
@@ -1532,7 +1561,7 @@ lvgl:
widgets:
- label:
align: CENTER
text: "Home"
text: "Home"
text_color: 0xFFFFFF
text_font: font_small