This is a fully refactored ESPHome firmware for the ESP32-S3-Box3, utilizing yglu for templating to eliminate code duplication. All visual controls are now modularly described in a separate section, allowing easier customization and maintenance. This project is based on the original implementation available at ESP32-S3-Box3-Custom-ESPHome.
- Home Assistant Dashboard: The device functions as a touch-enabled dashboard for Home Assistant.
- Media Player: Improved volume control and the ability to stream media.
- Voice Assistant: Supports both on-device wake word detection and Home Assistant wake word engines.
- Sensor Display & Control: Integrated temperature, humidity, and motion sensors.
- Customizable Touch Controls: Define buttons and layouts dynamically using templates.
The refactored configuration introduces structured UI elements:
buttons: !-
- id: status_bar_title <not clickable>
draw:
- "it.printf(123, 10, id(my_font3), blue, COLOR_OFF, TextAlign::LEFT, \"%.1f°%.0f\", id(temperature_bedroom).has_state() ? id(temperature_bedroom).state : 0, id(co2_bedroom).has_state() ? id(co2_bedroom).state : 0);"
- id: status_bar_mute_switch <clickable>
x: 80
y: 5
w: 35
h: 35
font: icon_font_35
on_click:
- switch.toggle: mute_switch
- component.update: s3_box_lcd
draw:
- "if(id(mute_switch).state) {"
- !? ($_.draw_icon)({id=>"status_bar_mute_switch", color=>"red", icon=>$_.icon_glyphs.mic_off})
- "} else {"
- !? ($_.draw_icon)({id=>"status_bar_mute_switch", color=>"lime", icon=>$_.icon_glyphs.mic_on})
- "}"Using a structured approach, pages are now defined with reusable buttons:
touch_pages: !-
- id: idle_page
buttons:
- status_bar_title
- status_bar_mute_switch
- status_bar_api_connection
- status_bar_wifi_connection
- status_bar_settings_button
- music_button
- scene_button
- current_time
- id: info_page
buttons:
- status_bar_title
- status_bar_mute_switch
- status_bar_api_connection
- status_bar_wifi_connection- ESPHome: Installed via Home Assistant add-on, CLI, or Docker.
- Python Virtual Environment: Required for template processing.
If you have make installed, simply run make run. This command will automatically set up a Python virtual environment in the .venv folder and execute all necessary steps to build and deploy the firmware.
To configure and use this firmware effectively:
- Ensure your Home Assistant setup is ready.
- Modify the button mappings according to your needs.
- Use the built-in modular templates to define new controls easily.
Contributions, feedback, and feature requests are welcome! Feel free to submit issues or pull requests.
If you find this project useful and would like to support future development: