From 5638ad9a1938adaab149f402f7d03aea27ca610a Mon Sep 17 00:00:00 2001 From: Kevin Ahrendt Date: Tue, 24 Dec 2024 07:58:55 -0500 Subject: [PATCH] remove adf dependency --- esp32-s3-box-3/esp32-s3-box-3.yaml | 61 ++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/esp32-s3-box-3/esp32-s3-box-3.yaml b/esp32-s3-box-3/esp32-s3-box-3.yaml index 30786f8..fea85d6 100644 --- a/esp32-s3-box-3/esp32-s3-box-3.yaml +++ b/esp32-s3-box-3/esp32-s3-box-3.yaml @@ -36,7 +36,7 @@ substitutions: esphome: name: ${name} friendly_name: ${friendly_name} - min_version: 2024.9.0 + min_version: 2025.1.0 name_add_mac_suffix: true platformio_options: board_build.flash_mode: dio @@ -61,21 +61,12 @@ esp32: CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y" CONFIG_ESP32S3_DATA_CACHE_64KB: "y" CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y" - CONFIG_AUDIO_BOARD_CUSTOM: "y" - CONFIG_ESP32_S3_BOX_3_BOARD: "y" - components: - - name: esp32_s3_box_3_board - source: github://jesserockz/esp32-s3-box-3-board@main - refresh: 0s psram: mode: octal speed: 80MHz external_components: - - source: github://pr#5230 - components: esp_adf - refresh: 0s - source: github://jesserockz/esphome-components components: [file] refresh: 0s @@ -141,16 +132,46 @@ light: restore_mode: RESTORE_DEFAULT_ON default_transition_length: 250ms -esp_adf: - board: esp32s3box3 +i2c: + scl: GPIO18 + sda: GPIO8 + +i2s_audio: + - id: i2s_audio_bus + i2s_lrclk_pin: GPIO45 + i2s_bclk_pin: GPIO17 + i2s_mclk_pin: GPIO2 + +audio_dac: + - platform: es8311 + id: es8311_dac + bits_per_sample: 16bit + sample_rate: 16000 + +es7210: + id: es7210_adc + bits_per_sample: 16bit + sample_rate: 16000 microphone: - - platform: esp_adf + - platform: i2s_audio id: box_mic + sample_rate: 16000 + i2s_din_pin: GPIO16 + bits_per_sample: 16bit + adc_type: external + speaker: - - platform: esp_adf + - platform: i2s_audio id: box_speaker + i2s_dout_pin: GPIO15 + dac_type: external + sample_rate: 16000 + bits_per_sample: 16bit + channel: left + audio_dac: es8311_dac + buffer_duration: 1000ms # The timer finished audio needs to fit entirely in the buffer micro_wake_word: models: @@ -166,7 +187,6 @@ voice_assistant: noise_suppression_level: 2 auto_gain: 31dBFS volume_multiplier: 2.0 - vad_threshold: 3 on_listening: - lambda: id(voice_assistant_phase) = ${voice_assist_listening_phase_id}; - text_sensor.template.publish: @@ -255,6 +275,11 @@ voice_assistant: condition: switch.is_on: timer_ringing then: + # Ensure the speaker starts before trying to send the timer finished audio + - lambda: id(box_speaker).start(); + - wait_until: + condition: + speaker.is_playing: - lambda: id(box_speaker).play(id(timer_finished_wave_file), sizeof(id(timer_finished_wave_file))); - delay: 1s - wait_until: @@ -452,6 +477,12 @@ script: - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; switch: + - platform: gpio + name: "Speaker Enable" + pin: GPIO46 + restore_mode: RESTORE_DEFAULT_ON + entity_category: config + disabled_by_default: true - platform: template name: Mute id: mute