RE: how to use AS ESP32-S3 voice assistant in home assistant - biofects - 12-10-2024
Ok, maybe someone can help me on 2 issues
1. I added volume control and still sounds really low. no mater on if I set it to 100 or not
2. I tried to add continuous conversation and that is not working
Code: esphome:
name: sarah
friendly_name: SARAH
platformio_options:
board_build.flash_mode: dio
on_boot:
- light.turn_on:
id: led_ww
red: 100%
green: 0.15
blue: 0.85
brightness: 50%
esp32:
board: esp32-s3-devkitc-1
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"
CONFIG_AUDIO_BOARD_CUSTOM: "y"
psram:
mode: octal # quad for N8R2 and octal for N16R8
speed: 80MHz
# Enable logging
logger:
hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
encryption:
key: "*********************"
on_client_connected:
then:
- delay: 50ms
- light.turn_on:
id: led_ww
red: 100%
green: 0.15
blue: 0.85
brightness: 50%
- micro_wake_word.start:
on_client_disconnected:
then:
- voice_assistant.stop:
ota:
- platform: esphome
password: "****************"
wifi:
ssid: "********"
password: "************"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32-S3-Wake-Word"
password: "***********"
captive_portal:
button:
- platform: restart
name: "Restart"
id: but_rest
# Updated Volume Control
number:
- platform: template
name: "Speaker Volume"
id: speaker_volume
optimistic: true
min_value: 0
max_value: 100
step: 1
restore_value: true
initial_value: 80 # Higher default volume
mode: slider
on_value:
then:
- speaker.volume_set:
id: va_speaker
volume: !lambda "return (x / 100.0) * 8.0;"
switch:
- platform: template
id: mute
name: mute
optimistic: true
on_turn_on:
- speaker.volume_set:
id: va_speaker
volume: 0%
- micro_wake_word.stop:
- voice_assistant.stop:
- light.turn_on:
id: led_ww
red: 100%
green: 0%
blue: 0%
brightness: 60%
effect: fast pulse
- delay: 2s
- light.turn_off:
id: led_ww
- light.turn_on:
id: led_ww
red: 100%
green: 0%
blue: 0%
brightness: 30%
on_turn_off:
- speaker.volume_set:
id: va_speaker
volume: 50%
- micro_wake_word.start:
- light.turn_on:
id: led_ww
red: 0%
green: 100%
blue: 0%
brightness: 60%
effect: fast pulse
- delay: 2s
- light.turn_off:
id: led_ww
light:
- platform: esp32_rmt_led_strip
id: led_ww
rgb_order: RGB
pin: GPIO16
num_leds: 1
rmt_channel: 0
chipset: ws2812
name: "on board light"
effects:
- pulse:
- pulse:
name: "Fast Pulse"
transition_length: 0.5s
update_interval: 0.5s
min_brightness: 0%
max_brightness: 100%
# Audio and Voice Assistant Config
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO3 #WS
i2s_bclk_pin: GPIO2 #SCK
- id: i2s_speaker
i2s_lrclk_pin: GPIO6 #LRC
i2s_bclk_pin: GPIO7 #BLCK
microphone:
- platform: i2s_audio
id: va_mic
adc_type: external
i2s_din_pin: GPIO4 #SD pin on the INMP441
channel: left
pdm: false
i2s_audio_id: i2s_in
bits_per_sample: 32 bit
speaker:
- platform: i2s_audio
id: va_speaker
i2s_audio_id: i2s_speaker
dac_type: external
i2s_dout_pin: GPIO8 # DIN Pin of the MAX98357A Audio Amplifier
channel: mono
micro_wake_word:
on_wake_word_detected:
- voice_assistant.start:
wake_word: !lambda return wake_word;
- light.turn_on:
id: led_ww
red: 30%
green: 30%
blue: 70%
brightness: 60%
effect: fast pulse
models:
- model: hey_jarvis
voice_assistant:
id: va
microphone: va_mic
noise_suppression_level: 2.0
speaker: va_speaker
conversation_timeout: 10s # Time to wait for follow-up questions
on_tts_start:
then:
- speaker.volume_set:
id: va_speaker
volume: !lambda "return (id(speaker_volume).state / 100.0) * 8.0;"
on_stt_end:
then:
- light.turn_on:
id: led_ww
red: 100%
green: 0.15
blue: 0.85
brightness: 50%
effect: none
on_end:
then:
- speaker.volume_set:
id: va_speaker
volume: !lambda "return (id(speaker_volume).state / 100.0) * 8.0;"
- light.turn_on:
id: led_ww
red: 100%
green: 0.15
blue: 0.85
brightness: 50%
effect: none
- wait_until:
not:
voice_assistant.is_running:
- micro_wake_word.start:
RE: how to use AS ESP32-S3 voice assistant in home assistant - biofects - 12-16-2024
Is there a way to use the wakeword on the system and not the micro wakeword. I have created my own and would like to use it
RE: how to use AS ESP32-S3 voice assistant in home assistant - admin - 12-16-2024
about the volume issue, you can try to download this internet radio arduino code to test:
https://www.kincony.com/forum/showthread.php?tid=6896
only need replace your router's wifi ssid and password. check whether volume can be changed with different value.
RE: how to use AS ESP32-S3 voice assistant in home assistant - biofects - 12-19-2024
I somehow messed up, is there a way to factory reset it? I have no lights, no mic, I can see it on my network.This morning my internet went out and I moved the device from a USB port to a power dongle but after that the mic stopped working and listening. I figured Ill look tonight and the install failed with
Linking .pioenvs/sarah/firmware.elf
RAM: [= ] 9.9% (used 32488 bytes from 327680 bytes)
Flash: [====== ] 62.0% (used 1138185 bytes from 1835008 bytes)
Building .pioenvs/sarah/firmware.bin
Creating esp32s3 image...
Successfully created esp32s3 image.
esp32_create_combined_bin([".pioenvs/sarah/firmware.bin"], [".pioenvs/sarah/firmware.elf"])
Wrote 0x125f70 bytes to file /config/.esphome/build/sarah/.pioenvs/sarah/firmware.factory.bin, ready to flash to offset 0x0
esp32_copy_ota_bin([".pioenvs/sarah/firmware.bin"], [".pioenvs/sarah/firmware.elf"])
========================= [SUCCESS] Took 55.25 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of sarah.local in mDNS
INFO Connecting to 192.168.1.217 port 3232...
INFO Connected to 192.168.1.217
INFO Uploading /config/.esphome/build/sarah/.pioenvs/sarah/firmware.bin (1138544 bytes)
Uploading: [============================================================] 100% Done...
INFO Upload took 9.06 seconds, waiting for result...
ERROR Error Update end: Error: Finishing update failed. See the MQTT/USB logs for more information.
I would like to reset and start from scratch please
RE: how to use AS ESP32-S3 voice assistant in home assistant - biofects - 12-19-2024
(12-19-2024, 03:07 AM)biofects Wrote: I somehow messed up, is there a way to factory reset it? I have no lights, no mic, I can see it on my network.This morning my internet went out and I moved the device from a USB port to a power dongle but after that the mic stopped working and listening. I figured Ill look tonight and the install failed with
Linking .pioenvs/sarah/firmware.elf
RAM: [= ] 9.9% (used 32488 bytes from 327680 bytes)
Flash: [====== ] 62.0% (used 1138185 bytes from 1835008 bytes)
Building .pioenvs/sarah/firmware.bin
Creating esp32s3 image...
Successfully created esp32s3 image.
esp32_create_combined_bin([".pioenvs/sarah/firmware.bin"], [".pioenvs/sarah/firmware.elf"])
Wrote 0x125f70 bytes to file /config/.esphome/build/sarah/.pioenvs/sarah/firmware.factory.bin, ready to flash to offset 0x0
esp32_copy_ota_bin([".pioenvs/sarah/firmware.bin"], [".pioenvs/sarah/firmware.elf"])
========================= [SUCCESS] Took 55.25 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of sarah.local in mDNS
INFO Connecting to 192.168.1.217 port 3232...
INFO Connected to 192.168.1.217
INFO Uploading /config/.esphome/build/sarah/.pioenvs/sarah/firmware.bin (1138544 bytes)
Uploading: [============================================================] 100% Done...
INFO Upload took 9.06 seconds, waiting for result...
ERROR Error Update end: Error: Finishing update failed. See the MQTT/USB logs for more information.
I would like to reset and start from scratch please
NM I have figured it out. I had to go back and plug back into server and start from scratch
RE: how to use AS ESP32-S3 voice assistant in home assistant - admin - 10-14-2025
this is yaml file i have used, compiled with newest esphome, it can work well.
Code: esphome:
name: as
friendly_name: AS
platformio_options:
board_build.flash_mode: dio
on_boot:
- light.turn_on:
id: led_ww
blue: 100%
brightness: 60%
effect: fast pulse
esp32:
board: esp32-s3-devkitc-1
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"
CONFIG_AUDIO_BOARD_CUSTOM: "y"
psram:
mode: octal # quad for N8R2 and octal for N16R8
speed: 80MHz
# Enable logging
logger:
hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
encryption:
key: "TFpb+pBAvQIS1MVwaA7EoJ2DkpWE+79UvVro7yMyGdU="
on_client_connected:
then:
- delay: 50ms
- light.turn_off: led_ww
- micro_wake_word.start:
on_client_disconnected:
then:
- voice_assistant.stop:
ota:
- platform: esphome
password: "1245211a05eef56614a2ef5a3f3e971c"
wifi:
ssid: "KinCony"
password: "a12345678"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp32-S3-Wake-Word"
password: "LJfUrdJk3svP"
captive_portal:
button:
- platform: restart
name: "Restart"
id: but_rest
switch:
- platform: template
id: mute
name: mute
optimistic: true
on_turn_on:
- micro_wake_word.stop:
- voice_assistant.stop:
- light.turn_on:
id: led_ww
red: 100%
green: 0%
blue: 0%
brightness: 60%
effect: fast pulse
- delay: 2s
- light.turn_off:
id: led_ww
- light.turn_on:
id: led_ww
red: 100%
green: 0%
blue: 0%
brightness: 30%
on_turn_off:
- micro_wake_word.start:
- light.turn_on:
id: led_ww
red: 0%
green: 100%
blue: 0%
brightness: 60%
effect: fast pulse
- delay: 2s
- light.turn_off:
id: led_ww
light:
- platform: esp32_rmt_led_strip
id: led_ww
rgb_order: GRB
pin: GPIO16
num_leds: 1
chipset: ws2812
name: "on board light"
effects:
- pulse:
- pulse:
name: "Fast Pulse"
transition_length: 0.5s
update_interval: 0.5s
min_brightness: 0%
max_brightness: 100%
# Audio and Voice Assistant Config
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO3 #WS
i2s_bclk_pin: GPIO2 #SCK
- id: i2s_speaker
i2s_lrclk_pin: GPIO6 #LRC
i2s_bclk_pin: GPIO7 #BLCK
microphone:
- platform: i2s_audio
id: va_mic
adc_type: external
i2s_din_pin: GPIO4 #SD pin on the INMP441
channel: left
pdm: false
i2s_audio_id: i2s_in
bits_per_sample: 32 bit
speaker:
platform: i2s_audio
id: va_speaker
i2s_audio_id: i2s_speaker
dac_type: external
i2s_dout_pin: GPIO8 # DIN Pin of the MAX98357A Audio Amplifier
channel: mono
micro_wake_word:
on_wake_word_detected:
# then:
- voice_assistant.start:
wake_word: !lambda return wake_word;
- light.turn_on:
id: led_ww
red: 30%
green: 30%
blue: 70%
brightness: 60%
effect: fast pulse
models:
- model: hey_jarvis
voice_assistant:
id: va
microphone: va_mic
noise_suppression_level: 2.0
volume_multiplier: 4.0
speaker: va_speaker
on_stt_end:
then:
- light.turn_off: led_ww
on_error:
- micro_wake_word.start:
on_end:
then:
- light.turn_off: led_ww
- wait_until:
not:
voice_assistant.is_running:
- micro_wake_word.start:
yaml file download:
AS-HA-20251014.txt (Size: 3.92 KB / Downloads: 153)
RE: how to use AS ESP32-S3 voice assistant in home assistant - kirkond - 11-03-2025
(12-10-2024, 04:19 PM)biofects Wrote: (12-08-2024, 11:33 AM)eyevisions Wrote: Also just beginning with ESP and find it hard to follow. So keep on reading like the idea for volume control. Is there also a way to use the speaker to play media to it? I like to use bought leds so i flash it a second time and change gpio en leaf the RGB. There must be a beter way
I will be adding that to yaml, once i get the volume working properly its close but something is still off
esphome:
name: as
friendly_name: AS
platformio_options:
board_build.flash_mode: dio
on_boot:
- light.turn_on:
id: led_ww
brightness: 60%
esp32:
board: esp32-s3-devkitc-1
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"
CONFIG_AUDIO_BOARD_CUSTOM: "y"
psram:
mode: octal # quad для N8R2 и octal для N16R8
speed: 80MHz
# Логирование
logger:
hardware_uart: USB_SERIAL_JTAG
# Home Assistant API
api:
encryption:
key: "TFpb+pBAvQIS1MVwaA7EoJ2DkpWE+79UvVro7yMyGdU="
on_client_connected:
then:
- delay: 50ms
- light.turn_off: led_ww
- micro_wake_word.start:
on_client_disconnected:
then:
- voice_assistant.stop:
ota:
- platform: esphome
password: "1245211a05eef56614a2ef5a3f3e971c"
wifi:
ssid: "KinCony"
password: "a12345678"
# Резервная точка доступа
ap:
ssid: "Esp32-S3-Wake-Word"
password: "LJfUrdJk3svP"
captive_portal:
# Кнопка перезагрузки
button:
- platform: restart
name: "Перезагрузка"
id: but_rest
# Светодиодная лампа - ИСПРАВЛЕННАЯ КОНФИГУРАЦИЯ
output:
- platform: ledc
id: led_output
pin: GPIO16
light:
- platform: monochromatic
id: led_ww
name: "Светодиод на плате"
output: led_output
# Переключатель микрофона
switch:
- platform: template
id: mute
name: "Отключить микрофон"
optimistic: true
on_turn_on:
- micro_wake_word.stop:
- voice_assistant.stop:
- light.turn_on:
id: led_ww
brightness: 60%
- delay: 2s
- light.turn_off:
id: led_ww
- light.turn_on:
id: led_ww
brightness: 30%
on_turn_off:
- micro_wake_word.start:
- light.turn_on:
id: led_ww
brightness: 60%
- delay: 2s
- light.turn_off:
id: led_ww
# Аудио конфигурация
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO3 # WS
i2s_bclk_pin: GPIO2 # SCK
- id: i2s_speaker
i2s_lrclk_pin: GPIO6 # LRC
i2s_bclk_pin: GPIO7 # BLCK
# Микрофон
microphone:
- platform: i2s_audio
id: va_mic
adc_type: external
i2s_din_pin: GPIO4 # SD пин на INMP441
channel: left
pdm: false
i2s_audio_id: i2s_in
bits_per_sample: 32bit
# Динамик
speaker:
platform: i2s_audio
id: va_speaker
i2s_audio_id: i2s_speaker
dac_type: external
i2s_dout_pin: GPIO8 # DIN пин усилителя MAX98357A
channel: mono
# Распознавание ключевого слова
micro_wake_word:
on_wake_word_detected:
- voice_assistant.start:
- light.turn_on:
id: led_ww
brightness: 60%
models:
- model: hey_jarvis
# Голосовой помощник
voice_assistant:
id: va
microphone: va_mic
noise_suppression_level: 2.0
volume_multiplier: 4.0
speaker: va_speaker
on_listening:
then:
- light.turn_on:
id: led_ww
brightness: 80%
on_stt_end:
then:
- light.turn_off: led_ww
on_tts_start:
then:
- light.turn_on:
id: led_ww
brightness: 40%
on_error:
then:
- light.turn_on:
id: led_ww
brightness: 100%
- delay: 1s
- light.turn_off: led_ww
- micro_wake_word.start:
on_end:
then:
- light.turn_off: led_ww
- wait_until:
condition:
not:
voice_assistant.is_running:
- micro_wake_word.start:
RE: how to use AS ESP32-S3 voice assistant in home assistant - kirkond - 11-07-2025
(11-03-2025, 07:08 PM)kirkond Wrote: (12-10-2024, 04:19 PM)biofects Wrote: (12-08-2024, 11:33 AM)eyevisions Wrote: Also just beginning with ESP and find it hard to follow. So keep on reading like the idea for volume control. Is there also a way to use the speaker to play media to it? I like to use bought leds so i flash it a second time and change gpio en leaf the RGB. There must be a beter way
I will be adding that to yaml, once i get the volume working properly its close but something is still off
esphome:
name: as
friendly_name: AS
platformio_options:
board_build.flash_mode: dio
on_boot:
- light.turn_on:
id: led_ww
brightness: 60%
esp32:
board: esp32-s3-devkitc-1
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"
CONFIG_AUDIO_BOARD_CUSTOM: "y"
psram:
mode: octal # quad для N8R2 и octal для N16R8
speed: 80MHz
# Логирование
logger:
hardware_uart: USB_SERIAL_JTAG
# Home Assistant API
api:
encryption:
key: "TFpb+pBAvQIS1MVwaA7EoJ2DkpWE+79UvVro7yMyGdU="
on_client_connected:
then:
- delay: 50ms
- light.turn_off: led_ww
- micro_wake_word.start:
on_client_disconnected:
then:
- voice_assistant.stop:
ota:
- platform: esphome
password: "1245211a05eef56614a2ef5a3f3e971c"
wifi:
ssid: "KinCony"
password: "a12345678"
# Резервная точка доступа
ap:
ssid: "Esp32-S3-Wake-Word"
password: "LJfUrdJk3svP"
captive_portal:
# Кнопка перезагрузки
button:
- platform: restart
name: "Перезагрузка"
id: but_rest
# Светодиодная лампа - ИСПРАВЛЕННАЯ КОНФИГУРАЦИЯ
output:
- platform: ledc
id: led_output
pin: GPIO16
light:
- platform: monochromatic
id: led_ww
name: "Светодиод на плате"
output: led_output
# Переключатель микрофона
switch:
- platform: template
id: mute
name: "Отключить микрофон"
optimistic: true
on_turn_on:
- micro_wake_word.stop:
- voice_assistant.stop:
- light.turn_on:
id: led_ww
brightness: 60%
- delay: 2s
- light.turn_off:
id: led_ww
- light.turn_on:
id: led_ww
brightness: 30%
on_turn_off:
- micro_wake_word.start:
- light.turn_on:
id: led_ww
brightness: 60%
- delay: 2s
- light.turn_off:
id: led_ww
# Аудио конфигурация
i2s_audio:
- id: i2s_in
i2s_lrclk_pin: GPIO3 # WS
i2s_bclk_pin: GPIO2 # SCK
- id: i2s_speaker
i2s_lrclk_pin: GPIO6 # LRC
i2s_bclk_pin: GPIO7 # BLCK
# Микрофон
microphone:
- platform: i2s_audio
id: va_mic
adc_type: external
i2s_din_pin: GPIO4 # SD пин на INMP441
channel: left
pdm: false
i2s_audio_id: i2s_in
bits_per_sample: 32bit
# Динамик
speaker:
platform: i2s_audio
id: va_speaker
i2s_audio_id: i2s_speaker
dac_type: external
i2s_dout_pin: GPIO8 # DIN пин усилителя MAX98357A
channel: mono
# Распознавание ключевого слова
micro_wake_word:
on_wake_word_detected:
- voice_assistant.start:
- light.turn_on:
id: led_ww
brightness: 60%
models:
- model: hey_jarvis
# Голосовой помощник
voice_assistant:
id: va
microphone: va_mic
noise_suppression_level: 2.0
volume_multiplier: 4.0
speaker: va_speaker
on_listening:
then:
- light.turn_on:
id: led_ww
brightness: 80%
on_stt_end:
then:
- light.turn_off: led_ww
on_tts_start:
then:
- light.turn_on:
id: led_ww
brightness: 40%
on_error:
then:
- light.turn_on:
id: led_ww
brightness: 100%
- delay: 1s
- light.turn_off: led_ww
- micro_wake_word.start:
on_end:
then:
- light.turn_off: led_ww
- wait_until:
condition:
not:
voice_assistant.is_running:
- micro_wake_word.start:
он разве работает?
|