ESP Home and ESP32 S3 Box?

I got mine from Amazon… Not cheap, but no shipping costs …

Care to share the link?

I can only find the lite version on amazon.de

I’ve checked… “Currently Not available”

But here’s the link:

1 Like

You can get it from https://eu.mouser.com/

I picked one up from ADAFruit and they were out of stock within a couple of days, hot item right now.

Have you managed to use it as a mic against HA Assist using your code? That has been my goal I started looking into and came across this post.

I just picked one up from Digikey (to the UK)
£43 total.

ok :slight_smile:
With the recent ESPHome Update, the Display for the Box is now implemented as Beta…

I got it working and the Box is now acting as Bluetooth-Proxy which displays a Clock… :slight_smile:
For now, I just not implemented Microphone, Speaker, Touch and the RGB-LED which comes with it, because in the current state it fits my main needs…everything else can be implemented later on…

Here’s my current config:

esphome:
  name: esp32-box
  friendly_name: ESP32 Box

esp32:
  board: esp32s3box
  framework:
    type: arduino

spi:
  clk_pin: GPIO7
  mosi_pin: GPIO6

light:
#  - platform: rgb
#    name: RGB LED
#    red: rgb_red
#    green: rgb_green
#    blue: rgb_blue
  - platform: monochromatic
    output: lcd_backlight
    name: "LCD Backlight"
    restore_mode: ALWAYS_ON

output:
#  - platform: ledc
#    id: rgb_red
#    pin: GPIO39
#  - platform: ledc
#    id: rgb_green
#    pin: GPIO40
#  - platform: ledc
#    id: rgb_blue
#    pin: GPIO41
  - platform: ledc
    pin: GPIO45
    id: lcd_backlight

display:
  - platform: ili9xxx
    model: S3BOX
    cs_pin: GPIO5
    dc_pin: GPIO4
    reset_pin: GPIO48
    id: lcd
    lambda: |-
      it.fill(Color(255, 255, 255));
      it.strftime(160, 85, id(font_time), Color::BLACK, TextAlign::CENTER, "%H:%M:%S", id(time_ha).now());
      it.strftime(160, 170, id(font_date), Color::BLACK, TextAlign::CENTER, "%d.%m.%Y", id(time_ha).now());

font:
  - file: "gfonts://Roboto"
    id: font_time
    size: 60
    glyphs: "0123456789:"
  - file: "gfonts://Roboto"
    id: font_date
    size: 50
    glyphs: "0123456789."
  - file: "gfonts://Roboto"
    id: font_small
    size: 20

time:
  - platform: homeassistant
    id: time_ha
    timezone: Europe/Berlin

# Enable Home Assistant API
api:
  encryption:
    key: xxxxx

ota:
  password: xxxxx

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32-Box Fallback Hotspot"
    password: xxxxx

bluetooth_proxy:
  active: true

button:
  - platform: restart
    name: "Restart Device"

text_sensor:
  - platform: wifi_info
    ip_address:
      name: IP Address
    ssid:
      name: Connected SSID
    bssid:
      name: Connected BSSID
    mac_address:
      name: Mac Wifi Address
    scan_results:
      name: Latest Scan Results

sensor:
  - platform: wifi_signal
    name: "WiFi Signal Sensor"
    update_interval: 60s

  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

captive_portal:

I kept the config for the RGB LED in it but commented it out - so if you are interested in it, you can easily use it :slight_smile:

8 Likes

How do you integrate the red circle?
Update: See esphome#4793 and the

binary_sensor:
  - platform: tt21100
    name: "Home"
    index: 0

I didn’t.
At least Not yet.

Does anyone here has a working config for ESP32 S3 Box Lite?

1 Like

I got my ESP32 S3 Lite working

esphome:
  name: esp-s3-box
  friendly_name: esp-s3-box

esp32:
  board: esp32s3box
  framework:
    type: arduino
    version: latest

external_components:
  - source: github://pr#4793
    components: [ tt21100 ]
  - source: github://pr#4861
    components: [ es8311 ]
  - source: github://rpatel3001/esphome@es7210
    components: [ es7210 ]

# Enable logging
logger:
  # CDC logging is currently not working on the S3
  # See https://github.com/espressif/esp-idf/commit/9924d9f27192a5fab5f66230c72249ecc6cad34c
  #hardware_uart: USB_CDC
  level: VERBOSE
  logs:
    esp32_ble: WARN
    esp32_ble_tracker: WARN
    ble_dist: WARN
    sensor: WARN
    ledc.output: WARN
    component: WARN
    ili9xxx: WARN
    tt21100: WARN
    touchscreen: WARN
    wifi: WARN
    es8311: WARN
    i2s_audio: VERBOSE
    voice_assistant: VERBOSE
    es7210: WARN

bluetooth_proxy:
  active: true

captive_portal:

time:
  - platform: homeassistant
    id: time_ha
    timezone: Europe/Amsterdam

spi:
  clk_pin: GPIO7
  mosi_pin: GPIO6

display:
  - platform: ili9xxx
    model: S3BOX_LITE
    cs_pin: GPIO5
    dc_pin: GPIO4
    reset_pin: GPIO48
    id: lcd
    # Width = 320, Height = 240
    pages:
      - id: page1
        lambda: |-
          it.strftime(160, 65, id(font_large), Color::WHITE, TextAlign::CENTER, "%H:%M:%S", id(time_ha).now());
          it.strftime(160, 115, id(font_medium), Color::WHITE, TextAlign::CENTER, "%a, %e %b", id(time_ha).now());

interval:
  - interval: 10s
    then:
      - display.page.show_next: lcd
      - component.update: lcd

font:
  - file: "gfonts://Roboto@500"
    id: font_large
    size: 70
    glyphs: "0123456789:APM."
  - file: "gfonts://Roboto@500"
    id: font_medium
    size: 30

sensor:
# Extra sensor to keep track of plug uptime
  - platform: uptime
    name: Uptime Sensor
    filters:
      - lambda: return x / 3600;
    unit_of_measurement: "hours"
    accuracy_decimals: 2
# Extra sensor for WiFi signal
  - platform: wifi_signal
    name: WiFi Sensor
    update_interval: 60s

i2c:
  scl: GPIO18
  sda: GPIO8
  scan: true
  frequency: 400kHz

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
    id: settings
    name: "Settings"

# i2c device at address 0x18 - ES8311 Audio Codec
# i2c device at address 0x24 - TT21100 Touchscreen
# i2c device at address 0x40 - ES7210 Mic ADC
# i2c device at address 0x68 - ICM-42607-P IMU

Hope this can help someone :slight_smile:

3 Likes

For some reason the backlight is working in the opposite way on the Lite

light:
  - platform: monochromatic
    name: "LCD Backlight"
    output: lcd_backlight

If you use

restore_mode: ALWAYS_ON

the display will stay black. For me at least

With the team releasing code for this device with the new voice assistant updates, have you moved to that code at all? I was planning on installing it but their example doesn’t include anything for the screen so I was thinkin gof adding in your section of code to do that. I was hoping to expand on it however to have the voice assistant conversation displayed as it responds (this is what my ESPbox currently does while running Willow). Have you looked into this at all?

1 Like

I did, but right now, it seems that neither the display nor the bluetooth proxy is working with this code.
It seems that there are some conflicts with the current implementation and the idf framework they are using.

I hope, that this will be sorted out in the comming weeks… (?)

If you add inverted: true to the output: section, it’ll fix this.

Full example:

output:
  - platform: ledc
    pin: GPIO45
    id: lcd_backlight
    inverted: true

light:
  - platform: monochromatic
    output: lcd_backlight
    name: "LCD Backlight"
    restore_mode: ALWAYS_ON

I got this working with the HA provided example, but yeah, the screen is unused. If anyone has a config i could use for inspiration, that would be amazing

1 Like

I’m not sure, if there is a working configuration at all… it might be, that the implementation has some conflicts with the different components…

I guess, we have to wait a bit until - maybe, some code for the ESP32-S3 Box 3 will be available… ?
This could probably be used for the older Box also…

This is a modified version of the HA example with some display config I pulled from someone in this thread and modified. I’ve yet to try adding bluetooth proxy to it.

substitutions:
  device_name: "esp32-s3-box0"
  name: "ESP32 S3 Box 0"
  description: ESP32 S3 Box Voice Assistant

packages:
  <<: !include_dir_named common

esphome:
  platformio_options:
    board_build.flash_mode: dio
  project:
    name: esphome.voice-assistant
    version: "1.0"
  min_version: 2023.10.0
  on_boot:
    - priority: -100
      then:
        - wait_until: api.connected
        - delay: 1s
        - if:
            condition:
              switch.is_on: use_wake_word
            then:
              - voice_assistant.start_continuous:

esp32:
  board: esp32s3box
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
      CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
      CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"

logger:
  hardware_uart: USB_SERIAL_JTAG

dashboard_import:
  package_import_url: github://esphome/firmware/voice-assistant/esp32-s3-box.yaml@main

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO1
      inverted: true
    name: "Mute"

  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: true
    name: Top Left Button
    disabled_by_default: true
    on_click:
      - if:
          condition:
            switch.is_off: use_wake_word
          then:
            - if:
                condition: voice_assistant.is_running
                then:
                  - voice_assistant.stop:
                  - script.execute: reset_led
                else:
                  - voice_assistant.start:
          else:
            - voice_assistant.stop
            - delay: 1s
            - script.execute: reset_led
            - script.wait: reset_led
            - voice_assistant.start_continuous:

