-
-
Notifications
You must be signed in to change notification settings - Fork 60
M5 Atom Echo - Wake Sound #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Try add a |
I ran into the same issue of the wake word audio playing after the LISTENING phase. Looking at the logs, even with a
That's when I noticed the logs would output I managed to fix this "out of order" sequence by putting everything inside the micro_wake_word:
on_wake_word_detected:
then:
... Now the wake word audio plays at the beginning before the My Atom Echo Configsubstitutions:
name: m5stack-atom-echo
friendly_name: Bedroom Atom Echo
packages:
m5stack.atom-echo-wake-word-voice-assistant: github://esphome/wake-word-voice-assistants/m5stack-atom-echo/m5stack-atom-echo.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
esp32:
board: m5stack-atom
framework:
type: esp-idf
version: 4.4.8
platform_version: 5.4.0
api:
encryption:
key: <snip>
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
micro_wake_word:
on_wake_word_detected:
then:
- media_player.speaker.play_on_device_media_file:
media_file: timer_finished_wave_file
announcement: true
- delay: 100ms
- wait_until:
- media_player.is_idle:
- speaker.is_stopped:
- voice_assistant.start:
wake_word: !lambda return wake_word; Crash Log
|
The crash I was experiencing is due to the media player calling wake-word-voice-assistants/m5stack-atom-echo/m5stack-atom-echo.yaml Lines 89 to 90 in 5a2aff4
As a quick hack, overwriting the media_player:
- id: !extend echo_media_player
on_idle:
then:
- delay: 1ms I'm new to ESPHome and Voice assistant stuff, what would be the proper way to restart the wake word on idle if the audio that just finished is not from the wake word? Full atom echo configsubstitutions:
name: m5stack-atom-echo
friendly_name: Bedroom Atom Echo
packages:
m5stack.atom-echo-wake-word-voice-assistant: github://esphome/wake-word-voice-assistants/m5stack-atom-echo/m5stack-atom-echo.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
esp32:
board: m5stack-atom
framework:
type: esp-idf
version: 4.4.8
platform_version: 5.4.0
api:
encryption:
key: <snip>
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
micro_wake_word:
on_wake_word_detected:
then:
- media_player.speaker.play_on_device_media_file:
media_file: timer_finished_wave_file
announcement: true
- delay: 10ms
- wait_until:
- media_player.is_idle:
- speaker.is_stopped:
- voice_assistant.start:
wake_word: !lambda return wake_word;
media_player:
- id: !extend echo_media_player
on_idle:
then:
- delay: 1ms |
hi @arilence , here is my solution: globals:
- id: not_playing_wake_word
type: bool
restore_value: false
initial_value: "true"
...
micro_wake_word:
...
on_wake_word_detected:
then:
- lambda: id(not_playing_wake_word) = false;
- media_player.speaker.play_on_device_media_file:
media_file: sounds_awake
announcement: true
- delay: 100ms
- wait_until:
- media_player.is_idle:
- speaker.is_stopped:
- lambda: id(not_playing_wake_word) = true;
- voice_assistant.start:
wake_word: !lambda return wake_word;
media_player:
- platform: speaker
...
on_idle:
- if:
condition:
lambda: return id(not_playing_wake_word);
then:
- micro_wake_word.start: |
@ptbsare nice solution, I added switch "use wake sound" in my setup. Works great. |
@ptbsare for this, I have to use the hole config yaml, correct? Because I am currently using
But +1 to be able to define this directly on the default configuration |
@distante Using the package as a base works too. I'm currently doing that and then extending the media player to add the additional functionality. I've attached my full config below. Thanks to MorganMLGman and ptbsare for their solutions. Note I added an additional sound file Expand to see full configsubstitutions:
name: m5stack-atom-echo
friendly_name: Bedroom Atom Echo
packages:
m5stack.atom-echo-wake-word-voice-assistant: github://esphome/wake-word-voice-assistants/m5stack-atom-echo/m5stack-atom-echo.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
esp32:
board: m5stack-atom
api:
encryption:
key: <snip>
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
globals:
- id: playing_wake_word
type: bool
restore_value: false
initial_value: "false"
switch:
- platform: template
name: Use wake sound
id: use_wake_sound
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
micro_wake_word:
on_wake_word_detected:
then:
- if:
condition:
switch.is_on: use_wake_sound
then:
- lambda: id(playing_wake_word) = true;
- media_player.speaker.play_on_device_media_file:
media_file: wake_word_triggered_sound
announcement: true
- delay: 10ms
- wait_until:
- media_player.is_idle:
- speaker.is_stopped:
- lambda: id(playing_wake_word) = false;
- voice_assistant.start:
wake_word: !lambda return wake_word;
media_player:
- id: !extend echo_media_player
files:
- id: wake_word_triggered_sound
file: sounds/sounds_wake_word_triggered.wav
on_idle:
then:
- if:
condition:
not:
lambda: return id(playing_wake_word);
then:
- micro_wake_word.start: |
As there has been no activity on this issue for 30 days, I am marking it as stale. If you think this is a mistake, please comment below and I will remove the stale label. |
Hi,
Can wake sound be added like it is in VoicePE?
I tried to add it myself, but I can't get the right sequence and wake word is played after LISTENING phase.
In current form I get:
The text was updated successfully, but these errors were encountered: