Esphome box3 builder

From nodnarbnitram/claude-code-extensions · View interactive version

Esphome box3 builder is an AI agent skill from the GitHub repository nodnarbnitram/claude-code-extensions. This skill should be used when the user asks to "configure esp32-s3-box-3", "set up box-3", "create box-3 voice assistant", "display lambda on box-3", "configure ili9xxx display", "set up gt911 touch", "configure i2s audio", "es7210 microphone", "es8311 speaker", "box-3 audio pipeline", or mentions

How to use this skill

Skill file

ESP32-S3-BOX-3 Builder Skill

Specialist skill for ESP32-S3-BOX-3 hardware providing complete configuration templates, display lambda cookbook, touch interaction patterns, and voice assistant integration for complex audio/display/touch projects.

Purpose

This skill accelerates ESP32-S3-BOX-3 development by providing:

Use this skill for ESP32-S3-BOX-3 specific projects. For general ESPHome configuration, use the esphome-config-helper skill instead.

When to Use This Skill

Use this skill when:

Delegate to specialized ESPHome agents for:

Hardware Overview

The ESP32-S3-BOX-3 is a complete development kit with:

Critical Requirements:

For complete hardware specifications, consult:

Configuration Templates

Available Templates

Located in templates/ directory:

  1. box3-base.yaml - Hardware initialization foundation
  1. box3-voice.yaml - Complete voice assistant
  1. box3-display-ui.yaml - Multi-page touchscreen UI
  1. box3-audio-player.yaml - Music/media player

Using Templates

To use a template:

  1. Read the appropriate template file
  2. Customize device name, WiFi credentials
  3. Adjust UI elements, colors, fonts as needed
  4. Flash using BOX-3 specific script (see Scripts section)

Template Workflow:

# 1. Read template
cat ${CLAUDE_PLUGIN_ROOT}/skills/esphome-box3-builder/templates/box3-voice.yaml

# 2. Copy to project
cp ${CLAUDE_PLUGIN_ROOT}/skills/esphome-box3-builder/templates/box3-voice.yaml my-box3.yaml

# 3. Edit device-specific values
# - Update device name
# - Set WiFi credentials (use secrets.yaml)
# - Customize wake word model if desired
# - Adjust display text and layout

# 4. Flash with BOX-3 script
${CLAUDE_PLUGIN_ROOT}/skills/esphome-box3-builder/scripts/flash-box3.sh my-box3.yaml

Display Lambda Rendering

Lambda Rendering Cookbook

For complete display lambda examples and patterns, consult:

Quick Display Patterns

Basic Text Display:

it.printf(160, 10, id(roboto_16), TextAlign::TOP_CENTER, "ESP32-S3-BOX-3");

Filled Rectangle (Card Background):

it.filled_rectangle(10, 30, 300, 80, COLOR_PRIMARY);

Multi-Line Text:

it.printf(20, 40, id(roboto_12), "Temperature: %.1f°C", id(temp_sensor).state);
it.printf(20, 60, id(roboto_12), "Humidity: %.1f%%", id(humidity_sensor).state);

Icon Rendering (Material Design Icons):

// Requires MDI font in assets/fonts/
it.printf(30, 100, id(mdi_icons_24), "\U000F0425");  // thermometer icon

Material Design UI Components

For Material Design color schemes, typography, and layouts, consult:

Font Integration

Required fonts are in assets/fonts/:

Font Configuration:

font:
  - file: ${CLAUDE_PLUGIN_ROOT}/skills/esphome-box3-builder/assets/fonts/Roboto-Regular.ttf
    id: roboto_16
    size: 16

  - file: ${CLAUDE_PLUGIN_ROOT}/skills/esphome-box3-builder/assets/fonts/materialdesignicons-webfont.ttf
    id: mdi_icons_24
    size: 24
    glyphs: [
      "\U000F0425",  # thermometer
      "\U000F050F",  # water-percent
      "\U000F0493",  # play
      "\U000F03E4",  # pause
    ]

Icon codepoints reference: assets/fonts/mdi-codepoints.txt

Touch Interaction Patterns

Touch Configuration

For complete touch patterns and gesture detection, consult:

Quick Touch Patterns

Touch Button Zone:

binary_sensor:
  - platform: touchscreen
    name: "Button 1"
    x_min: 10
    x_max: 150
    y_min: 200
    y_max: 230
    on_press:
      - logger.log: "Button 1 pressed"

Page Navigation:

binary_sensor:
  - platform: touchscreen
    name: "Next Page"
    x_min: 240
    x_max: 310
    y_min: 200
    y_max: 230
    on_press:
      - lambda: |-
          id(current_page) = (id(current_page) + 1) % 3;
          id(box3_display).show_page(id(current_page));

Audio Pipeline Configuration

I²S Audio Setup

Shared I²S Bus (LRCLK=GPIO45, BCLK=GPIO17, MCLK=GPIO2):

i2s_audio:
  - id: i2s_shared
    i2s_lrclk_pin: GPIO45
    i2s_bclk_pin: GPIO17
    i2s_mclk_pin: GPIO2

ES7210 Microphone ADC (16kHz, GPIO16):

audio_adc:
  - platform: es7210
    id: es7210_adc
    bits_per_sample: 16bit
    sample_rate: 16000
    mic_gain: 24DB
    address: 0x40

microphone:
  - platform: i2s_audio
    adc_type: external
    i2s_din_pin: GPIO16
    sample_rate: 16000

ES8311 Speaker DAC (48kHz, GPIO15, requires MCLK):

audio_dac:
  - platform: es8311
    id: es8311_dac
    bits_per_sample: 16bit
    sample_rate: 48000
    use_mclk: true  # Required
    address: 0x18

speaker:
  - platform: i2s_audio
    dac_type: external
    i2s_dout_pin: GPIO15
    sample_rate: 48000
    buffer_duration: 100ms  # Prevents audio popping

Voice Assistant Integration

Wake Word Configuration

micro_wake_word (on-device detection):

micro_wake_word:
  models:
    - model: okay_nabu  # or hey_jarvis, alexa, hey_mycroft

Voice Assistant Pipeline:

voice_assistant:
  microphone: box_mic
  speaker: box_speaker
  noise_suppression_level: 1
  auto_gain: 31dBFS
  volume_multiplier: 2.0

  on_listening:
    - logger.log: "Listening..."

  on_tts_start:
    - logger.log: "Speaking..."

  on_end:
    - logger.log: "Done"

Audio Ducking

Nabu Media Player (30dB reduction during voice):

media_player:
  - platform: nabu
    name: "Media Player"
    on_play:
      - media_player.volume_set:
          volume: 70%  # Reduce to 70% when voice assistant active

Scripts and Utilities

BOX-3 Flashing Script

The validation and flashing utility provides BOX-3 specific workflow:

Script: scripts/flash-box3.sh

Usage:

# Validate, compile, and flash BOX-3
${CLAUDE_PLUGIN_ROOT}/skills/esphome-box3-builder/scripts/flash-box3.sh my-box3.yaml

# The script runs:
# 1. Validates configuration
# 2. Compiles firmware with BOX-3 optimizations
# 3. Flashes via USB (auto-detects /dev/ttyACM0 or /dev/ttyUSB0)
# 4. Monitors logs after flash

Troubleshooting BOX-3 Issues

Common BOX-3 Errors

I²S DMA Buffer Error:

Touch Not Responding:

Display Flicker:

Audio Popping:

PSRAM Not Detected:

Voice Assistant Crashes:

UI Freezing During OTA:

For complete BOX-3 troubleshooting, consult:

Configuration Best Practices

PSRAM Configuration (Critical)

Always include explicit PSRAM config (2025.2+ requirement):

psram:
  mode: octal  # BOX-3 has 16MB Octal PSRAM
  speed: 80MHz

ESP-IDF Framework (Recommended)

Use ESP-IDF over Arduino for BOX-3:

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    advanced:
      execute_from_psram: true  # Prevents UI freezing during OTA

Display Configuration

16-bit color requires PSRAM:

display:
  - platform: ili9xxx
    model: S3BOX
    color_palette: NONE  # Requires PSRAM (2025.2+)
    # ...

Touch Configuration

Shared reset pin with display:

touchscreen:
  - platform: gt911
    reset_pin:
      number: GPIO48
      inverted: true  # Shared with display reset
    interrupt_pin:
      number: GPIO3
      ignore_strapping_warning: true

Integration with Other Skills and Agents

When to Use Other Resources

Additional Resources

Reference Files

For detailed BOX-3 information, consult:

Template Files

Complete working BOX-3 configurations in templates/:

Asset Files

Material Design resources in assets/:

Utility Scripts

Validation and flashing tools in scripts/:

Quick Start Workflow

For new ESP32-S3-BOX-3 project:

  1. Select template based on project type (base, voice, display-ui, audio-player)
  2. Copy template to project directory
  3. Customize configuration:
  1. Add custom features using references (display-lambdas.md, touch-patterns.md)
  2. Validate and flash using scripts/flash-box3.sh
  3. Monitor logs and troubleshoot if needed using reference guides

For adding to existing BOX-3 config:

  1. Consult references for specific feature (display, touch, audio)
  2. Copy relevant code from templates
  3. Integrate with existing config
  4. Test incrementally (add one feature at a time)
  5. Validate before final flash

This skill provides rapid BOX-3 development for complex audio/display/touch projects. For general ESPHome configuration or deep technical questions, use the esphome-config-helper skill or delegate to ESPHome specialist agents.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.