Hi,
I have a esp32-s3-devkitc-1 with MAX98357A and a speaker and an inmp441 mic. The pipeline is working, as I can see from the esp32 logs:
[23:34:49][D][api.connection:1446]: Home Assistant 2025.1.2 (192.168.0.2): Connected successfully
[23:34:50][D][voice_assistant:511]: State changed from IDLE to START_MICROPHONE
[23:34:50][D][voice_assistant:518]: Desired state set to START_PIPELINE
[23:34:50][D][voice_assistant:222]: Starting Microphone
[23:34:51][D][ring_buffer:034]: Created ring buffer with size 16384
[23:34:51][D][voice_assistant:511]: State changed from START_MICROPHONE to STARTING_MICROPHONE
[23:34:51][D][voice_assistant:511]: State changed from STARTING_MICROPHONE to START_PIPELINE
[23:34:51][D][voice_assistant:276]: Requesting start...
[23:34:51][D][voice_assistant:511]: State changed from START_PIPELINE to STARTING_PIPELINE
[23:34:51][D][voice_assistant:533]: Client started, streaming microphone
[23:34:51][D][voice_assistant:511]: State changed from STARTING_PIPELINE to STREAMING_MICROPHONE
[23:34:51][D][voice_assistant:518]: Desired state set to STREAMING_MICROPHONE
[23:34:51][D][voice_assistant:635]: Event Type: 1
[23:34:51][D][voice_assistant:638]: Assist Pipeline running
[23:34:51][D][voice_assistant:635]: Event Type: 9
[23:35:35][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[23:35:35][D][esp32.preferences:114]: Saving 1 preferences to flash...
[23:35:35][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
In the home assistant logs I see this authentication error:
Logger: homeassistant
Quelle: components/esphome/assist_satellite.py:333
Erstmals aufgetreten: 23:00:04 (1 Vorkommnisse)
Zuletzt protokolliert: 23:00:04
Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 1417, in execute
detect_result = await self.run.wake_word_detection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
stt_processed_stream, stt_audio_buffer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 804, in wake_word_detection
self.process_event(
~~~~~~~~~~~~~~~~~~^
PipelineEvent(
^^^^^^^^^^^^^^
...<2 lines>...
)
^
)
^
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 617, in process_event
self.event_callback(event)
~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/assist_satellite/entity.py", line 384, in _internal_on_pipeline_event
self.on_pipeline_event(event)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/esphome/assist_satellite.py", line 333, in on_pipeline_event
self.cli.send_voice_assistant_event(event_type, data_to_send)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aioesphomeapi/client.py", line 1444, in send_voice_assistant_event
self._get_connection().send_message(req)
~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/aioesphomeapi/client.py", line 388, in _get_connection
raise APIConnectionError(
...<2 lines>...
)
aioesphomeapi.core.APIConnectionError: Authenticated connection not ready yet for esp32-mic-speaker @ 192.168.0.165; current state is ConnectionState.INITIALIZED!
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/assist_satellite/entity.py", line 345, in async_accept_pipeline_from_satellite
await self._pipeline_task
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/__init__.py", line 135, in async_pipeline_from_audio_stream
await pipeline_input.execute()
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 1509, in execute
await self.run.end()
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 647, in end
self.process_event(
~~~~~~~~~~~~~~~~~~^
PipelineEvent(
^^^^^^^^^^^^^^
PipelineEventType.RUN_END,
^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
)
^
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 617, in process_event
self.event_callback(event)
~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/assist_satellite/entity.py", line 384, in _internal_on_pipeline_event
self.on_pipeline_event(event)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/esphome/assist_satellite.py", line 333, in on_pipeline_event
self.cli.send_voice_assistant_event(event_type, data_to_send)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aioesphomeapi/client.py", line 1444, in send_voice_assistant_event
self._get_connection().send_message(req)
~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/site-packages/aioesphomeapi/client.py", line 388, in _get_connection
raise APIConnectionError(
...<2 lines>...
)
aioesphomeapi.core.APIConnectionError: Authenticated connection not ready yet for esp32-mic-speaker @ 192.168.0.165; current state is ConnectionState.INITIALIZED!
Why is the connection state initialized, but connection is not ready, and this two times? Has anyone seen this error before? Google is of no help sadly.
For clarification, my home assistant runs at ip 192.168.0.2 and my esp on 192.168.0.165.
Additionally, here is my yml:
esphome:
name: esp32-mic-speaker
friendly_name: esp32-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: esp32-s3-devkitc-1
framework:
type: esp-idf
variant: esp32s3
wifi:
ssid: "x"
password: "xx"
ap:
ssid: "Fallback mic speaker"
password: "xx"
# Enable logging
logger:
debug:
# Enable Home Assistant API
api:
ota:
- platform: esphome
id: ota_esphome
i2s_audio:
i2s_lrclk_pin: GPIO4
i2s_bclk_pin: GPIO5
microphone:
- platform: i2s_audio
id: mic
adc_type: external
i2s_din_pin: GPIO7
pdm: false
channel: right
bits_per_sample: 32bit
speaker:
- platform: i2s_audio
id: big_speaker
dac_type: external
i2s_dout_pin: GPIO17
voice_assistant:
microphone: mic
use_wake_word: false
noise_suppression_level: 2
#auto_gain: 31dBFS
volume_multiplier: 2.0
speaker: big_speaker
id: assist
switch:
- platform: template
name: Use wake word
id: use_wake_word
optimistic: true
restore_mode: RESTORE_DEFAULT_ON
entity_category: config
on_turn_on:
- lambda: id(assist).set_use_wake_word(true);
- if:
condition:
not:
- voice_assistant.is_running
then:
- voice_assistant.start_continuous
on_turn_off:
- voice_assistant.stop
- lambda: id(assist).set_use_wake_word(false);