Hello all,
I am trying to make the Voice Assistant work, but have had no luck till now. I use ESP32 Wroom.
The base I start with is the video of Everything Smart Home
and its code published on Code link
The HA settings are done as explained and indeed I do have the speaker cracking, however, I tried also the reviewed configurations in the discussions but nothing works.
I would appreciate it if you could help me with some suggestions about this or any other configuration.
I tried many that are online, but no luck, also I changed the AMP and the mic, just in case they are not working, same result.
On the other hand, with the Max98357 i successfully make the media player.
VA code and schematic I am stuck with:
substitutions:
device_name: voice-assistant-lab
friendly_name: Voice Assistant Lab
device_description: "Voice Assistant Lab ESP WROOM 32"
esphome:
name: ${device_name}
comment: ${device_description}
friendly_name: ${friendly_name}
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: esp32dev
framework:
type: esp-idf
version: recommended
logger:
api:
encryption:
key: !apipass
ota:
- platform: esphome
password: !otapass
wifi:
enable_rrm: true
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.0.163
subnet: 255.255.255.0
gateway: 192.168.0.1
i2s_audio:
i2s_lrclk_pin: GPIO27
i2s_bclk_pin: GPIO26
microphone:
- platform: i2s_audio
id: mic
adc_type: external
i2s_din_pin: GPIO13
pdm: false
speaker:
- platform: i2s_audio
id: big_speaker
dac_type: external
i2s_dout_pin: GPIO25
mode: mono
voice_assistant:
microphone: mic
use_wake_word: false
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 2.0
speaker: big_speaker
id: assist
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(assist).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(assist).set_use_wake_word(false);
This is the code i successfully made my media player.
esphome:
name: media-player-lab
friendly_name: Media Player Lab
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: !apipass2
ota:
- platform: esphome
password: !otapass2
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.0.162
subnet: 255.255.255.0
gateway: 192.168.0.1
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Media-Player-Lab"
password: !appass2
captive_portal:
i2s_audio:
i2s_lrclk_pin: GPIO25 #WS / LRC
i2s_bclk_pin: GPIO26 #SCK /BCLK
media_player:
- platform: i2s_audio
name: "Media Player Lab"
dac_type: external
i2s_dout_pin: GPIO27
mode: mono
switch:
- platform: restart
name: "Media Player Lab Reboot"
id: reboot_media_player_lab_reboot
sensor:
- platform: wifi_signal
name: "Media Player Lab WiFi Signal Sensor"
update_interval: 60s