add esphome tab5
All checks were successful
Podman DDNS Image / build-and-push-ddns (push) Successful in 1m0s

This commit is contained in:
2026-03-16 09:55:31 -04:00
parent 875795a409
commit acf6421b53
7 changed files with 64 additions and 46 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 430 KiB

Binary file not shown.

View File

@@ -43,6 +43,17 @@ ota:
wifi: wifi:
ssid: !secret wifi_ssid ssid: !secret wifi_ssid
password: !secret wifi_password password: !secret wifi_password
on_connect:
- lvgl.label.update:
id: lbl_status
text: "IDLE"
- select.set:
id: dac_output
option: "LINE1"
on_disconnect:
- lvgl.label.update:
id: lbl_status
text: "DISCONNECTED"
i2c: i2c:
- id: bsp_bus - id: bsp_bus
@@ -103,6 +114,7 @@ switch:
pin: pin:
pi4ioe5v6408: pi4ioe2 pi4ioe5v6408: pi4ioe2
number: 7 number: 7
restore_mode: ALWAYS_ON
- platform: gpio - platform: gpio
id: wifi_antenna_int_ext id: wifi_antenna_int_ext
pin: pin:
@@ -159,8 +171,8 @@ sensor:
lambda: |- lambda: |-
float voltage = id(battery_voltage).state; float voltage = id(battery_voltage).state;
// Adjust these values based on your battery's actual min/max voltage // Adjust these values based on your battery's actual min/max voltage
float min_voltage = 6.0; // Discharged voltage float min_voltage = 6.75; // Discharged voltage
float max_voltage = 8.23; // Fully charged voltage float max_voltage = 8.2; // Fully charged voltage
float percentage = (voltage - min_voltage) / (max_voltage - min_voltage) * 100.0; float percentage = (voltage - min_voltage) / (max_voltage - min_voltage) * 100.0;
if (percentage > 100.0) return 100.0; if (percentage > 100.0) return 100.0;
if (percentage < 0.0) return 0.0; if (percentage < 0.0) return 0.0;
@@ -168,6 +180,14 @@ sensor:
update_interval: 60s update_interval: 60s
unit_of_measurement: "%" unit_of_measurement: "%"
accuracy_decimals: 1 accuracy_decimals: 1
id: battery_percent
on_value:
then:
- lvgl.label.update:
id: lbl_battery
text:
format: "Battery: %.1f%"
args: ["id(battery_percent).state"]
touchscreen: touchscreen:
- platform: st7123 - platform: st7123
@@ -221,16 +241,26 @@ light:
default_transition_length: 250ms default_transition_length: 250ms
initial_state: initial_state:
brightness: "100%" brightness: "100%"
- platform: lvgl
widget: listen_led_widget image:
name: LVGL light defaults:
id: listen_led type: rgb565
transparency: alpha_channel
resize: 512x512
byte_order: little_endian
images:
- file: "images/va_idle.png"
id: va_idle
- file: "images/va_listen.png"
id: va_listen
- file: "images/va_speak.png"
id: va_speak
lvgl: lvgl:
byte_order: little_endian byte_order: little_endian
on_idle: on_idle:
timeout: 60s timeout: 120s
then: then:
- logger.log: "LVGL is idle" - logger.log: "LVGL is idle"
- light.turn_off: - light.turn_off:
@@ -238,31 +268,35 @@ lvgl:
transition_length: 15s transition_length: 15s
- lvgl.pause: - lvgl.pause:
widgets: widgets:
- led: - image:
id: listen_led_widget id: listen_icon_widget
src: va_idle
align: CENTER align: CENTER
color: 0xFF0000
brightness: 0%
height: 100px
width: 100px
- label: - label:
align: TOP_MID align: TOP_MID
id: lbl_status id: lbl_status
text_font: montserrat_48 text_font: montserrat_48
text: "IDLE" text: "CONNECTING..."
- label: - label:
align: BOTTOM_LEFT align: BOTTOM_LEFT
id: lbl_version id: lbl_version
text_font: montserrat_12 text_font: montserrat_12
text: "v0.1" text: "v0.5"
- label:
align: BOTTOM_RIGHT
id: lbl_battery
text_font: montserrat_28
text: Loading...
# The DAC Output select needs to be manually (or with an automation) changed to `LINE1` for the onboard speaker # The DAC Output select needs to be manually (or with an automation) changed to `LINE1` for the onboard speaker
select: select:
- platform: es8388 - platform: es8388
dac_output: dac_output:
name: DAC Output name: DAC Output
id: dac_output
adc_input_mic: adc_input_mic:
name: ADC Input Mic name: ADC Input Mic
id: adc_input
- platform: template - platform: template
id: wifi_antenna_select id: wifi_antenna_select
@@ -339,44 +373,29 @@ voice_assistant:
media_player: tab5_media_player media_player: tab5_media_player
micro_wake_word: mww micro_wake_word: mww
on_listening: on_listening:
- if: - logger.log: "LVGL resuming"
condition: lvgl.is_paused - lvgl.resume:
then: - light.turn_on: backlight
- logger.log: "LVGL resuming" - lvgl.image.update:
- lvgl.resume: id: listen_icon_widget
- light.turn_on: backlight src: va_listen
- light.turn_on:
id: listen_led
brightness: 100%
red: 0%
green: 100%
blue: 0%
effect: "None`"
- lvgl.label.update: - lvgl.label.update:
id: lbl_status id: lbl_status
text: "LISTENING" text: "LISTENING"
on_stt_vad_end: on_stt_vad_end:
- light.turn_on:
id: listen_led
brightness: 100%
red: 0%
green: 0%
blue: 100%
effect: "None"
- lvgl.label.update: - lvgl.label.update:
id: lbl_status id: lbl_status
text: "PROCESSING" text: "PROCESSING"
- lvgl.image.update:
id: listen_icon_widget
src: va_idle
on_tts_start: on_tts_start:
- light.turn_on:
id: listen_led
brightness: 100%
red: 100%
green: 0%
blue: 0%
effect: "None"
- lvgl.label.update: - lvgl.label.update:
id: lbl_status id: lbl_status
text: "RESPONDING" text: "RESPONDING"
- lvgl.image.update:
id: listen_icon_widget
src: va_speak
on_end: on_end:
# Wait a short amount of time to see if an announcement starts # Wait a short amount of time to see if an announcement starts
- wait_until: - wait_until:
@@ -391,13 +410,12 @@ voice_assistant:
- not: - not:
speaker.is_playing: speaker.is_playing:
- micro_wake_word.start: - micro_wake_word.start:
- lvgl.led.update:
id: listen_led_widget
color: 0x000000
brightness: "0%"
- lvgl.label.update: - lvgl.label.update:
id: lbl_status id: lbl_status
text: "IDLE" text: "IDLE"
- lvgl.image.update:
id: listen_icon_widget
src: va_idle
- light.turn_off: - light.turn_off:
id: backlight id: backlight
transition_length: 15s transition_length: 15s