Git Product home page Git Product logo

firmware's Introduction

firmware's People

Contributors

ammgws avatar apeeters avatar balloob avatar c0ffeeca7 avatar dependabot[bot] avatar jacobswe avatar jesserockz avatar jlpouffier avatar kbx81 avatar nardol avatar s00500 avatar tetele avatar thefes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firmware's Issues

Cannot play HA media on ESP Muse Luxe

The device can play online radio streams but reboots when trying to play media from Home Assistant. This used to work with previous versions (2022.x) of ESPHome.

Config: https://github.com/esphome/firmware/blob/main/media-player/raspiaudio-muse-luxe.yaml
ESPHome: 2023.9.3
HA: 2023.10.2

Similar issue reported in the old repo: esphome/media-players#29

...
[14:35:53][C][logger:357]: Logger:
[14:35:53][C][logger:358]:   Level: DEBUG
[14:35:53][C][logger:359]:   Log Baud Rate: 115200
[14:35:53][C][logger:361]:   Hardware UART: UART0
[14:35:53][C][i2c.arduino:053]: I2C Bus:
[14:35:53][C][i2c.arduino:054]:   SDA Pin: GPIO18
[14:35:53][C][i2c.arduino:055]:   SCL Pin: GPIO23
[14:35:53][C][i2c.arduino:056]:   Frequency: 50000 Hz
[14:35:53][C][i2c.arduino:059]:   Recovery: bus successfully recovered
[14:35:53][I][i2c.arduino:069]: Results from i2c bus scan:
[14:35:53][I][i2c.arduino:075]: Found i2c device at address 0x10
[14:35:53][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Volume Up'
[14:35:53][C][gpio.binary_sensor:016]:   Pin: GPIO19
[14:35:54][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Volume Down'
[14:35:54][C][gpio.binary_sensor:016]:   Pin: GPIO32
[14:35:54][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Action'
[14:35:54][C][gpio.binary_sensor:016]:   Pin: GPIO12
[14:35:54][C][fastled:021]: FastLED light:
[14:35:54][C][fastled:022]:   Num LEDs: 1
[14:35:54][C][fastled:023]:   Max refresh rate: 400
[14:35:54][C][light:103]: Light 'Muse1'
[14:35:54][C][light:105]:   Default Transition Length: 1.0s
[14:35:54][C][light:106]:   Gamma Correct: 2.80
[14:35:54][C][adc:097]: ADC Sensor 'Battery'
[14:35:54][C][adc:097]:   Device Class: 'voltage'
[14:35:54][C][adc:097]:   State Class: 'measurement'
[14:35:54][C][adc:097]:   Unit of Measurement: 'V'
[14:35:54][C][adc:097]:   Accuracy Decimals: 3
[14:35:54][C][adc:097]:   Icon: 'mdi:battery-outline'
[14:35:54][C][adc:107]:   Pin: GPIO33
[14:35:54][C][adc:122]:  Attenuation: 11db
[14:35:54][C][adc:142]:   Update Interval: 15.0s
[14:35:54][C][captive_portal:088]: Captive Portal:
[14:35:54][C][mdns:115]: mDNS:
[14:35:54][C][mdns:116]:   Hostname: muse1
[14:35:54][C][ota:097]: Over-The-Air Updates:
[14:35:54][C][ota:098]:   Address: muse1.local:3232
[14:35:54][C][api:138]: API Server:
[14:35:54][C][api:139]:   Address: muse1.local:6053
[14:35:54][C][api:143]:   Using noise encryption: NO
[14:35:54][C][improv_serial:032]: Improv Serial:
[14:35:54][C][audio:203]: Audio:
[14:35:54][C][audio:225]:   External DAC channels: 2
[14:35:54][C][audio:226]:   I2S DOUT Pin: 26
[14:35:54][C][audio:227]:   Mute Pin: GPIO21
[14:36:17][D][media_player:059]: 'Muse1' - Setting
[14:36:17][D][media_player:066]:   Media URL: http://homeassistant.local:8123/api/tts_proxy/7b502c3a1f48c8609ae212cdfb639dee39673f5e_en-us_be0728c770_tts.piper.wav
WARNING muse1.local: Connection error occurred: [Errno 104] Connection reset by peer
INFO Processing unexpected disconnect from ESPHome API for muse1.local
WARNING Disconnected from API

INFO Successfully connected to muse1.local
[14:36:47][D][sensor:094]: 'Battery': Sending state 4.22671 V with 3 decimals of accuracy
[14:36:53][D][api:102]: Accepted 192.168.x.x
[14:36:53][D][api.connection:1031]: Home Assistant 2023.10.2 (192.168.x.x): Connected successfully
[14:37:04][D][media_player:059]: 'Muse1' - Setting
[14:37:04][D][media_player:069]:   Volume: 0.21
[14:37:38][D][media_player:059]: 'Muse1' - Setting
[14:37:38][D][media_player:066]:   Media URL: http://icestreaming.rai.it/3.mp3
[14:37:40][W][component:204]: Component i2s_audio.media_player took a long time for an operation (1.09 s).
[14:37:40][W][component:205]: Components should block for at most 20-30ms.
...

Feature Request: Entities for control of voice assistant parameters

Within the YAML you have specified the following parameters in the voice_assistant section:

noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 2.0
vad_threshold: 3

No doubt you adjusted them to work generally well. However if they could be set via a numeric entity in real time, different settings could be used for different situations... TV on, noisy party going on, music playing or dead silence in the middle of the night etc.

Another possibility would be the brightness of the LED's.... If at night sleeping, it would be nice to have the LED go to a very low percentage or out completely; in bright environs at 100% etc.

Perhaps these requests are "moon shots", but I thought it worth a discussion. To make "Assist" work as well as Google devices etc., a way to adjust for real time sound and light conditions will be required. As many of us have various sensors scattered about our rooms, it would be nice to be able to use them to optimize the Voice Assistant performance.

fj

Audio Pipeline Fails esp32-s3-box-lite

logs_esp32-s3-box-lite-d50078_run.txt

Greetings,

I have 2 of the box-lite. Both of them will not activate speaker or microphone. I have attached the complete log file.

Below are are some excerpts from the log:

src/esphome/components/esp_adf/microphone/esp_adf_microphone.cpp: In static member function 'static void esphome::esp_adf::ESPADFMicrophone::read_task(void*)':
src/esphome/components/esp_adf/microphone/esp_adf_microphone.cpp:98:3: warning: missing initializer for member 'i2s_driver_config_t::chan_mask' [-Wmissing-field-initializers]
};
^
src/esphome/components/esp_adf/microphone/esp_adf_microphone.cpp:98:3: warning: missing initializer for member 'i2s_driver_config_t::total_chan' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/microphone/esp_adf_microphone.cpp:98:3: warning: missing initializer for member 'i2s_driver_config_t::left_align' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/microphone/esp_adf_microphone.cpp:98:3: warning: missing initializer for member 'i2s_driver_config_t::big_edin' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/microphone/esp_adf_microphone.cpp:98:3: warning: missing initializer for member 'i2s_driver_config_t::bit_order_msb' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/microphone/esp_adf_microphone.cpp:98:3: warning: missing initializer for member 'i2s_driver_config_t::skip_msk' [-Wmissing-field-initializers]
Compiling .pioenvs/esp32-s3-box-lite-d50078/src/esphome/components/improv_serial/improv_serial_component.o
src/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp: In static member function 'static void esphome::esp_adf::ESPADFSpeaker::player_task(void*)':
src/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp:60:3: warning: missing initializer for member 'i2s_driver_config_t::chan_mask' [-Wmissing-field-initializers]
};
^
src/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp:60:3: warning: missing initializer for member 'i2s_driver_config_t::total_chan' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp:60:3: warning: missing initializer for member 'i2s_driver_config_t::left_align' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp:60:3: warning: missing initializer for member 'i2s_driver_config_t::big_edin' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp:60:3: warning: missing initializer for member 'i2s_driver_config_t::bit_order_msb' [-Wmissing-field-initializers]
src/esphome/components/esp_adf/speaker/esp_adf_speaker.cpp:60:3: warning: missing initializer for member 'i2s_driver_config_t::skip_msk' [-Wmissing-field-initializers]
Compiling .pioenvs/esp32-s3-box-lite-d50078/src/esphome/components/ledc/ledc_output.o

And also:

[01:36:30][D][voice_assistant:422]: State changed from IDLE to START_MICROPHONE
[01:36:30][D][voice_assistant:428]: Desired state set to WAIT_FOR_VAD
[01:36:30][W][component:214]: Component api took a long time for an operation (0.22 s).
[01:36:30][W][component:215]: Components should block for at most 20-30ms.
[01:36:30][D][voice_assistant:159]: Starting Microphone
[01:36:30][D][voice_assistant:422]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[01:36:30][D][esp-idf:000]: I (15233) I2S: DMA Malloc info, datalen=blocksize=512, dma_buf_count=8

[01:36:30][D][esp-idf:000]: I (15240) I2S: I2S0, MCLK output by GPIO2

[01:36:30][D][esp-idf:000]: I (15245) ESP32_S3_BOX_LITE: I2S0, MCLK output by GPIO0

[01:36:30][D][esp-idf:000]: I (15250) AUDIO_PIPELINE: link el->rb, el:0x3d836bd0, tag:i2s, rb:0x3d836fe4

[01:36:30][D][esp-idf:000]: I (15258) AUDIO_PIPELINE: link el->rb, el:0x3d836d44, tag:filter, rb:0x3d839024

[01:36:30][D][esp-idf:000]: I (15263) AUDIO_ELEMENT: [i2s-0x3d836bd0] Element task created

[01:36:30][D][esp-idf:000]: I (15267) AUDIO_THREAD: The filter task allocate stack on external memory

[01:36:30][D][esp-idf:000]: E (15272) AUDIO_THREAD: Not found right xTaskCreateRestrictedPinnedToCore.
Please enter IDF-PATH with "cd $IDF_PATH" and apply the IDF patch with "git apply $ADF_PATH/idf_patches/idf_4.4._freertos.patch" first

[01:36:30][D][esp-idf:000]: E (15282) AUDIO_THREAD: Error creating RestrictedPinnedToCore filter

[01:36:30][D][esp-idf:000]: E (15286) AUDIO_ELEMENT: [filter] audio_thread_create failed

I hope it is a simple fix.

Thanks!

Willie

Atom-M5-echo freezes when script is run

Hey all, I have a voice command that runs a script and has no speech response set to return to the atom-echo satellite. This causes the echo to wait infinitely for a response to be returned which is never coming. So I have to reboot the device everytime I issue this command. It's been stopped at this state for about 5 mins and will never recover from it, I've waited over an hour to test it.

[16:36:49][D][voice_assistant:412]: State changed from STREAMING_MICROPHONE to STOP_MICROPHONE
[16:36:49][D][voice_assistant:418]: Desired state set to AWAITING_RESPONSE
[16:36:49][D][voice_assistant:412]: State changed from STOP_MICROPHONE to STOPPING_MICROPHONE
[16:36:49][D][light:036]: 'M5Stack Atom Echo' Setting:
[16:36:49][D][light:059]:   Red: 0%, Green: 0%, Blue: 100%
[16:36:49][D][light:109]:   Effect: 'Fast Pulse'
[16:36:49][D][esp-idf:000]: I (116378) I2S: DMA queue destroyed

[16:36:49][D][voice_assistant:412]: State changed from STOPPING_MICROPHONE to AWAITING_RESPONSE
[16:36:49][D][voice_assistant:519]: Event Type: 4
[16:36:49][D][voice_assistant:547]: Speech recognised as: " Tell me something interesting."
[16:36:49][D][voice_assistant:519]: Event Type: 5
[16:36:49][D][voice_assistant:552]: Intent started
[16:36:49][D][voice_assistant:519]: Event Type: 6
[16:36:49][D][voice_assistant:519]: Event Type: 2
[16:36:49][D][voice_assistant:609]: Assist Pipeline ended
[16:36:49][D][light:036]: 'M5Stack Atom Echo' Setting:
[16:36:49][D][light:051]:   Brightness: 60%
[16:36:49][D][light:059]:   Red: 100%, Green: 89%, Blue: 71%
[16:36:49][D][light:109]:   Effect: 'None'

M5 stack atom echo voice assistant simply does not work

I have uploaded the following firmware, modified from the original:

---
esphome:
  name: enceinte-test
  friendly_name: "Enceinte test"
  project:
    name: m5stack.atom-echo-voice-assistant
    version: "1.0"
  min_version: 2023.11.1

esp32:
  board: m5stack-atom
  framework:
    type: esp-idf

logger:
  level: DEBUG
  logs:
    light: ERROR
    esp32_rmt_led_strip: ERROR
    binary_sensor: ERROR
    api: ERROR
    ota: ERROR
    audio: error
    mdns: ERROR
    wifi: ERROR
    wireguard: ERROR
    esp32.preferences: ERROR
    homeassistant.time: ERROR
    factory_reset.button: ERROR
    template.switch: ERROR
    gpio.binary_sensor: ERROR

api:
  encryption:
    key: !secret enceinte_test_encryption_key

ota:
  password: !secret enceinte_test_ota_pass

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_key
  #enable_btm: true
  #enable_rrm: true
  ap:
    password: !secret ap_key

button:
  - platform: factory_reset
    id: factory_reset_btn
    name: Factory reset

i2s_audio:
  i2s_lrclk_pin: GPIO33
  i2s_bclk_pin: GPIO19

microphone:
  - platform: i2s_audio
    id: echo_microphone
    i2s_din_pin: GPIO23
    adc_type: external
    pdm: true

speaker:
  - platform: i2s_audio
    id: echo_speaker
    i2s_dout_pin: GPIO22
    dac_type: external
    mode: mono

voice_assistant:
  id: va
  microphone: echo_microphone
  speaker: echo_speaker
  noise_suppression_level: 4
  auto_gain: 31dBFS
  volume_multiplier: 2.0
  vad_threshold: 3
  on_listening:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        effect: "Slow Pulse"
  on_stt_vad_end:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        effect: "Fast Pulse"
  on_tts_start:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        brightness: 100%
        effect: none
  on_end:
    - delay: 100ms
    - wait_until:
        not:
          speaker.is_playing:
    - script.execute: reset_led
  on_error:
    - light.turn_on:
        id: led
        red: 100%
        green: 0%
        blue: 0%
        brightness: 100%
        effect: none
    - delay: 1s
    - script.execute: reset_led
  on_client_connected:
    - if:
        condition:
          switch.is_on: use_wake_word
        then:
          - voice_assistant.start_continuous:
          - script.execute: reset_led
  on_client_disconnected:
    - if:
        condition:
          switch.is_on: use_wake_word
        then:
          - voice_assistant.stop:
          - light.turn_off: led

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO39
      inverted: true
    name: Button
    disabled_by_default: true
    entity_category: diagnostic
    id: echo_button
    on_multi_click:
      - timing:
          - ON for at least 250ms
          - OFF for at least 50ms
        then:
          - if:
              condition:
                switch.is_off: use_wake_word
              then:
                - if:
                    condition: voice_assistant.is_running
                    then:
                      - voice_assistant.stop:
                      - script.execute: reset_led
                    else:
                      - voice_assistant.start:
              else:
                - voice_assistant.stop
                - delay: 1s
                - script.execute: reset_led
                - script.wait: reset_led
                - voice_assistant.start_continuous:
      - timing:
          - ON for at least 10s
        then:
          - button.press: factory_reset_btn

light:
  - platform: esp32_rmt_led_strip
    id: led
    name: None
    disabled_by_default: true
    entity_category: config
    pin: GPIO27
    default_transition_length: 0s
    chipset: SK6812
    num_leds: 1
    rgb_order: grb
    rmt_channel: 0
    effects:
      - pulse:
          name: "Slow Pulse"
          transition_length: 250ms
          update_interval: 250ms
          min_brightness: 50%
          max_brightness: 100%
      - pulse:
          name: "Fast Pulse"
          transition_length: 100ms
          update_interval: 100ms
          min_brightness: 50%
          max_brightness: 100%

script:
  - id: reset_led
    then:
      - if:
          condition:
            - switch.is_on: use_wake_word
            - switch.is_on: use_listen_light
          then:
            - light.turn_on:
                id: led
                red: 100%
                green: 89%
                blue: 71%
                brightness: 60%
                effect: none
          else:
            - light.turn_off: led

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
      - script.execute: reset_led
    on_turn_off:
      - voice_assistant.stop
      - lambda: id(va).set_use_wake_word(false);
      - script.execute: reset_led
  - platform: template
    name: Use Listen Light
    id: use_listen_light
    optimistic: true
    restore_mode: RESTORE_DEFAULT_ON
    entity_category: config
    on_turn_on:
      - script.execute: reset_led
    on_turn_off:
      - script.execute: reset_led

network:
  enable_ipv6: true

time:
- platform: homeassistant
  timezone: "Europe/Paris"

wireguard:
  address: xxx.xxx.xxx.xxx
  netmask: 255.255.255.0
  private_key: !secret enceinte_test_wg_priv_key
  peer_endpoint: !secret wg_peer_endpoint
  peer_port: !secret wg_peer_port
  peer_public_key: !secret wg_peer_pub_key
  peer_persistent_keepalive: 25s
  peer_allowed_ips:
  - "xxx.xxx.xxx.0/24"

external_components:
  - source: github://pr#5230
    components:
      - esp_adf
    refresh: 0s

esp_adf:

Firstly I am not sure why esp_adf is here because if I understand correctly, it is only for S3 box.
But even without it, nothing works.

I set up wake word with a wyoming-porcupine1 Docker container (on Podman) and its entity is discovered in Home Assistant.
I selected a wake word in my language when setting up the Assistant, Porcupine1 is selected as wake word engine.

But nothing happens when saying the selected word.
Not sure for the light as I am blind, but nothing is logged by running esphome logs except voice_assistant is waiting.

I tried to disable wake word switch. voice_assistant and microphone are switched off as expected but when pressing the button some seconds to be sure, nothing happens in the log, in fact nothing happens at all.
When restarting the board it logs Assistant is waiting but if I talk, nothing happens at all and if switch it off by long-pressing the button, if I do it again voice_assistant stays idle.

I don't think it comes specifically from my board because the following firmware, using push to talk for assist, works:

---
esphome:
  name: enceinte-test
  friendly_name: "Enceinte test"
  project:
    name: m5stack.atom-echo
    version: "1.0"
  min_version: 2023.5.0

esp32:
  board: m5stack-atom
  framework:
    type: arduino

logger:
  level: ERROR
  logs:
    light: ERROR
    esp32_rmt_led_strip: ERROR
    binary_sensor: ERROR
    api: ERROR
    ota: ERROR
    audio: error
    mdns: ERROR
    wifi: ERROR

api:
  encryption:
    key: !secret enceinte_test_encryption_key

ota:
  password: !secret enceinte_test_ota_pass

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_key
  #enable_btm: true
  #enable_rrm: true
  ap:
    password: !secret ap_key

#captive_portal:

i2s_audio:
  i2s_lrclk_pin: GPIO33
  i2s_bclk_pin: GPIO19

microphone:
  - platform: i2s_audio
    id: echo_microphone
    i2s_din_pin: GPIO23
    adc_type: external
    pdm: true

voice_assistant:
  microphone: echo_microphone
  #speaker: speaker_out
  media_player: media_out
  noise_suppression_level: 4
  auto_gain: 31dBFS
  volume_multiplier: 2.0
  #vad_threshold: 3
  on_start:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        effect: none
  on_tts_start:
    - light.turn_on:
        id: led
        blue: 0%
        red: 0%
        green: 100%
        effect: none
  on_tts_end:
    #- media_player.play_media: !lambda return x;
    - light.turn_on:
        id: led
        blue: 0%
        red: 0%
        green: 100%
        effect: pulse
  on_end:
    - delay: 1s
    - wait_until:
        not:
          media_player.is_playing: media_out
    - light.turn_off: led
  on_error:
    - light.turn_on:
        id: led
        blue: 0%
        red: 100%
        green: 0%
        effect: none
    - delay: 1s
    - light.turn_off: led

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO39
      inverted: true
    name: Button
    id: echo_button
    on_multi_click:
      - timing:
          - ON FOR AT MOST 350ms
          - OFF FOR AT LEAST 10ms
        then:
          - media_player.toggle: media_out
      - timing:
          - ON FOR AT LEAST 350ms
        then:
          - if:
              condition:
                media_player.is_playing: media_out
              then:
                - media_player.stop: media_out
          - voice_assistant.start:
      - timing:
          - ON FOR AT LEAST 350ms
          - OFF FOR AT LEAST 10ms
        then:
          - voice_assistant.stop:

#speaker:
  #- platform: i2s_audio
    #id: speaker_out
    #dac_type: external
    #i2s_dout_pin: GPIO22
    #mode: mono

media_player:
  - platform: i2s_audio
    id: media_out
    name: None
    dac_type: external
    i2s_dout_pin: GPIO22
    mode: mono

light:
  - platform: esp32_rmt_led_strip
    id: led
    name: None
    pin: GPIO27
    default_transition_length: 0s
    chipset: SK6812
    num_leds: 1
    rgb_order: grb
    rmt_channel: 0
    effects:
      - pulse:
          transition_length: 250ms
          update_interval: 250ms

network:
  enable_ipv6: true

text_sensor:
- platform: wifi_info
  ip_address:
    name: IP address

time:
- platform: homeassistant
  timezone: "Europe/Paris"

wireguard:
  address: xxx.xxx.xxx.xxx
  netmask: 255.255.255.0
  private_key: !secret enceinte_test_wg_priv_key
  peer_endpoint: !secret wg_peer_endpoint
  peer_port: !secret wg_peer_port
  peer_public_key: !secret wg_peer_pub_key
  peer_persistent_keepalive: 25s
  peer_allowed_ips:
  - "xxx.xx.xxx.0/24"

I would like to test wake word and even without it, having Assist working with the first firmware using a way or another and I really don't understand what I miss.

Tested with esphome 2023.11 and 2023.12 with the same results.

Request: ESP32-LyraTD-DSPG

Thank you for Echo code, works great!!
Can you PLEASE code voice assistant and media player for ESP32-LyraTD-DSPG? It appears little better hardware. Thank you in advance!!

M5Stack Atom Echo compilation error

Hi!

I have an M5Stack Atom Echo on which I try to run the following YAML code:

substitutions:
  name: "atom-echo"
  friendly_name: "Atom Echo"

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  name_add_mac_suffix: false
  project:
    name: m5stack.atom-echo-voice-assistant
    version: "1.0"
  min_version: 2023.11.1
  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: m5stack-atom
  framework:
    type: esp-idf

dashboard_import:
  package_import_url: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main

logger:

api:

ota:
  safe_mode: true
  num_attempts: 5
  password: !secret ota_password

web_server:

improv_serial:

wifi:
  ssid: !secret esphome_ssid
  password: !secret esphome_pwd
  manual_ip:
    static_ip: 192.168.1.139
    gateway: !secret esphome_gateway
    subnet: !secret esphome_subnet
    dns1: !secret esphome_dns1
    dns2: !secret esphome_dns2
  fast_connect: true

text_sensor:
  - platform: wifi_info
    mac_address:
      name:  "${friendly_name} Mac Address"

i2s_audio:
  i2s_lrclk_pin: GPIO33
  i2s_bclk_pin: GPIO19

microphone:
  - platform: i2s_audio
    id: echo_microphone
    i2s_din_pin: GPIO23
    adc_type: external
    pdm: true

speaker:
  - platform: i2s_audio
    id: echo_speaker
    i2s_dout_pin: GPIO22
    dac_type: external
    mode: mono

voice_assistant:
  id: va
  microphone: echo_microphone
  speaker: echo_speaker
  noise_suppression_level: 2
  auto_gain: 31dBFS
  volume_multiplier: 2.0
  vad_threshold: 3
  on_listening:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        effect: "Slow Pulse"
  on_stt_vad_end:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        effect: "Fast Pulse"
  on_tts_start:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        brightness: 100%
        effect: none
  on_end:
    - delay: 100ms
    - wait_until:
        not:
          speaker.is_playing:
    - script.execute: reset_led
  on_error:
    - light.turn_on:
        id: led
        red: 100%
        green: 0%
        blue: 0%
        brightness: 100%
        effect: none
    - delay: 1s
    - script.execute: reset_led
  on_client_connected:
    - if:
        condition:
          switch.is_on: use_wake_word
        then:
          - voice_assistant.start_continuous:
          - script.execute: reset_led
  on_client_disconnected:
    - if:
        condition:
          switch.is_on: use_wake_word
        then:
          - voice_assistant.stop:
          - light.turn_off: led

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO39
      inverted: true
    name: Button
    disabled_by_default: true
    entity_category: diagnostic
    id: echo_button
    on_click:
      - if:
          condition:
            switch.is_off: use_wake_word
          then:
            - if:
                condition: voice_assistant.is_running
                then:
                  - voice_assistant.stop:
                  - script.execute: reset_led
                else:
                  - voice_assistant.start:
          else:
            - voice_assistant.stop
            - delay: 1s
            - script.execute: reset_led
            - script.wait: reset_led
            - voice_assistant.start_continuous:

light:
  - platform: esp32_rmt_led_strip
    id: led
    name: None
    disabled_by_default: true
    entity_category: config
    pin: GPIO27
    default_transition_length: 0s
    chipset: SK6812
    num_leds: 1
    rgb_order: grb
    rmt_channel: 0
    effects:
      - pulse:
          name: "Slow Pulse"
          transition_length: 250ms
          update_interval: 250ms
          min_brightness: 50%
          max_brightness: 100%
      - pulse:
          name: "Fast Pulse"
          transition_length: 100ms
          update_interval: 100ms
          min_brightness: 50%
          max_brightness: 100%

script:
  - id: reset_led
    then:
      - if:
          condition:
            - switch.is_on: use_wake_word
            - switch.is_on: use_listen_light
          then:
            - light.turn_on:
                id: led
                red: 100%
                green: 89%
                blue: 71%
                brightness: 60%
                effect: none
          else:
            - light.turn_off: led

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
      - script.execute: reset_led
    on_turn_off:
      - voice_assistant.stop
      - lambda: id(va).set_use_wake_word(false);
      - script.execute: reset_led
  - platform: template
    name: Use Listen Light
    id: use_listen_light
    optimistic: true
    restore_mode: RESTORE_DEFAULT_ON
    entity_category: config
    on_turn_on:
      - script.execute: reset_led
    on_turn_off:
      - script.execute: reset_led

external_components:
  - source: github://pr#5230
    components:
      - esp_adf
    refresh: 0s

esp_adf:

When I compile it I get the following error message:

INFO ESPHome 2023.12.8
INFO Reading configuration /config/esphome/atom-echo.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
INFO Generating C++ source...
INFO Updating https://github.com/espressif/[email protected]
INFO Updating submodules (components/esp-sr, components/esp-adf-libs) for https://github.com/espressif/[email protected]
INFO Updating https://github.com/espressif/[email protected]
INFO Compiling app...
Processing atom-echo (board: m5stack-atom; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40405.230623 (4.4.5) 
 - tool-cmake @ 3.16.9 
 - tool-ninja @ 1.10.2 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
JSONDecodeError: Expecting value: line 1 column 1 (char 0):
  File "/usr/local/lib/python3.11/dist-packages/platformio/builder/main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/data/cache/platformio/platforms/espressif32/builder/main.py", line 312:
    target_elf = env.BuildProgram()
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/platformio/builder/tools/piobuild.py", line 61:
    env.ProcessProgramDeps()
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/platformio/builder/tools/piobuild.py", line 121:
    env.BuildFrameworks(env.get("PIOFRAMEWORK"))
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Util/envs.py", line 242:
    return self.method(*nargs, **kwargs)
  File "/usr/local/lib/python3.11/dist-packages/platformio/builder/tools/piobuild.py", line 342:
    SConscript(env.GetFrameworkScript(name), exports="env")
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 662:
    return method(*args, **kw)
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 598:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/data/cache/platformio/packages/tool-scons/scons-local-4.5.2/SCons/Script/SConscript.py", line 285:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/data/cache/platformio/platforms/espressif32/builder/frameworks/espidf.py", line 1326:
    project_codemodel = get_cmake_code_model(
  File "/data/cache/platformio/platforms/espressif32/builder/frameworks/espidf.py", line 222:
    codemodel = json.load(fp)
  File "/usr/lib/python3.11/json/__init__.py", line 293:
    return loads(fp.read(),
  File "/usr/lib/python3.11/json/__init__.py", line 346:
    return _default_decoder.decode(s)
  File "/usr/lib/python3.11/json/decoder.py", line 337:
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.11/json/decoder.py", line 355:
    raise JSONDecodeError("Expecting value", s, err.value) from None
========================== [FAILED] Took 6.36 seconds ==========================

What is causing this?

ESP-S3-BOX-3: Unexpected error during wake-word-detection

I flashed my ESP-S3-Box-3 by using the esphome.io website. I had connected the box to HA. The waiting house symbol appears on the screen. There is a little snap sound after the startup was successful. After saying "ok nabu" the orange house (error) appears and no more response is possible. I'm using piper, openwakeword and whisper as local addons in my HA supervised installation.

ESPHOME shows the following output:

[22:06:00][D][api.connection:1089]: Home Assistant 2023.12.3 (xx.xx.xx.xx): Connected successfully
[22:06:00][W][component:214]: Component api took a long time for an operation (0.28 s).
[22:06:00][W][component:215]: Components should block for at most 20-30ms.
[22:06:01][D][voice_assistant:422]: State changed from IDLE to START_MICROPHONE
[22:06:01][D][voice_assistant:428]: Desired state set to WAIT_FOR_VAD
[22:06:01][W][component:214]: Component api took a long time for an operation (0.28 s).
[22:06:01][W][component:215]: Components should block for at most 20-30ms.
[22:06:01][D][voice_assistant:159]: Starting Microphone
[22:06:01][D][voice_assistant:422]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[22:06:01][D][esp-idf:000]: I (25378) I2S: DMA Malloc info, datalen=blocksize=512, dma_buf_count=8

[22:06:01][D][esp-idf:000]: I (25384) I2S: I2S0, MCLK output by GPIO2

[22:06:01][D][esp-idf:000]: I (25390) AUDIO_PIPELINE: link el->rb, el:0x3d036c54, tag:i2s, rb:0x3d037068

[22:06:01][D][esp-idf:000]: I (25393) AUDIO_PIPELINE: link el->rb, el:0x3d036dc8, tag:filter, rb:0x3d0390a8

[22:06:01][D][esp-idf:000]: I (25399) AUDIO_ELEMENT: [i2s-0x3d036c54] Element task created

[22:06:01][D][esp-idf:000]: I (25402) AUDIO_THREAD: The filter task allocate stack on external memory

[22:06:01][D][esp-idf:000]: I (25409) AUDIO_ELEMENT: [filter-0x3d036dc8] Element task created

[22:06:01][D][esp-idf:000]: I (25415) AUDIO_ELEMENT: [raw-0x3d036ef8] Element task created

[22:06:01][D][esp-idf:000]: I (25419) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:16586299 Bytes, Inter:50964 Bytes, Dram:50964 Bytes


[22:06:01][D][esp-idf:000]: I (25422) AUDIO_ELEMENT: [i2s] AEL_MSG_CMD_RESUME,state:1

[22:06:01][D][esp-idf:000]: I (25425) AUDIO_ELEMENT: [filter] AEL_MSG_CMD_RESUME,state:1

[22:06:01][D][esp-idf:000]: I (25429) RSP_FILTER: sample rate of source data : 16000, channel of source data : 2, sample rate of destination data : 16000, channel of destination data : 1

[22:06:01][D][esp-idf:000]: I (25432) AUDIO_PIPELINE: Pipeline started

[22:06:01][D][esp_adf.microphone:294]: Microphone started
[22:06:01][D][voice_assistant:422]: State changed from STARTING_MICROPHONE to WAIT_FOR_VAD
[22:06:01][D][voice_assistant:176]: Waiting for speech...
[22:06:01][D][voice_assistant:422]: State changed from WAIT_FOR_VAD to WAITING_FOR_VAD
[22:06:06][D][voice_assistant:189]: VAD detected speech
[22:06:06][D][voice_assistant:422]: State changed from WAITING_FOR_VAD to START_PIPELINE
[22:06:06][D][voice_assistant:428]: Desired state set to STREAMING_MICROPHONE
[22:06:06][D][voice_assistant:206]: Requesting start...
[22:06:06][D][voice_assistant:422]: State changed from START_PIPELINE to STARTING_PIPELINE
[22:06:06][D][voice_assistant:443]: Client started, streaming microphone
[22:06:06][D][voice_assistant:422]: State changed from STARTING_PIPELINE to STREAMING_MICROPHONE
[22:06:06][D][voice_assistant:428]: Desired state set to STREAMING_MICROPHONE
[22:06:06][D][voice_assistant:529]: Event Type: 0
[22:06:06][E][voice_assistant:656]: Error: no_wake_word - No wake word detected
[22:06:06][D][voice_assistant:522]: Signaling stop...
[22:06:06][D][voice_assistant:422]: State changed from STREAMING_MICROPHONE to STOP_MICROPHONE
[22:06:06][D][voice_assistant:428]: Desired state set to IDLE
[22:06:06][D][esp_adf.microphone:256]: Stopping microphone
[22:06:06][D][voice_assistant:422]: State changed from STOP_MICROPHONE to STOPPING_MICROPHONE
[22:06:06][D][esp-idf:000]: W (30571) AUDIO_ELEMENT: IN-[filter] AEL_IO_ABORT

[22:06:06][D][esp-idf:000]: E (30575) AUDIO_ELEMENT: [filter] Element already stopped

[22:06:06][D][esp-idf:000]: W (30603) AUDIO_PIPELINE: There are no listener registered

[22:06:06][D][esp-idf:000]: I (30607) AUDIO_PIPELINE: audio_pipeline_unlinked

[22:06:06][D][esp-idf:000]: W (30612) AUDIO_ELEMENT: [i2s] Element has not create when AUDIO_ELEMENT_TERMINATE

[22:06:06][D][esp-idf:000]: I (30617) I2S: DMA queue destroyed

[22:06:06][D][esp-idf:000]: W (30624) AUDIO_ELEMENT: [filter] Element has not create when AUDIO_ELEMENT_TERMINATE

[22:06:07][D][esp-idf:000]: W (30629) AUDIO_ELEMENT: [raw] Element has not create when AUDIO_ELEMENT_TERMINATE

[22:06:07][W][component:214]: Component voice_assistant took a long time for an operation (0.28 s).
[22:06:07][W][component:215]: Components should block for at most 20-30ms.
[22:06:07][D][voice_assistant:529]: Event Type: 2
[22:06:07][D][voice_assistant:619]: Assist Pipeline ended
[22:06:07][D][voice_assistant:529]: Event Type: 1
[22:06:07][D][voice_assistant:532]: Assist Pipeline running
[22:06:07][D][voice_assistant:529]: Event Type: 9
[22:06:07][D][esp_adf.microphone:306]: Microphone stopped
[22:06:07][D][voice_assistant:529]: Event Type: 0
[22:06:07][E][voice_assistant:656]: Error: wake-stream-failed - Unexpected error during wake-word-detection
[22:06:07][D][voice_assistant:522]: Signaling stop...
[22:06:07][D][voice_assistant:422]: State changed from STOPPING_MICROPHONE to STOP_MICROPHONE
[22:06:07][D][voice_assistant:428]: Desired state set to IDLE
[22:06:07][D][voice_assistant:422]: State changed from STOP_MICROPHONE to IDLE
[22:06:07][W][component:214]: Component voice_assistant took a long time for an operation (0.27 s).
[22:06:07][W][component:215]: Components should block for at most 20-30ms.
[22:06:07][D][voice_assistant:529]: Event Type: 2
[22:06:07][D][voice_assistant:619]: Assist Pipeline ended
[22:06:07][D][voice_assistant:422]: State changed from IDLE to START_MICROPHONE
[22:06:07][D][voice_assistant:428]: Desired state set to WAIT_FOR_VAD
[22:06:07][D][voice_assistant:159]: Starting Microphone
[22:06:07][D][voice_assistant:422]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[22:06:07][D][esp-idf:000]: I (31287) I2S: DMA Malloc info, datalen=blocksize=512, dma_buf_count=8

[22:06:07][D][esp-idf:000]: I (31292) I2S: I2S0, MCLK output by GPIO2

[22:06:07][D][esp-idf:000]: I (31299) AUDIO_PIPELINE: link el->rb, el:0x3d036c54, tag:i2s, rb:0x3d037068

[22:06:07][D][esp-idf:000]: I (31303) AUDIO_PIPELINE: link el->rb, el:0x3d036dc8, tag:filter, rb:0x3d0390a8

[22:06:07][D][esp-idf:000]: I (31310) AUDIO_ELEMENT: [i2s-0x3d036c54] Element task created

[22:06:07][D][esp-idf:000]: I (31313) AUDIO_THREAD: The filter task allocate stack on external memory

[22:06:07][D][esp-idf:000]: I (31318) AUDIO_ELEMENT: [filter-0x3d036dc8] Element task created

[22:06:07][D][esp-idf:000]: I (31323) AUDIO_ELEMENT: [raw-0x3d036ef8] Element task created

[22:06:07][D][esp-idf:000]: I (31326) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:16586747 Bytes, Inter:51412 Bytes, Dram:51412 Bytes


[22:06:07][D][esp-idf:000]: I (31330) AUDIO_ELEMENT: [i2s] AEL_MSG_CMD_RESUME,state:1

[22:06:07][D][esp-idf:000]: I (31332) AUDIO_ELEMENT: [filter] AEL_MSG_CMD_RESUME,state:1

[22:06:07][D][esp-idf:000]: I (31336) RSP_FILTER: sample rate of source data : 16000, channel of source data : 2, sample rate of destination data : 16000, channel of destination data : 1

[22:06:07][D][esp-idf:000]: I (31339) AUDIO_PIPELINE: Pipeline started

[22:06:07][D][esp_adf.microphone:294]: Microphone started
[22:06:07][D][voice_assistant:422]: State changed from STARTING_MICROPHONE to WAIT_FOR_VAD
[22:06:07][D][voice_assistant:176]: Waiting for speech...
[22:06:07][D][voice_assistant:422]: State changed from WAIT_FOR_VAD to WAITING_FOR_VAD
[22:06:08][W][component:214]: Component voice_assistant took a long time for an operation (0.27 s).
[22:06:08][W][component:215]: Components should block for at most 20-30ms.
[22:06:08][W][component:214]: Component voice_assistant took a long time for an operation (0.27 s).
[22:06:08][W][component:215]: Components should block for at most 20-30ms.

HA assist debug:
image

stage: done
run:
  pipeline: 01hhz9tr3494bh7s6fvc967ncw
  language: en
events:
  - type: run-start
    data:
      pipeline: 01hhz9tr3494bh7s6fvc967ncw
      language: en
    timestamp: "2023-12-18T21:06:06.836622+00:00"
  - type: wake_word-start
    data:
      entity_id: wake_word.openwakeword
      metadata:
        format: wav
        codec: pcm
        bit_rate: 16
        sample_rate: 16000
        channel: 1
      timeout: 5
    timestamp: "2023-12-18T21:06:06.837100+00:00"
  - type: error
    data:
      code: wake-stream-failed
      message: Unexpected error during wake-word-detection
    timestamp: "2023-12-18T21:06:06.847630+00:00"
  - type: run-end
    data: null
    timestamp: "2023-12-18T21:06:06.848318+00:00"
wake_word:
  entity_id: wake_word.openwakeword
  metadata:
    format: wav
    codec: pcm
    bit_rate: 16
    sample_rate: 16000
    channel: 1
  timeout: 5
  done: false
error:
  code: wake-stream-failed
  message: Unexpected error during wake-word-detection

DIY mode on Bluetooth web flasher has gone missing

There used be a link on the Bluetooth page to enable DIY devices.. This seems to now be missing unless I am missing something.

The items are still there but always hidden now.
https://esphome.io/projects/?type=bluetooth

<label class="diy">
      <input type="radio" name="bluetooth-device" class="device-option" value="lilygo-t-eth-poe">
      <img src="/_static/projects/bluetooth-proxy/lilygo-eth-poe.png" alt="LilyGO T-ETH-POE">
</label>

body .diy {
    display: none;
}

Cannot connect after flashing to S3-box.

Ok, I do not know what I am missing here.
I first tried the S3-BOX-lite - it does not prompt for the password. Just display the screen "No WiFi" after a few seconds. My smartphone connects to the wifi ap, but it never asks for the wifi-credentials.
Then I downloaded the github code, add the wifi credentials to the code, flash that and the device goes into a boot-loop, Screen stay black all the time.

Then I tried a S3-BOX by flashing the code from ESPHOME.io/projects. Selected the correct device, but after flashing the wifi-credentials problem is the same. Never asks for the credentials and screen turn to "no Wi-fi" display.
It was picked up by HA integrations, but clicking on "configure" does not do anything, it just tries to connect without any luck. Connection failed
Do I have to connect the device into the Yellow that runs HA or into any PC connected to the newwork?
Even connecting it directly to the yellow that is running HA, does not make any difference.

ESPHome BT Proxy crashes

I have been trying to figure out what was going on with my LD2410 sensors which kept getting to 'Unavailable' state. I use ESPHome BT proxy with it. After narrowing it down, it seems that I kept seeing the BT Proxy having errors.

I have 3 LD2410 sensors and 4 BT Proxies. It seems to me that is plenty capacity for the proxies to handle 3 sensors. My other wifi based ESP devices have no issues with any connections.

Since there is not much is exposed in BTProxy for HA, I can't really monitor BT Proxy. There is no uptime, other diagnostic info I can watch in HD. Looking at HA logs I see something like below.Hopefully someone can shed some lights why the BT Proxy goes 'Unavailable' and how to fix it.

Thanks.

The error log shows:

home-assistant.log:2023-12-09 11:54:48.121 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received
home-assistant.log:bleak_retry_connector.BleakOutOfConnectionSlotsError: HLK-LD2410B_A4CB - 8A:5A:C4:15:A4:CB: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address 8A:5A:C4:15:A4:CB was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device
home-assistant.log:2023-12-09 11:58:50.050 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log:2023-12-09 11:58:53.525 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log:bleak_retry_connector.BleakOutOfConnectionSlotsError: HLK-LD2410B_BFBF - 19:96:5F:6E:BF:BF: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address 19:96:5F:6E:BF:BF was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device
home-assistant.log:2023-12-09 12:02:40.665 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log:2023-12-09 12:22:41.861 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log.1:2023-12-09 00:19:37.016 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received
home-assistant.log.1:2023-12-09 00:19:42.619 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 00:27:37.359 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 00:27:39.137 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received
home-assistant.log.1:2023-12-09 00:32:47.652 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received
home-assistant.log.1:2023-12-09 00:44:14.759 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log.1:2023-12-09 00:45:38.096 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 00:50:38.243 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: [Errno 104] Connection reset by peer
home-assistant.log.1:2023-12-09 00:55:14.242 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log.1:2023-12-09 01:02:08.593 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log.1:2023-12-09 01:07:39.723 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received
home-assistant.log.1:2023-12-09 01:07:48.828 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: [Errno 104] Connection reset by peer
home-assistant.log.1:2023-12-09 01:07:48.842 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Read failed (ReadFailedAPIError)
home-assistant.log.1:2023-12-09 01:08:52.906 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 01:19:38.251 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 01:26:18.159 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:bleak_retry_connector.BleakOutOfConnectionSlotsError: HLK-LD2410B_BFBF - 19:96:5F:6E:BF:BF: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address 19:96:5F:6E:BF:BF was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device
home-assistant.log.1:2023-12-09 01:31:52.768 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 01:44:42.871 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 01:58:29.205 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 01:59:50.674 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log.1:2023-12-09 02:02:52.228 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received
home-assistant.log.1:2023-12-09 02:03:02.238 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Hello timed out (TimeoutAPIError)
home-assistant.log.1:2023-12-09 02:03:02.238 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection lost
home-assistant.log.1:bleak_retry_connector.BleakOutOfConnectionSlotsError: HLK-LD2410B_A4CB - 8A:5A:C4:15:A4:CB: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address 8A:5A:C4:15:A4:CB was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device
home-assistant.log.1:2023-12-09 02:10:16.389 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 02:21:32.566 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log.1:2023-12-09 02:22:45.715 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received
home-assistant.log.1:2023-12-09 02:22:55.727 WARNING (MainThread) [aioesphomeapi.reconnect_logic] Can't connect to ESPHome API for esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Hello timed out (TimeoutAPIError)
home-assistant.log.1:2023-12-09 02:22:55.727 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection lost
home-assistant.log.1:bleak_retry_connector.BleakOutOfConnectionSlotsError: HLK-LD2410B_A4CB - 8A:5A:C4:15:A4:CB: Failed to connect after 9 attempt(s): No backend with an available connection slot that can reach address 8A:5A:C4:15:A4:CB was found: The proxy/adapter is out of connection slots or the device is no longer reachable; Add additional proxies (https://esphome.github.io/bluetooth-proxies/) near this device
home-assistant.log.1:2023-12-09 02:58:42.364 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 03:12:52.510 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-d01390 @ 192.168.11.159: Connection error occurred: esp32-bluetooth-proxy-d01390 @ 192.168.11.159: EOF received
home-assistant.log.1:2023-12-09 03:43:32.343 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: Connection error occurred: esp32-bluetooth-proxy-6a1604 @ 192.168.11.179: EOF received
home-assistant.log.1:2023-12-09 07:39:06.610 WARNING (MainThread) [aioesphomeapi.connection] esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: Connection error occurred: esp32-bluetooth-proxy-67eb80 @ 192.168.11.183: EOF received

on_wake_word_detected

Can there be an on_wake_word_detected trigger in voice-assistant/m5stack-atom-echo.yaml we can use to call HA services to pause other speakers/TVs/etc.? I would also call sonos.snapshot.

Unable to compile. Missing Python executable file?

I have tried compiling this multiple times and regardless of the config I am getting an error. I am running Home Assistant on HassOS with the ESPHome module installed. The OS and all modules are up to date.

image

Cannot compile the firmware with Esphome 2023.11.6

Getting the following error during the compile:

src/main.cpp: In function 'void setup()':
src/main.cpp:651:44: error: invalid new-expression of abstract class type 'esphome::esp_adf::ESPADFSpeaker'
   box_speaker = new esp_adf::ESPADFSpeaker();
                                            ^
In file included from src/esphome.h:28,
                 from src/main.cpp:3:
src/esphome/components/esp_adf/speaker/esp_adf_speaker.h:20:7: note:   because the following virtual functions are pure within 'esphome::esp_adf::ESPADFSpeaker':
 class ESPADFSpeaker : public ESPADFPipeline, public speaker::Speaker, public Component {
       ^~~~~~~~~~~~~
In file included from src/esphome/components/esp_adf/speaker/esp_adf_speaker.h:10,
                 from src/esphome.h:28,
                 from src/main.cpp:3:
src/esphome/components/speaker/speaker.h:21:16: note: 	'virtual bool esphome::speaker::Speaker::has_buffered_data() const'
   virtual bool has_buffered_data() const = 0;

[use_wake_word] is an invalid option for [voice_assistant]. Did you mean [speaker]?

Below is my yaml source (as provided by Everything Smart Home youtube channel. His source given here: https://gist.github.com/EverythingSmartHome/055fbdde31a607ef9d695d5cac780e94

I get these errors when trying to compile:

INFO ESPHome 2023.9.3
INFO Reading configuration /config/esphome/mic-speaker.yaml...
Failed config

voice_assistant: [source /config/esphome/mic-speaker.yaml:56]
  microphone: mic
  speaker: big_speaker
  
  [use_wake_word] is an invalid option for [voice_assistant]. Did you mean [speaker]?
  use_wake_word: True
  
  [noise_suppression_level] is an invalid option for [voice_assistant]. Please check the indentation.
  noise_suppression_level: 2
  
  [auto_gain] is an invalid option for [voice_assistant]. Please check the indentation.
  auto_gain: 31dBFS
  
  [volume_multiplier] is an invalid option for [voice_assistant]. Please check the indentation.
  volume_multiplier: 2.0
  id: assist

And yet, the voice_assistant section is nearly identical to the sample source shown on this esphome firmware using those same keywords which are throwing errors: https://github.com/esphome/firmware/blob/main/voice-assistant/esp32-s3-box.yaml

esphome:
  name: mic-speaker
  friendly_name: mic-speaker
  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:

# Enable Home Assistant API
api:

ota:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32-Mic-Speaker"
    password: !secret wifi_password

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
  speaker: big_speaker
  use_wake_word: true
  noise_suppression_level: 2
  auto_gain: 31dBFS
  volume_multiplier: 2.0
  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);

What is going wrong here or is it something I have missed?

Cannot install/edit new configuration Atom Echo M5 anymore

I just wanted to update the yaml-file of my working Atom Echo M5. It does not work anymore. Am I doing something wrong? Is this a bug? I am running the latest version of Home Assistant on a Rhaspberry 4 with the ESPHome-beta-AddOn.

Christian

INFO ESPHome 2023.10.1
INFO Reading configuration /config/esphome/m5stack-atom-echo-8a1468.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
INFO Generating C++ source...
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 33, in <module>
    sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
  File "/esphome/esphome/__main__.py", line 1036, in main
    return run_esphome(sys.argv)
  File "/esphome/esphome/__main__.py", line 1023, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
  File "/esphome/esphome/__main__.py", line 454, in command_run
    exit_code = write_cpp(config)
  File "/esphome/esphome/__main__.py", line 190, in write_cpp
    return write_cpp_file()
  File "/esphome/esphome/__main__.py", line 208, in write_cpp_file
    writer.write_cpp(code_s)
  File "/esphome/esphome/writer.py", line 342, in write_cpp
    copy_src_tree()
  File "/esphome/esphome/writer.py", line 295, in copy_src_tree
    copy_files()
  File "/esphome/esphome/components/esp32/__init__.py", line 593, in copy_files
    repo_dir, _ = git.clone_or_update(
  File "/esphome/esphome/git.py", line 95, in clone_or_update
    old_sha = run_git_command(["git", "rev-parse", "HEAD"], str(repo_dir))
  File "/esphome/esphome/git.py", line 32, in run_git_command
    raise cv.Invalid(err_str)
voluptuous.error.Invalid: fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Muse luxe loud static when assist is turned on

Installed the firmware today and setup the full assist pipeline. When pressing the play button or toggling the assist switch in the HA UI I get full volume static blasting out of the speakers.

Any idea what's going on?

ESP32 S3 BOX 3 - voice assistant - wake word detected and hangs forever

Based on a logs it is clear that it detects "ok nabu" and kind of trying to start some next steps, but the image on the screen is not changing, it is still black background, nothing happens, and it stuck right there, never have any other movement. If I reset, it can repeat same logs and I do see reaction in a logs after "ok nabu", but that's it.

Could you give some hints, where is the next problem? HA is configured with whisper+piper+openWakeWord, ESPHome can compile and install OTA, what should I do next?

[00:39:40][W][micro_wake_word:150]: Wake word is already running
[00:39:47][D][micro_wake_word:121]: Wake Word Detected
[00:39:47][D][micro_wake_word:170]: State changed from DETECTING_WAKE_WORD to STOP_MICROPHONE
[00:39:47][D][micro_wake_word:127]: Stopping Microphone
[00:39:47][D][esp_adf.microphone:234]: Stopping microphone
[00:39:47][D][micro_wake_word:170]: State changed from STOP_MICROPHONE to STOPPING_MICROPHONE
[00:39:47][D][esp-idf:000]: W (24293) AUDIO_ELEMENT: IN-[filter] AEL_IO_ABORT

[00:39:47][D][esp-idf:000]: E (24296) AUDIO_ELEMENT: [filter] Element already stopped

[00:39:47][D][esp-idf:000]: W (24324) AUDIO_PIPELINE: There are no listener registered

[00:39:47][D][esp-idf:000]: I (24327) AUDIO_PIPELINE: audio_pipeline_unlinked

[00:39:47][D][esp-idf:000]: W (24332) AUDIO_ELEMENT: [i2s] Element has not create when AUDIO_ELEMENT_TERMINATE

[00:39:47][D][esp-idf:000]: I (24337) I2S: DMA queue destroyed

[00:39:47][D][esp-idf:000]: W (24343) AUDIO_ELEMENT: [filter] Element has not create when AUDIO_ELEMENT_TERMINATE

[00:39:47][D][esp-idf:000]: W (24346) AUDIO_ELEMENT: [raw] Element has not create when AUDIO_ELEMENT_TERMINATE

[00:39:47][D][esp_adf.microphone:285]: Microphone stopped
[00:39:47][D][micro_wake_word:170]: State changed from STOPPING_MICROPHONE to IDLE
[00:39:47][D][voice_assistant:414]: State changed from IDLE to START_PIPELINE
[00:39:47][D][voice_assistant:420]: Desired state set to START_MICROPHONE
[00:39:47][D][voice_assistant:118]: microphone not running
[00:39:47][D][voice_assistant:202]: Requesting start...
[00:39:47][D][voice_assistant:414]: State changed from START_PIPELINE to STARTING_PIPELINE
[00:39:47][D][voice_assistant:435]: Client started, streaming microphone
[00:39:47][D][voice_assistant:414]: State changed from STARTING_PIPELINE to START_MICROPHONE
[00:39:47][D][voice_assistant:420]: Desired state set to STREAMING_MICROPHONE
[00:39:47][D][voice_assistant:155]: Starting Microphone
[00:39:47][D][voice_assistant:414]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[00:39:47][D][esp-idf:000]: I (24409) I2S: DMA Malloc info, datalen=blocksize=512, dma_buf_count=8

[00:39:47][D][esp-idf:000]: I (24417) I2S: I2S0, MCLK output by GPIO2

[00:39:47][D][esp-idf:000]: I (24426) AUDIO_PIPELINE: link el->rb, el:0x3d05a7f8, tag:i2s, rb:0x3d05ac0c

[00:39:47][D][esp-idf:000]: I (24430) AUDIO_PIPELINE: link el->rb, el:0x3d05a96c, tag:filter, rb:0x3d05cc4c

[00:39:47][D][esp-idf:000]: I (24441) AUDIO_ELEMENT: [i2s-0x3d05a7f8] Element task created

m5 echo bug: can't unpause, unmute. unresponsive.

Using as HA integration via ESPhome. It mostly works, however some features are broken:

  1. Power button does nothing
  2. If muted, can't unmute. Have to restart the board.
  3. If paused, can't unpause. Renders unusable
  4. Starts ar full volume, even resets to full volume after unsuccessful stream.
  5. Audio quality is really low, seems like 8bit, low frequencies are filtered out and does not sound good even with high end, sensitive speaker.
  6. Klicks/pops when starting stream. Needs some fade-in and fade-out.
  7. Buffering issues, intermittent audio streaming (using HA radio browser).

I was hoping I have finally found a wifi amplifier that works with HA. Nice progress, but much work remaining.

ESP32-S3-Box3: Utilize Sensor-DOCK

The ESP32-S3-Box3 comes with a collection of different stands.

image

The "default" DOCK does not have much options to support, but the SENSOR does come with an AHT30 Temperature Sensor, a RADAR Sensor, an IR Receiver and Transmitter - and some other options, such as an SD-Card Reader...

It would be great, if the Firmware could provide some options to utilize the Sensors from the SENSOR dock...
I know, that most are not yet available within ESPHome (the RadarSensor, for Example), But the AHT30 could be used with the AHT20 variant of AHT10 component ...

[EDIT]

With adding the following to the config, the AHT30 can already be used:

i2c:
  - id: bus_a
    sda: GPIO08
    scl: GPIO18
    scan: true

  - sda: GPIO41
    scl: GPIO40
    id: bus_b

sensor:
  - platform: aht10
    variant: AHT20
    i2c_id: bus_b
    temperature:
      name: ${name_temperature}
    humidity:
      name: ${name_humidity}
    update_interval: 60s

ESP32 s3 box - lite No WIFI prompt after install

Completed the install process via ESPHome, ESP s3 Box Lite no prompt to setup WIFI after install

YAML I am using


esphome:
name: esp32-s3-box-lite
friendly_name: ESP32 S3 Box Lite
platformio_options:
board_build.flash_mode: dio
project:
name: esphome.voice-assistant
version: "1.0"
min_version: 2023.10.0b1
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: esp32s3box
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"

api:
ota:
logger:
hardware_uart: USB_SERIAL_JTAG
logs:
sensor: INFO

dashboard_import:
package_import_url: github://esphome/firmware/voice-assistant/esp32-s3-box-lite.yaml@main

wifi:
ap:

sensor:

  • platform: adc
    pin: GPIO1
    id: front_buttons
    update_interval: 16ms
    attenuation: 11db
    on_value:

    • lambda: |-
      // none: 3.121
      // left: 2.392
      // middle: 1.965
      // left+middle: 1.600
      // right: 0.794
      // left+right: 0.726
      // middle+right: 0.682
      // all: 0.632
      if (x > 3) {
      id(left).publish_state(false);
      id(middle).publish_state(false);
      id(right).publish_state(false);
      } else if (x > 2.3) {
      id(left).publish_state(true);
      id(middle).publish_state(false);
      id(right).publish_state(false);
      } else if (x > 1.9) {
      id(left).publish_state(false);
      id(middle).publish_state(true);
      id(right).publish_state(false);
      } else if (x > 1) {
      id(left).publish_state(true);
      id(middle).publish_state(true);
      id(right).publish_state(false);
      } else if (x > 0.73) {
      id(left).publish_state(false);
      id(middle).publish_state(false);
      id(right).publish_state(true);
      } else if (x > 0.7) {
      id(left).publish_state(true);
      id(middle).publish_state(false);
      id(right).publish_state(true);
      } else if (x > 0.65) {
      id(left).publish_state(false);
      id(middle).publish_state(true);
      id(right).publish_state(true);
      } else {
      id(left).publish_state(true);
      id(middle).publish_state(true);
      id(right).publish_state(true);
      }
      binary_sensor:
  • platform: template
    id: left
    name: "Left"

  • platform: template
    id: middle
    name: "Middle"

  • platform: template
    id: right
    name: "Right"

  • platform: gpio
    pin:
    number: GPIO0
    mode: INPUT_PULLUP
    inverted: true
    name: Left Top Button
    disabled_by_default: true
    on_click:

    • if:
      condition:
      switch.is_off: use_wake_word
      then:
      - if:
      condition: voice_assistant.is_running
      then:
      - voice_assistant.stop:
      - script.execute: reset_led
      else:
      - voice_assistant.start:
      else:
      - voice_assistant.stop
      - delay: 1s
      - script.execute: reset_led
      - script.wait: reset_led
      - voice_assistant.start_continuous:

output:

  • platform: ledc
    pin: GPIO45
    inverted: true
    id: backlight_output

light:

  • platform: monochromatic
    output: backlight_output
    name: LCD Backlight
    id: led
    restore_mode: ALWAYS_OFF
    disabled_by_default: true
    default_transition_length: 0s
    effects:
    • pulse:
      transition_length: 250ms
      update_interval: 250ms

esp_adf:
board: esp32s3boxlite

microphone:

  • platform: esp_adf
    id: box_mic

speaker:

  • platform: esp_adf
    id: box_speaker

voice_assistant:
id: va
microphone: box_mic
speaker: box_speaker
use_wake_word: true
noise_suppression_level: 2
auto_gain: 31dBFS
volume_multiplier: 2.0
vad_threshold: 3
on_listening:
- light.turn_on:
id: led
blue: 100%
red: 0%
green: 0%
brightness: 100%
effect: pulse
on_tts_start:
- light.turn_on:
id: led
blue: 0%
red: 0%
green: 100%
brightness: 100%
effect: pulse
on_end:
- delay: 100ms
- wait_until:
not:
speaker.is_playing:
- script.execute: reset_led
on_error:
- light.turn_on:
id: led
blue: 0%
red: 100%
green: 0%
brightness: 100%
effect: none
- delay: 1s
- script.execute: reset_led
- script.wait: reset_led
- lambda: |-
if (code == "wake-provider-missing" || code == "wake-engine-missing") {
id(use_wake_word).turn_off();
}

script:

  • id: reset_led
    then:
    • if:
      condition:
      switch.is_on: use_wake_word
      then:
      - light.turn_on:
      id: led
      blue: 100%
      red: 100%
      green: 0%
      brightness: 100%
      effect: none
      else:
      - light.turn_off: led

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
    • script.execute: reset_led
      on_turn_off:
    • voice_assistant.stop
    • lambda: id(va).set_use_wake_word(false);
    • script.execute: reset_led

external_components:

  • source: github://pr#5230
    components: esp_adf
    refresh: 0s

psram:
mode: octal
speed: 80MHz

M5Stack Atom Echo V1.1 update

I've recently purchased three M5Atom Echo units on amazon.com and the seller was advertised as the M5stack store.

Spent quite some time to get the microphone working with the voice assistant code and accomplished nothing.

Tested the factory echo record example "repeater.ino" and it did not work. However, it appears that the Atom library has been updated and the updated example "RecordPlay.ino" located at https://github.com/m5stack/M5Atom/blob/master/examples/Echo/RecordPlay/RecordPlay.ino works on these units. The updated code worked in my testing.

Opened the case and noticed that the board version is now "v1.1 Echo". The board seems to be slightly different from V1.0. Every other test regarding the LED and speaker mode seems to work OK! It leads me to believe that there are some changes in hardware, which have not yet been disclosed. It may also explain the problems which a number of users are having with these new units.

Wondering if the Atom Echo voice assistant project and code will be updated for the new boards?

Thanks

Request: ESP32-S3-BOX-3

ESP32-S3-BOX-3 has been advertised by Home Assistant like new standard for esp32 voice assistant.

Today I got my package, and realized esp32-s3-box.yaml don't work with box-3.

Please make new firmware for ESP32-S3-BOX-3.

Bluetooth Proxy and MQTT

Hello.
I'm using ESPHome as Bluetooth Proxy, it works OK, I use it for 3 SwtichBot temperature and humidity sensor.

What I would like to have in ESPHome is to publish via MQTT the new values of the entities discovered (in my case Temperature, Humidity, Battery and Bluetooth signal) returned from the devices (SwitchBot in my case).
So, what I would like to have is every time there is a new value of each entity, ESPHome will publish via MQTT the values and do this for each Bluetooth device discovered.

How to do it?

Many thanks for your support.

ESP32-S3-Box It looks like the microphone is not working at all.

Using the ESPHome normal installation with the good, HA entities are appearing, Assist Pipeline is configured, but no response whether holding down the left button to speak or using the wake word.

The logs are as follows:

INFO ESPHome 2023.10.0b3
INFO Reading configuration /config/esphome/esp32-s3-box.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO45 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Starting log output from esp32-s3-box.local using esphome API
INFO Successfully connected to esp32-s3-box.local
[18:57:42][I][app:102]: ESPHome version 2023.10.0b3 compiled on Oct 17 2023, 18:50:30
[18:57:42][I][app:104]: Project esphome.voice-assistant version 1.0
[18:57:42][C][wifi:546]: WiFi:
[18:57:42][C][wifi:382]:   Local MAC: 7C:DF:A1:FF:41:28
[18:57:42][C][wifi:383]:   SSID: 'zzz'[redacted]
[18:57:42][C][wifi:384]:   IP Address: 192.168.50.142
[18:57:42][C][wifi:386]:   BSSID: 5C:E7:47:4F:64:BC[redacted]
[18:57:42][C][wifi:387]:   Hostname: 'esp32-s3-box'
[18:57:42][C][wifi:389]:   Signal strength: -28 dB ▂▄▆█
[18:57:42][C][wifi:393]:   Channel: 1
[18:57:42][C][wifi:394]:   Subnet: 255.255.255.0
[18:57:42][C][wifi:395]:   Gateway: 192.168.50.1
[18:57:42][C][wifi:396]:   DNS1: 192.168.50.1
[18:57:42][C][wifi:397]:   DNS2: 0.0.0.0
[18:57:42][C][logger:361]: Logger:
[18:57:42][C][logger:362]:   Level: DEBUG
[18:57:42][C][logger:363]:   Log Baud Rate: 115200
[18:57:42][C][logger:365]:   Hardware UART: USB_SERIAL_JTAG
[18:57:42][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Mute'
[18:57:42][C][gpio.binary_sensor:016]:   Pin: GPIO1
[18:57:42][C][ledc.output:164]: LEDC Output:
[18:57:42][C][ledc.output:165]:   Pin GPIO45
[18:57:42][C][ledc.output:166]:   LEDC Channel: 0
[18:57:42][C][ledc.output:167]:   PWM Frequency: 1000.0 Hz
[18:57:42][C][ledc.output:168]:   Bit depth: 14
[18:57:42][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Top Left Button'
[18:57:42][C][gpio.binary_sensor:016]:   Pin: GPIO0
[18:57:42][C][light:103]: Light 'LCD Backlight'
[18:57:42][C][light:105]:   Default Transition Length: 0.0s
[18:57:42][C][light:106]:   Gamma Correct: 2.80
[18:57:42][C][template.switch:068]: Template Switch 'Use wake word'
[18:57:42][C][template.switch:091]:   Restore Mode: restore defaults to ON
[18:57:42][C][template.switch:057]:   Optimistic: YES
[18:57:42][C][psram:020]: PSRAM:
[18:57:42][C][psram:021]:   Available: YES
[18:57:42][C][psram:024]:   Size: 8191 KB
[18:57:42][C][mdns:115]: mDNS:
[18:57:42][C][mdns:116]:   Hostname: esp32-s3-box
[18:57:42][C][ota:097]: Over-The-Air Updates:
[18:57:42][C][ota:098]:   Address: esp32-s3-box.local:3232
[18:57:42][C][api:138]: API Server:
[18:57:42][C][api:139]:   Address: esp32-s3-box.local:6053
[18:57:42][C][api:141]:   Using noise encryption: YES
[18:57:52][D][binary_sensor:036]: 'Top Left Button': Sending state ON
[18:57:54][D][binary_sensor:036]: 'Top Left Button': Sending state OFF
[18:57:57][D][binary_sensor:036]: 'Top Left Button': Sending state ON
[18:57:59][D][binary_sensor:036]: 'Top Left Button': Sending state OFF
[19:00:01][D][switch:012]: 'Use wake word' Turning ON.
[19:00:01][D][switch:055]: 'Use wake word': Sending state ON
[19:00:01][D][voice_assistant:366]: State changed from IDLE to START_MICROPHONE
[19:00:01][D][voice_assistant:372]: Desired state set to WAIT_FOR_VAD
[19:00:01][D][light:036]: 'LCD Backlight' Setting:
[19:00:01][D][light:047]:   State: ON
[19:00:01][D][light:051]:   Brightness: 25%
[19:00:01][D][voice_assistant:159]: Starting Microphone
[19:00:01][D][voice_assistant:366]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[19:00:01][D][esp-idf:000]: I (471276) I2S: DMA Malloc info, datalen=blocksize=512, dma_buf_count=8

[19:00:01][D][esp-idf:000]: I (471284) I2S: I2S0, MCLK output by GPIO2

[19:00:01][D][esp-idf:000]: I (471290) ESP32_S3_BOX: I2S0, MCLK output by GPIO0

[19:00:01][D][esp-idf:000]: I (471297) AUDIO_PIPELINE: link el->rb, el:0x3d81134c, tag:i2s, rb:0x3d811760

[19:00:01][D][esp-idf:000]: I (471304) AUDIO_PIPELINE: link el->rb, el:0x3d8114c0, tag:filter, rb:0x3d8137a0

[19:00:01][D][esp-idf:000]: I (471314) AUDIO_ELEMENT: [i2s-0x3d81134c] Element task created

[19:00:01][D][esp-idf:000]: I (471318) AUDIO_THREAD: The filter task allocate stack on external memory

[19:00:01][D][esp-idf:000]: I (471325) AUDIO_ELEMENT: [filter-0x3d8114c0] Element task created

[19:00:01][D][esp-idf:000]: I (471333) AUDIO_ELEMENT: [raw-0x3d8115f0] Element task created

[19:00:01][D][esp-idf:000]: I (471343) AUDIO_PIPELINE: Func:audio_pipeline_run, Line:359, MEM Total:8397763 Bytes, Inter:97172 Bytes, Dram:97172 Bytes


[19:00:01][D][esp-idf:000]: I (471350) AUDIO_ELEMENT: [i2s] AEL_MSG_CMD_RESUME,state:1

[19:00:01][D][esp-idf:000]: I (471358) AUDIO_ELEMENT: [filter] AEL_MSG_CMD_RESUME,state:1

[19:00:01][D][esp-idf:000]: I (471364) RSP_FILTER: sample rate of source data : 16000, channel of source data : 2, sample rate of destination data : 16000, channel of destination data : 1

[19:00:01][D][esp-idf:000]: I (471370) AUDIO_PIPELINE: Pipeline started

[19:00:01][D][esp_adf.microphone:294]: Microphone started
[19:00:01][D][voice_assistant:366]: State changed from STARTING_MICROPHONE to WAIT_FOR_VAD
[19:00:01][D][voice_assistant:176]: Waiting for speech...
[19:00:01][D][voice_assistant:366]: State changed from WAIT_FOR_VAD to WAITING_FOR_VAD
[19:00:48][D][esp32.preferences:114]: Saving 1 preferences to flash...
[19:00:48][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed

Pressing the left button has a chance to bring up the log below

[19:04:58][D][esp-idf:000]: W (767943) AUDIO_ELEMENT: IN-[filter] AEL_IO_ABORT

[19:04:58][D][esp-idf:000]: E (767947) AUDIO_ELEMENT: [filter] Element already stopped

[19:04:58][D][esp-idf:000]: W (767977) AUDIO_PIPELINE: There are no listener registered

[19:04:58][D][esp-idf:000]: I (767982) AUDIO_PIPELINE: audio_pipeline_unlinked

[19:04:58][D][esp-idf:000]: W (767987) AUDIO_ELEMENT: [i2s] Element has not create when AUDIO_ELEMENT_TERMINATE

[19:04:58][D][esp-idf:000]: I (767995) I2S: DMA queue destroyed

[19:04:58][D][esp-idf:000]: W (768004) AUDIO_ELEMENT: [filter] Element has not create when AUDIO_ELEMENT_TERMINATE

[19:04:58][D][esp-idf:000]: W (768010) AUDIO_ELEMENT: [raw] Element has not create when AUDIO_ELEMENT_TERMINATE

[19:04:58][D][esp_adf.microphone:306]: Microphone stopped

Overall it seems like the microphone is not working at all. I can confirm that the microphone is fine, as the voice assistant built into the Espressif firmware inside woke up when I first got it.

S3 Box ... Does the Display work?

Hi,
until now, I've just used my S3Box as a Bluetooth Proxy which was showing the current Time and Date on its Display.
Now, I am trying to implement the WakeWord configuration you've provided here (https://github.com/esphome/firmware/blob/main/voice-assistant/esp32-s3-box.yaml) and wonder, if this is not working with the Display Configuration...

here's my old config:

i2c:
  scl: GPIO18
  sda: GPIO8
  scan: true

spi:
  clk_pin: GPIO7
  mosi_pin: GPIO6

# The Display itself and what's visible on it...
display:
  - platform: ili9xxx
    model: S3BOX
    cs_pin: GPIO5
    dc_pin: GPIO4
    reset_pin: GPIO48
    id: lcd
    lambda: |-
      it.fill(Color(255, 255, 255));
      it.strftime(160, 85, id(font_time), Color::BLACK, TextAlign::CENTER, "%H:%M:%S", id(time_ha).now());
      it.strftime(160, 170, id(font_date), Color::BLACK, TextAlign::CENTER, "%d.%m.%Y", id(time_ha).now());

# Which Fonts we want to use
font:
  - file: "gfonts://Roboto"
    id: font_time
    size: 60
    glyphs: "0123456789:"
  - file: "gfonts://Roboto"
    id: font_date
    size: 50
    glyphs: "0123456789."
  - file: "gfonts://Roboto"
    id: font_small
    size: 20

# get the Time from Home-Assistant
time:
  - platform: homeassistant
    id: time_ha
    timezone: Europe/Berlin

Wake Word and PTT - Best of both worlds

Is there a way to be able to use the push to talk whilst wake word is enabled? I've been experimenting but couldnt find a way other than disabling wake word and turning it back on after a 30 seconds or so

      - if:
          condition:
            switch.is_off: use_wake_word
          then:
            - if:
                condition: voice_assistant.is_running
                then:
                  - voice_assistant.stop:
                  - delay: 1s
                  - script.execute: reset_led
                  - script.wait: reset_led
            - voice_assistant.start:
          else:
            - voice_assistant.stop:
            - switch.turn_off: use_wake_word
            - delay: 1s
            - voice_assistant.start:
            - delay: 30s
            - switch.turn_on: use_wake_word

SC01 Plus Support

Does this firmware work on the S3 SC01 Plus?

SC01 Plus Development Board with 3.5'' 320x480 Color Touch Screen LCD Display, Based on ESP32-S3, Wi-Fi, Bluetooth Connection for Bicycle Computer Meters,Air Fryers, Water Heaters, Washing Machines https://a.co/d/57YkBCe

Update issue 2023.10.2 BT proxy (M5Stack Atom Lite)

With ESPHome 2023.10.2 the M5Stack Atom lite cannot be updated with the BT proxy firmware.
Repo is pointing to github://esphome/firmware/bluetooth-proxy/m5stack-atom-lite.yaml@main

INFO ESPHome 2023.10.2
INFO Reading configuration /config/esphome/atom-bluetooth-proxy-84b9b0.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing atom-bluetooth-proxy-84b9b0 (board: m5stack-atom; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
Library Manager: Installing esphome/noise-c @ 0.1.4
INFO Installing esphome/noise-c @ 0.1.4
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/libsodium @ 1.10018.1
INFO Installing esphome/libsodium @ 1.10018.1
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Installing esphome/Improv @ 1.2.3
INFO Installing esphome/Improv @ 1.2.3
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40405.230623 (4.4.5) 
 - tool-cmake @ 3.16.9 
 - tool-ninja @ 1.10.2 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Generating assembly for certificate bundle...
Dependency Graph
|-- noise-c @ 0.1.4
|-- Improv @ 1.2.3
Compiling .pioenvs/atom-bluetooth-proxy-84b9b0/src/esphome/components/api/api_connection.o
Compiling .pioenvs/atom-bluetooth-proxy-84b9b0/src/esphome/components/api/api_frame_helper.o
Compiling .pioenvs/atom-bluetooth-proxy-84b9b0/src/esphome/components/api/api_pb2.o
Compiling .pioenvs/atom-bluetooth-proxy-84b9b0/src/esphome/components/api/api_pb2_service.o
In file included from src/esphome/components/network/util.h:4,
                 from src/esphome/components/api/api_connection.cpp:4:
src/esphome/components/network/ip_address.h: In constructor 'esphome::network::IPAddress::IPAddress(ip4_addr_t*)':
src/esphome/components/network/ip_address.h:40:14: error: 'ip_addr_t' {aka 'struct ip4_addr'} has no member named 'type'
     ip_addr_.type = IPADDR_TYPE_V4;
              ^~~~
Compiling .pioenvs/atom-bluetooth-proxy-84b9b0/src/esphome/components/api/api_server.o
*** [.pioenvs/atom-bluetooth-proxy-84b9b0/src/esphome/components/api/api_connection.o] Error 1
In file included from src/esphome/components/network/util.h:4,
                 from src/esphome/components/api/api_server.cpp:4:
src/esphome/components/network/ip_address.h: In constructor 'esphome::network::IPAddress::IPAddress(ip4_addr_t*)':
src/esphome/components/network/ip_address.h:40:14: error: 'ip_addr_t' {aka 'struct ip4_addr'} has no member named 'type'
     ip_addr_.type = IPADDR_TYPE_V4;
              ^~~~
*** [.pioenvs/atom-bluetooth-proxy-84b9b0/src/esphome/components/api/api_server.o] Error 1
========================= [FAILED] Took 104.61 seconds =========================

S3 Box 3 working in integration but will not adopt in addon

MY S3 box appeared to be corrupt
tried to reload from addon and got the following

Could not download from https://github.com/esphome/firmware/raw/main/voice-assistant/casita/[email protected]: 404 Client Error: Not Found for url: https://github.com/esphome/firmware/raw/main/voice-assistant/casita/[email protected].
file: |-
  https://github.com/esphome/firmware/raw/main/voice-assistant/casita/[email protected]
id: casita_thinking
resize: 200x200
type: RGB24
use_transparency: True

So I deleted it from addon and installed from https://esphome.io/projects/index.html

Came online and working in integration

Was Discovered by addon but on trying adopt get the same error and config is the same as before delete

substitutions:
name: esp32-s3-box-3-5ab994
friendly_name: ESP32 S3 Box 3 5ab994
packages:
esphome.voice-assistant: github://esphome/firmware/voice-assistant/esp32-s3-box-3.yaml@main
esphome:
name: ${name}
name_add_mac_suffix: false
friendly_name: ${friendly_name}
api:
encryption:
key: xxxxxxx

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password

Any ideas ?

ESP32-S3-BOX-3

Since yesterday HA/Esphome wants me to upgrade to 2023.11.3 but current GitHub version is .2

There is a typo in the yaml :

package_import_url: github://esphome/firmware/voice-assistant/esp32-s3-box.yaml@main

It should be

package_import_url: github://esphome/firmware/voice-assistant/esp32-s3-box-3.yaml@main

Then when trying to update , it t also throw errors about the Casita PNG files not found , it works when installing through Esphome.io/USB .

Voice Assistant fails during Installation

Hi,
Tried to follow the guide from: https://www.home-assistant.io/voice_control/thirteen-usd-voice-remote/

I get stuck with this error during installation (preparation failed):

INFO ESPHome 2023.9.3
INFO Reading configuration /config/esphome/m5stack-atom-echo-8a1714.yaml...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 33, in <module>
    sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
  File "/esphome/esphome/__main__.py", line 1036, in main
    return run_esphome(sys.argv)
  File "/esphome/esphome/__main__.py", line 1014, in run_esphome
    config = read_config(dict(args.substitution) if args.substitution else {})
  File "/esphome/esphome/config.py", line 986, in read_config
    res = load_config(command_line_substitutions)
  File "/esphome/esphome/config.py", line 840, in load_config
    return _load_config(command_line_substitutions)
  File "/esphome/esphome/config.py", line 828, in _load_config
    result = validate_config(config, command_line_substitutions)
  File "/esphome/esphome/config.py", line 690, in validate_config
    substitutions.do_substitution_pass(config, command_line_substitutions)
  File "/esphome/esphome/components/substitutions/__init__.py", line 143, in do_substitution_pass
    config.move_to_end(CONF_SUBSTITUTIONS, False)
AttributeError: 'dict' object has no attribute 'move_to_end'

Anyone with ideas?

Does not compile

Cannot get your yaml to compile ...

My Configuration from your file just changing normal items like wifi, api etc:

substitutions:
  name: "m5stack-atom-echo"
  friendly_name: "M5Stack Atom Echo"

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"
  name_add_mac_suffix: true
  project:
    name: m5stack.atom-echo-voice-assistant
    version: "1.0"
  min_version: 2023.7.0

esp32:
  board: m5stack-atom
  framework:
    type: esp-idf

logger:
api:
  encryption:
    key: "URNqhlW2GC1/9wY4BEUg027chf8tP8RxKlms3hoTk+I="
ota:
  password: "6dfcccce48d92a6f48e96eceee9ce2af"

dashboard_import:
  package_import_url: github://esphome/firmware/voice-assistant/m5stack-atom-echo.yaml@main

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Atomspeaker Fallback Hotspot"
    password: "Z4kkzLLXj7oe"

captive_portal:

improv_serial:

i2s_audio:
  i2s_lrclk_pin: GPIO33
  i2s_bclk_pin: GPIO19

microphone:
  - platform: i2s_audio
    id: echo_microphone
    i2s_din_pin: GPIO23
    adc_type: external
    pdm: true

speaker:
  - platform: i2s_audio
    id: echo_speaker
    i2s_dout_pin: GPIO22
    dac_type: external
    mode: mono

voice_assistant:
  microphone: echo_microphone
  speaker: echo_speaker
  silence_detection: true
  on_listening:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        brightness: 50%
  on_start:
    - light.turn_on:
        id: led
        blue: 100%
        red: 0%
        green: 0%
        brightness: 100%
        effect: pulse
  on_tts_start:
    - light.turn_on:
        id: led
        blue: 0%
        red: 0%
        green: 100%
        brightness: 100%
        effect: none
  on_tts_end:
    - light.turn_on:
        id: led
        blue: 0%
        red: 0%
        green: 100%
        brightness: 100%
        effect: pulse
  on_end:
    - delay: 100ms
    - wait_until:
        not:
          speaker.is_playing:
    - light.turn_off: led
  on_error:
    - light.turn_on:
        id: led
        blue: 0%
        red: 100%
        green: 0%
        brightness: 100%
        effect: none
    - delay: 1s
    - light.turn_off: led


binary_sensor:
  - platform: gpio
    pin:
      number: GPIO39
      inverted: true
    name: Button
    disabled_by_default: true
    entity_category: diagnostic
    id: echo_button
    on_click:
      - if:
          condition: voice_assistant.is_running
          then:
            - light.turn_off: led
            - voice_assistant.stop:
          else:
            - light.turn_on:
                id: led
                blue: 100%
                red: 0%
                green: 0%
                brightness: 50%
                effect: none
            - voice_assistant.start:

light:
  - platform: esp32_rmt_led_strip
    id: led
    name: None
    disabled_by_default: true
    entity_category: config
    pin: GPIO27
    default_transition_length: 0s
    chipset: SK6812
    num_leds: 1
    rgb_order: grb
    rmt_channel: 0
    effects:
      - pulse:
          transition_length: 250ms
          update_interval: 250ms

image

Log file:
[logs_atomspeaker_run.txt]
(https://github.com/esphome/firmware/files/12385115/logs_atomspeaker_run.txt)

Feature: Continued conversation with text on screen for ESP32-S3-Box-3

This is in draft PR #173 pending more testing.

Here is a demo video of this beta of Voice assistant with Continued conversation and text.

IMG_1020
Demo of Continued conversation BETA

I'm looking for testers who can give feedback on issues, further suggestions for improvement, etc. I've tested it with the HA streaming wake word but it works much better with the on-device wake word. Once it is verified, we can hopefully get it accepted in the ESPHome repository for everybody. Please leave issues and suggestions here.

To install, in your device's yaml change this:

packages:
  esphome.voice-assistant: github://esphome/firmware/wake-word-voice-assistant/esp32-s3-box-3.yaml
  ...

to this:

packages:
  # esphome.voice-assistant: github://esphome/firmware/wake-word-voice-assistant/esp32-s3-box-3.yaml
  esphome.voice-assistant: github://jaymunro/esphome_firmware/wake-word-voice-assistant/esp32-s3-box-3.yaml@continued-conversation
  ...

If you change the wake word model, add another substitution for the wake word text as follows:

substitutions:
  ...
  micro_wake_word_model: hey_jarvis
  wake_word_text: "Hey Jarvis"

Note this is a beta and the repo above is temporary until after the PR is accepted.

Before doing an Install, be sure to do a Clean build files from the 3-dot hamburger menu in ESPHome.

ESP offline not able to update

Hello My ESP device went offline and i am unable to update it through Home Assistant. When i try looking at the logs, i get the following messages

WARNING Can't connect to ESPHome API for xxx.local: Error resolving IP address: [Errno -5] No address associated with hostname (APIConnectionError)

i can confirm my ESP device is connected to wifi and i'm able to ping the IP address.

Please Help!

ESP32-S3-Box does not compile

I get the following log output:

INFO ESPHome 2023.10.0-dev
INFO Reading configuration /config/esphome/esp32-s3-box-assistant.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
INFO Updating https://github.com/esphome/esphome.git@pull/5229/head
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO45 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Updating https://github.com/espressif/[email protected]
INFO Updating submodules (components/esp-sr, components/esp-adf-libs) for https://github.com/espressif/[email protected]
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 33, in <module>
    sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
  File "/esphome/esphome/__main__.py", line 1036, in main
    return run_esphome(sys.argv)
  File "/esphome/esphome/__main__.py", line 1023, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
  File "/esphome/esphome/__main__.py", line 403, in command_compile
    exit_code = write_cpp(config)
  File "/esphome/esphome/__main__.py", line 190, in write_cpp
    return write_cpp_file()
  File "/esphome/esphome/__main__.py", line 208, in write_cpp_file
    writer.write_cpp(code_s)
  File "/esphome/esphome/writer.py", line 342, in write_cpp
    copy_src_tree()
  File "/esphome/esphome/writer.py", line 295, in copy_src_tree
    copy_files()
  File "/esphome/esphome/components/esp32/__init__.py", line 592, in copy_files
    repo_dir, _ = git.clone_or_update(
  File "/esphome/esphome/git.py", line 114, in clone_or_update
    run_git_command(
  File "/esphome/esphome/git.py", line 32, in run_git_command
    raise cv.Invalid(err_str)
voluptuous.error.Invalid: fatal: Needed a single revision
Unable to find current revision in submodule path 'components/esp-sr'

Unexpected error during wake-word-detection

Sadly when trying to trigger the wake word on M5STACK Atom the following error occurs

Home Assistant 2023.10.5
Supervisor 2023.10.1
Operating System 11.1.rc1

Unexpected error during wake-word-detection 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 653, in wake_word_detection
    result = await self.wake_word_entity.async_process_audio_stream(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/wake_word/__init__.py", line 112, in async_process_audio_stream
    result = await self._async_process_audio_stream(stream, wake_word_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/wyoming/wake_word.py", line 152, in _async_process_audio_stream
    chunk_info = audio_task.result()
                 ^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/wyoming/wake_word.py", line 82, in next_chunk
    async for chunk_bytes in stream:
  File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 736, in _wake_word_audio_stream
    async for chunk in audio_stream:
  File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 1147, in process_enhance_audio
    async for dirty_samples in audio_stream:
  File "/usr/src/homeassistant/homeassistant/components/esphome/voice_assistant.py", line 155, in _iterate_packets
    raise RuntimeError("Not running")
RuntimeError: Not running

esptool.py error when flashing

Hi all,
when flashing the yaml file via ESPHome to my espbox s3 lite, I'm getting this error in my log after a few minutes into flashing:
ERROR Please try running esptool.py --before default_reset --after hard_reset --baud 115200 --port /dev/ttyACM1 --chip esp32s3 write_flash -z --flash_size detect 0x10000 /data/build/esp32-s3-box-lite/.pioenvs/esp32-s3-box-lite/firmware.bin 0x0 /data/build/esp32-s3-box-lite/.pioenvs/esp32-s3-box-lite/bootloader.bin 0x8000 /data/build/esp32-s3-box-lite/.pioenvs/esp32-s3-box-lite/partitions.bin 0x9000 /data/build/esp32-s3-box-lite/.pioenvs/esp32-s3-box-lite/ota_data_initial.bin locally.

I've got the esp plugged into my server and flashing it from there. It's a copyu/paste from the example and can't understand how to get around this. Do I need to do something else before I flash it?

Muse Luxe: Reset after Reboot (media-player to voice-assistant convert)

Hey,
i have successfully installed voice-assistant on the Muse Luxe.
What I did:

  1. I already had a media-player Muse Luxe on Home Assistant (ESPHome)
  2. Then I copied the new voice-assistant code to the existing configuration file (I replaced encryption key and wifi access)
  3. Then I flashed the new config to the Muse Luxe

Everything seemed fine and working.
However after I restarted the Muse Luxe, it resetted to it it's old firmware (media-player). How is this possible?
I also noticed that it's speaker cracks now a little bit. And I also noticed that it is getting warm where the buttons are at the top right.

Any suggestions?

ESP32 S3 Box Lite arduino config

Can that config be translated to arduino framework? Many ESPHOME components do not work on esp-idf (i.e. media_player).
Thanks

Wake Word Atom Freeze

I have the $13 Atom, it works fine for wake word detection right after turning on wake word switch on their device page. However, after 1 or 2 commands they stop responding ...

if i toogle the switch and wait a bit it comes back , but after saying 2 or 3 commands next to each other it freezes again , and seams to come back after 5 or more minutes ... tried with HA cloud and local , same behavior !!

What are some troubleshooting steps I can try?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.