esphome / firmware

Holds firmware configuration files for projects that the ESPHome team provides.
https://esphome.io/projects
Apache License 2.0
128 stars 93 forks source link

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

Closed ZhuDaHai closed 8 months ago

ZhuDaHai commented 8 months ago

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?

ZhuDaHai commented 8 months ago

PEBKAC: I was on an older release of ESPHome