Smart Home Automation Forum

Full Version: AS ESPHome yaml for home assistant
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
[attachment=6317]
Code:
esphome:
  name: as
  friendly_name: AS
  platformio_options:
    board_build.flash_mode: dio
  on_boot:
    - light.turn_on:
        id: led_ww
        blue: 100%
        brightness: 60%
        effect: fast pulse
esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
      CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
      CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"
      CONFIG_AUDIO_BOARD_CUSTOM: "y"
  
psram:
  mode: octal  # quad for N8R2 and octal for N16R8
  speed: 80MHz
# Enable logging
logger:
  hardware_uart: USB_SERIAL_JTAG
# Enable Home Assistant API
api:
  encryption:
    key: "TFpb+pBAvQIS1MVwaA7EoJ2DkpWE+79UvVro7yMyGdU="
  on_client_connected:
        then:
          - delay: 50ms
          - light.turn_off: led_ww
          - micro_wake_word.start:
  on_client_disconnected:
        then:
          - voice_assistant.stop:
ota:
  - platform: esphome
    password: "1245211a05eef56614a2ef5a3f3e971c"
wifi:
  ssid: "KinCony"
  password: "a12345678"
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32-S3-Wake-Word"
    password: "LJfUrdJk3svP"
captive_portal:
button:
  - platform: restart
    name: "Restart"
    id: but_rest
switch:
  - platform: template
    id: mute
    name: mute
    optimistic: true
    on_turn_on:
      - micro_wake_word.stop:
      - voice_assistant.stop:
      - light.turn_on:
          id: led_ww          
          red: 100%
          green: 0%
          blue: 0%
          brightness: 60%
          effect: fast pulse
      - delay: 2s
      - light.turn_off:
          id: led_ww
      - light.turn_on:
          id: led_ww          
          red: 100%
          green: 0%
          blue: 0%
          brightness: 30%
    on_turn_off:
      - micro_wake_word.start:
      - light.turn_on:
          id: led_ww          
          red: 0%
          green: 100%
          blue: 0%
          brightness: 60%
          effect: fast pulse
      - delay: 2s
      - light.turn_off:
          id: led_ww
  
light:
  - platform: esp32_rmt_led_strip
    id: led_ww
    rgb_order: GRB
    pin: GPIO16
    num_leds: 1
    rmt_channel: 0
    chipset: ws2812
    name: "on board light"
    effects:
      - pulse:
      - pulse:
          name: "Fast Pulse"
          transition_length: 0.5s
          update_interval: 0.5s
          min_brightness: 0%
          max_brightness: 100%
         
         
# Audio and Voice Assistant Config         
i2s_audio:
  - id: i2s_in
    i2s_lrclk_pin: GPIO3  #WS
    i2s_bclk_pin: GPIO2 #SCK
  - id: i2s_speaker
    i2s_lrclk_pin: GPIO6  #LRC
    i2s_bclk_pin: GPIO7 #BLCK
microphone:
  - platform: i2s_audio
    id: va_mic
    adc_type: external
    i2s_din_pin: GPIO4 #SD pin on the INMP441
    channel: left
    pdm: false
    i2s_audio_id: i2s_in
    bits_per_sample: 32 bit
   
speaker:
    platform: i2s_audio
    id: va_speaker
    i2s_audio_id: i2s_speaker
    dac_type: external
    i2s_dout_pin: GPIO8   #  DIN Pin of the MAX98357A Audio Amplifier
    channel: mono
micro_wake_word:
  on_wake_word_detected:
    # then:
    - voice_assistant.start:
        wake_word: !lambda return wake_word;
    - light.turn_on:
        id: led_ww          
        red: 30%
        green: 30%
        blue: 70%
        brightness: 60%
        effect: fast pulse
  models:
    - model: github://esphome/micro-wake-word-models/models/v2/hey_jarvis.json
   
voice_assistant:
  id: va
  microphone: va_mic
  noise_suppression_level: 2.0
  volume_multiplier: 4.0
  speaker: va_speaker
  on_stt_end:
       then:
         - light.turn_off: led_ww
  on_error:
          - micro_wake_word.start: 
  on_end:
        then:
          - light.turn_off: led_ww
          - wait_until:
              not:
                voice_assistant.is_running:
          - micro_wake_word.start: 
yaml file download:[attachment=6246]
I followed the steps as you described. Only when I turn on the LED does it not listen. It stays at inactive. Me whisper and piper installation works. What am I overlooking? thanks in advance for the response.
can you take some screen photo of voice assistant setting, home assistant "device" webpage of whisper and piper.
It works now.
The only thing is that you apparently pronounce hey jarvis better than I do. If I play a video with the explanation, it responds to you fine. When I ask it something arggggggggg Smile
you can use google translate to speak play voice" hey jarvis " Smile
Dear,

it is possible that you use an open wake word from ha itself and not in the esp itself. I have now changed it to okay nabu which is already going better.
the response speed is faster?
for me de best model is alexa that listen very good. is there a way to get volume louder? The microfoon is beter than mine Telcast laptop mic special when i speak dutch to dutch assistant. The dutch assistant is not very good. I use your device as a dutch chatgpt voice assistant and for that it works great. Only i want to make mine one wakeword. Is it possible to upload the 2 file to the esp?

fun thing nobody has ever seen this device in Netherlands i think.

thx
" Is it possible to upload the 2 file to the esp?" what's means? i don't understand.
Goodday i read a litlle further and i think it's not possible to put your own wakeword in the assist. when i make mine own wakeword i got 2 files *.onnx and a *.tflite. But it shall not be possible esp use microwakeword. Is it possible that in 1 yaml file to program bought gpio15 an gpio 16 leds? I try it put still getting used to the programming because file was wrong. Is there a way to control the volume or is it not possible. I love product the microfoon is very good.
Pages: 1 2 3