I am having trouble getting my ESP voice assistant to work.
It seems to be set up correctly as I get the static on the speaker after boot, but if I check my logs it only gets as far as :[C][api:173]: Using noise encryption: YES"
Looking at others logs like this one Logs I don’t get the “state changed from idle”
I’ve set up and configured Whisper, Openwakeword and Piper.
Is the issue possibly in my code?
esphome:
name: voice-assistant-1
friendly_name: Voice assistant 1
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: *****
ota:
- platform: esphome
password: *****
wifi:
ssid: I ❤️ my WiFi
password: ******
manual_ip:
static_ip: 192.168.0.136
gateway: 192.168.0.1
subnet: 255.255.255.0
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Voice-Assistant-1"
password: "1PFW9o4nvxbf"
captive_portal:
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO26 #WS / LRC
i2s_bclk_pin: GPIO25 #SCK /BCLK
microphone:
- platform: i2s_audio
adc_type: external
pdm: false
id: mic_i2s
channel: left
bits_per_sample: 32bit
i2s_audio_id: i2s_in
i2s_din_pin: GPIO33 #SD
speaker:
- platform: i2s_audio
id: my_speaker
dac_type: external
i2s_dout_pin: GPIO27 #DIN
channel: mono
i2s_audio_id: i2s_in
voice_assistant:
microphone: mic_i2s
id: va
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 4.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:
- 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:
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
- lambda: id(va).set_use_wake_word(false);