Hi everyone,
i connected a speaker to my esphome project via a MAX98357A. i use the this project as a voice assistant satellite.
Everything is working but after booting but before the first response from the voice assistant, the speaker makes strange noises.
i try to post my yaml but its a bit tricky because i use packages and substitutions.
esphome:
name: esphome-web-6fe1d4
friendly_name: DeepThought
min_version: 2025.9.0
name_add_mac_suffix: false
esp32:
variant: esp32
framework:
type: esp-idf
# Enable logging
logger:
# Enable Home Assistant API
api:
# Allow Over-The-Air updates
ota:
- platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
substitutions:
<<: !include substitutions.yaml
dht_name: "Deepthought"
update_interval: 60s
# lambda: |-
# it.printf(0, 0, "Test: %.1fC", id(ha_temp).state);
# it.printf(0, 1, "Deep Thought");
packages:
dht_sensor: !include packages/dht22.yaml
wifisignal: !include packages/wifisignal.yaml
ledcoutput: !include packages/singleled.yaml
i2c: !include packages/i2c.yaml
lcd_display: !include packages/i2c_16x2_lcd.yaml
lcd_textsensor_2line: !include packages/lcd_textsensor_2line.yaml
i2s_audio: !include packages/i2s_audio.yaml
microphone: !include packages/microphone.yaml
speaker: !include packages/speaker.yaml
light:
- platform: monochromatic
name: "Assistant LED"
output: led_output
id: assistant_led
voice_assistant:
microphone: mic_i2s
id: va
noise_suppression_level: 2
# auto_gain: 31dBFS
# volume_multiplier: 20.0
use_wake_word: True
speaker: my_speaker
on_error:
- if:
condition:
switch.is_on: use_wake_word
then:
- switch.turn_off: use_wake_word
- switch.turn_on: use_wake_word
on_client_connected:
- speaker.volume_set: 100%
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
on_client_disconnected:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.stop:
# >>> LED-Steuerung <<<
on_listening:
- light.turn_on: assistant_led
on_tts_start:
- light.turn_on: assistant_led
on_tts_end:
- light.turn_off: assistant_led
on_end:
- light.turn_off: assistant_led
binary_sensor:
- platform: status
name: API Connection
id: api_connection
filters:
- delayed_on: 1s
on_press:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.start_continuous:
on_release:
- if:
condition:
switch.is_on: use_wake_word
then:
- voice_assistant.stop:
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
on_turn_off:
- voice_assistant.stop
sensor:
- platform: homeassistant
entity_id: sensor.esphome_web_6fe1d4_deepthought_temperature
id: ha_temp
speaker package:
speaker:
- platform: ${speaker_platform}
id: my_speaker
dac_type: ${speaker_dac_type}
i2s_dout_pin: ${speaker_i2s_dout_pin} #DIN
i2s_audio_id: ${speaker_i2s_audio_id}
i2s_mode: ${speaker_i2s_mode}
after the first response of the voice assistant the noise is off and from then on it works nicely, so i need help to “start” the speaker with a noise or something from home assistant that it stops the noise.
i hope that i was clear my english is not the best.