AI Türgong

Hi everyone,

As it sometimes happens in the smart home world, you come up with some rather unusual ideas.

Since my doorbell broke, I decided to quickly build something of my own: a door chime that not only makes a sound but also talks to me via AI. For this, I’m using:

  • an ESP32-S3-AI with microphone and speaker
  • a small WS2812 LED ring

Unfortunately, I can’t get the whole thing working at the moment. For the voice assistant code, I followed the ready-made ESPHome project for the M5Stack.

I also integrated the LED ring control in combination with the AI. The ESP is correctly recognized by Home Assistant as a voice assistant. However, I’m running into the following issues:

  • Audio output via the speaker only works as a media player
  • No response from the microphone
  • No LED indication on the WS2812 ring

So I suspect that either something fundamental is missing or there’s an error in the code. Could someone please take a look and point me in the right direction?

Thanks in advance!

captive_portal:

##########################################
# I²S Audio Bus 0 - Mikrofon (RX)
##########################################
i2s_audio:
  - id: i2s_in
    i2s_lrclk_pin: GPIO18
    i2s_bclk_pin: GPIO17

##########################################
# I²S Audio Bus 1 - Lautsprecher (TX)
##########################################
  - id: i2s_out
    i2s_lrclk_pin: GPIO7
    i2s_bclk_pin: GPIO8

##########################################
# Mikrofon SPH0645
##########################################
microphone:
  - platform: i2s_audio
    id: echo_microphone
    adc_type: external
    i2s_din_pin: GPIO16
    i2s_audio_id: i2s_in
    sample_rate: 16000
    bits_per_sample: 32bit
    pdm: false

##########################################
# Lautsprecher MAX98357A
##########################################
speaker:
  - platform: i2s_audio
    id: echo_speaker
    i2s_dout_pin: GPIO15
    i2s_audio_id: i2s_out
    dac_type: external
    bits_per_sample: 16bit
    sample_rate: 16000

    ##########################################
# Media Player
##########################################
media_player:
  - platform: speaker
    name: TürgongAI Player
    id: echo_media_player
    announcement_pipeline:
      speaker: echo_speaker
      format: WAV
    codec_support_enabled: false
    buffer_size: 6000
    volume_min: 0.4


##########################################
# WS2812B LED-Ring
##########################################
light:
  - platform: esp32_rmt_led_strip
    id: led
    name: TürgongAI LED
    pin: GPIO21
    default_transition_length: 0s
    chipset: WS2812
    num_leds: 8
    rgb_order: GRB
    #rmt_channel: 1 
    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%

##########################################
# Voice Assistant
##########################################
voice_assistant:
  id: va
  microphone: echo_microphone
  speaker: echo_speaker
  noise_suppression_level: 2
  auto_gain: 31dBFS
  volume_multiplier: 2.0

  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: echo_speaker
    - script.execute: reset_led

  on_error:
    - light.turn_on:
        id: led
        red: 100%
        green: 0%
        blue: 0%
        brightness: 100%
        effect: none
    - delay: 2s
    - script.execute: reset_led

##########################################
# Micro Wake Word
##########################################
micro_wake_word:
  on_wake_word_detected:
    - voice_assistant.start:
        wake_word: !lambda return wake_word;
  vad:
  models:
    - model: okay_nabu

##########################################
# Scripts
##########################################
script:
  - id: reset_led
    then:
      - light.turn_off: led

##########################################
# Test-Schalter
##########################################
switch:
  - platform: template
    name: "Test LED"
    turn_on_action:
      - light.turn_on:
          id: led
          red: 100%
          green: 0%
          blue: 0%
          brightness: 100%
    turn_off_action:
      - light.turn_off: led

binary_sensor:
  - platform: status
    name: "TürgongAI Status"

Welcome to forum!

What is that? Post a link to that board.

What is the device you hook up GPIO21 to?
Normally, you just connect the LED data pin to the Data In pad of your led string…

I also used an S3 AI board. Flashing works

21 → Level shfiter → WLED.
Thanks for Help