Update kinderhandy

This commit is contained in:
2026-01-17 20:10:29 +01:00
parent 37e387f0e1
commit 7ebfa6a5e0
2 changed files with 199 additions and 82 deletions

View File

@@ -16,7 +16,7 @@ api:
ota: ota:
password: !secret ota_password password: !secret ota_password
platform: esphome
external_components: external_components:
- source: - source:
@@ -108,7 +108,7 @@ packages:
file: "modbus_relay.yaml" file: "modbus_relay.yaml"
vars: vars:
cid: relayboard32 cid: relayboard32
name: "ventil-sprinkler-westen" name: "defekt"
dev_addr: 0x1 dev_addr: 0x1
register_addr: 0x03 register_addr: 0x03
relay04: !include relay04: !include
@@ -139,6 +139,13 @@ packages:
name: "ventil-brunnen-in-zisterne" name: "ventil-brunnen-in-zisterne"
dev_addr: 0x1 dev_addr: 0x1
register_addr: 0x07 register_addr: 0x07
relay08: !include
file: "modbus_relay.yaml"
vars:
cid: relayboard32
name: "ventil-sprinkler-westen"
dev_addr: 0x1
register_addr: 0x08
#--- obere reihe #--- obere reihe
relay29: !include relay29: !include
file: "modbus_relay.yaml" file: "modbus_relay.yaml"

View File

@@ -21,7 +21,13 @@ logger:
api: api:
encryption: encryption:
key: !secret api_encryption_key key: !secret api_encryption_key
actions:
- action: rtttl_play
variables:
song_str: string
then:
- rtttl.play:
rtttl: !lambda 'return song_str;'
wifi: wifi:
ssid: WLAN ssid: WLAN
password: !secret wifi_password password: !secret wifi_password
@@ -53,6 +59,9 @@ output:
- platform: ledc - platform: ledc
pin: GPIO21 pin: GPIO21
id: backlight_pwm id: backlight_pwm
- platform: ledc
pin: GPIO1
id: buzzer_output
display: display:
- platform: ili9xxx - platform: ili9xxx
@@ -61,7 +70,8 @@ display:
cs_pin: GPIO15 cs_pin: GPIO15
dc_pin: GPIO2 dc_pin: GPIO2
invert_colors: false invert_colors: false
color_palette: 8BIT auto_clear_enabled: false
update_interval: never
# Set up the xpt2046 touch platform # Set up the xpt2046 touch platform
touchscreen: touchscreen:
@@ -129,26 +139,88 @@ number:
# Display # Display
# ============================================================ # ============================================================
font:
- file: "fonts/RobotoCondensed-Regular.ttf"
id: roboto_icons_42
size: 42
bpp: 4
extras:
- file: "fonts/materialdesignicons-webfont.ttf"
glyphs: [
"\U000F0335", # mdi-lightbulb
"\U000F0954", # mdi-clock
"\U000F0142", # mdi-chevron-right
"\U000F004C", # mdi-bed
"\U000F0761", # mdi-window-shutter-open
"\U000F075E", # mdi-window-shutter
]
lvgl: lvgl:
on_idle: on_idle:
timeout: !lambda "return (id(display_timeout).state * 1000);" timeout: !lambda "return id(timer_running) ? 60 * 5 * 1000: (id(display_timeout).state * 1000);"
then: then:
- logger.log: "LVGL is idle" - logger.log: "LVGL is idle"
- light.turn_off: display_backlight - light.turn_off: display_backlight
- lvgl.pause: - lvgl.pause:
buffer_size: 50% buffer_size: 50%
style_definitions:
- id: header_footer
bg_color: 0x2F8CD8
bg_grad_color: 0x005782
bg_grad_dir: VER
bg_opa: COVER
border_opa: TRANSP
border_width: 0
outline_width: 0
radius: 0
pad_all: 0
pad_row: 0
pad_column: 0
border_color: 0x0077b3
text_color: 0xFFFFFF
width: 100%
height: 60
top_layer:
widgets:
- buttonmatrix:
align: bottom_mid
styles: header_footer
pad_all: 0
outline_width: 0
id: top_layer
items:
styles: header_footer
text_font: roboto_icons_42
rows:
- buttons:
- id: page_light
text: "\U000F0335"
on_press:
then:
- lvgl.page.show: kinderzimmer_page
- id: page_timer
text: "\U000F0954"
on_press:
then:
- lvgl.page.show: timer_page
pages:
- id: timer_page
widgets: widgets:
- label: - label:
align: TOP_MID align: TOP_MID
y: 10 y: 10
text: "Lukas und Hannas\nZahnputz Timer" text: "Lukas und Hannas\nZahnputz Timer"
text_font: montserrat_20 text_font: montserrat_20
text_align: CENTER
- container: - container:
id: arc_container id: arc_container
align: CENTER align: CENTER
y: 20 y: 15
width: 240 width: 200
height: 240 height: 200
on_press: on_press:
then: then:
- if: - if:
@@ -163,7 +235,7 @@ lvgl:
- lvgl.arc.update: - lvgl.arc.update:
id: arc_timer id: arc_timer
indicator: indicator:
arc_color: 0x0000EE arc_color: 0x888888
else: else:
- globals.set: - globals.set:
id: timer_running id: timer_running
@@ -197,8 +269,8 @@ lvgl:
- arc: - arc:
id: arc_timer id: arc_timer
align: CENTER align: CENTER
width: 220 width: 180
height: 220 height: 180
min_value: 0 min_value: 0
max_value: 120 max_value: 120
value: 0 value: 0
@@ -215,6 +287,32 @@ lvgl:
text_font: montserrat_28 text_font: montserrat_28
text: "02:00" text: "02:00"
- id: kinderzimmer_page
widgets:
- label:
align: TOP_MID
y: 10
text: "Kinderzimmer"
text_font: montserrat_20
text_align: CENTER
- buttonmatrix:
align: CENTER
width: 280
height: 200
items:
text_font: roboto_icons_42
rows:
- buttons:
- id: btn_shelf_light
text: "\U000F0335"
- id: btn_cover_open
text: "\U000F0761"
- buttons:
- id: btn_cover_close
text: "\U000F075E"
- id: btn_bed
text: "\U000F004C"
interval: interval:
- interval: 1s - interval: 1s
then: then:
@@ -270,3 +368,15 @@ interval:
indicator: indicator:
arc_color: 0x00FF00 arc_color: 0x00FF00
# Buzzer
rtttl:
output: buzzer_output
id: my_buzzer_rtttl
gain: 60%
on_finished_playback:
- logger.log: 'Song ended!'
#Entchen:d=4,o=5,b=120:c,d,e,f,2g,2g,a,a,a,a,1g,a,a,a,a,1g,f,f,f,f,2e,2e,g,g,g,g,1c
#MissionImp:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,a#,g,2d,32p,a#,g,2c#,32p,a#,g,2c,a#5,8c,2p,32p,a#5,g5,2f#,32p,a#5,g5,2f,32p,a#5,g5,2e,d#,8d