output:
 # - platform: ledc
 #   id: rgb_red
 #   pin: GPIO39
 # - platform: ledc
 #   id: rgb_green
 #   pin: GPIO40
 # - platform: ledc
 #   id: rgb_blue
 #   pin: GPIO41
  - platform: ledc
    pin: GPIO45
    id: backlight_output

light:
 # - platform: rgb
 #   name: RGB LED
 #   red: rgb_red
 #   green: rgb_green
 #   blue: rgb_blue
  - platform: monochromatic
    output: backlight_output
    name: LCD Backlight
    id: led
    restore_mode: ALWAYS_OFF
    disabled_by_default: true
    default_transition_length: 0s
    effects:
      - pulse:
          #transition_length: 250ms
          #update_interval: 250ms
          transition_length: 250ms
          update_interval: 750ms
          min_brightness: 10%
          max_brightness: 75%
      - pulse:
          name: Fast Pulse
          transition_length: 50ms
          update_interval: 50ms

esp_adf:

microphone:
  - platform: esp_adf
    id: box_mic

speaker:
  - platform: esp_adf
    id: box_speaker

voice_assistant:
  id: va
  microphone: box_mic
  speaker: box_speaker
  use_wake_word: true
  noise_suppression_level: 2
  auto_gain: 31dBFS
  volume_multiplier: 2.0
  vad_threshold: 3
  on_listening:
    - light.turn_on:
        id: led
        brightness: 100%
        effect: pulse
  on_tts_start:
    - light.turn_on:
        id: led
        brightness: 75%
        effect: pulse
  on_end:
    - delay: 100ms
    - wait_until:
        not:
          speaker.is_playing:
    - script.execute: reset_led
  on_error:
    - light.turn_on:
        id: led
        brightness: 50%
        effect: fast_pulse
    - delay: 1s
    - script.execute: reset_led
    - script.wait: reset_led
    - lambda: |-
        if (code == "wake-provider-missing" || code == "wake-engine-missing") {
          id(use_wake_word).turn_off();
        }

script:
  - id: reset_led
    then:
      - if:
          condition:
            switch.is_on: use_wake_word
          then:
            - light.turn_on:
                id: led
                #brightness: 25%
                brightness: 50%
                effect: none
          else:
            - light.turn_off: led

switch:
  - platform: template
    name: Use wake word
    id: use_wake_word
    optimistic: true
    restore_mode: RESTORE_DEFAULT_ON
    entity_category: config
    on_turn_on:
      - lambda: id(va).set_use_wake_word(true);
      - if:
          condition:
            not:
              - voice_assistant.is_running
          then:
            - voice_assistant.start_continuous
      - script.execute: reset_led
    on_turn_off:
      - voice_assistant.stop
      - lambda: id(va).set_use_wake_word(false);
      - script.execute: reset_led

external_components:
  - source: github://pr#5230
    components: esp_adf
    refresh: 0s

psram:
  mode: octal
  speed: 80MHz

spi:
  clk_pin: GPIO7
  mosi_pin: GPIO6

color:
  - id: DARK_PURPLE
    hex: 582cb0
    #hex: 6432c8
  - id: LIGHT_PURPLE
    hex: a65dde

display:
  - platform: ili9xxx
    model: S3BOX
    cs_pin: GPIO5
    dc_pin: GPIO4
    reset_pin: GPIO48
    id: lcd
    lambda: |-
      //it.fill(Color(255, 255, 255));
      it.fill(Color(0, 0, 0));
      //it.strftime(160, 85, id(font_time), Color::BLACK, TextAlign::CENTER, "%I:%M:%S %p", id(time_ha).now());
      // time w/o seconds
      it.strftime(160, 85, id(font_time), Color::WHITE, TextAlign::CENTER, "%I:%M %p", id(time_ha).now());
      //it.strftime(160, 170, id(font_date), Color::BLACK, TextAlign::CENTER, "%Y-%m-%d", id(time_ha).now());
      it.strftime(160, 170, id(font_date), LIGHT_PURPLE, TextAlign::CENTER, "%Y-%m-%d", id(time_ha).now());

font:
  - file: "gfonts://Roboto"
    id: font_time
    size: 55
    #size: 60
    glyphs: "0123456789AMP:- "
  - file: "gfonts://Roboto"
    id: font_date
    size: 50
    glyphs: "0123456789.- "
  - file: "gfonts://Roboto"
    id: font_small
    size: 20

time:
  - platform: homeassistant
    id: time_ha
    #timezone: Europe/Berlin
1 Like

Thanks :slight_smile:
I will try it later today… I already tried to add the display - without BT Proxy at some point, but it didn’t work as expected… So maybe, there was just a config error somewhere… ?

I’ll update as soon as I have uploaded the config to the device and then I’ll come back with an info