From 4a121b6624f3a344b48d1951bebca54d87c612ef Mon Sep 17 00:00:00 2001 From: JLo Date: Thu, 15 Feb 2024 17:53:50 +0100 Subject: [PATCH 1/5] Draft version of micro wakr word integration in our official firmware --- voice-assistant/esp32-s3-box-3.yaml | 102 +++++++++++++++++++++++-- voice-assistant/esp32-s3-box-lite.yaml | 102 +++++++++++++++++++++++-- voice-assistant/esp32-s3-box.yaml | 98 ++++++++++++++++++++++-- 3 files changed, 283 insertions(+), 19 deletions(-) diff --git a/voice-assistant/esp32-s3-box-3.yaml b/voice-assistant/esp32-s3-box-3.yaml index e7f5f451..d5781d0a 100644 --- a/voice-assistant/esp32-s3-box-3.yaml +++ b/voice-assistant/esp32-s3-box-3.yaml @@ -24,6 +24,8 @@ substitutions: voice_assist_error_phase_id: "11" voice_assist_muted_phase_id: "12" + micro_wake_word_model: okay_nabu + esphome: name: ${name} friendly_name: ${friendly_name} @@ -70,6 +72,10 @@ external_components: - source: github://pr#5230 components: esp_adf refresh: 0s + # Could soon be removed once micro_wake_word is in stable. + - source: github://pr#6136 + components: micro_wake_word + refresh: 0s api: on_client_connected: @@ -152,6 +158,11 @@ speaker: - platform: esp_adf id: box_speaker +micro_wake_word: + model: ${micro_wake_word_model} + on_wake_word_detected: + - voice_assistant.start + voice_assistant: id: va microphone: box_mic @@ -173,6 +184,17 @@ voice_assistant: on_tts_stream_end: - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; - script.execute: draw_display + on_end: + - if: + condition: + and: + - switch.is_off: mute + - lambda: return id(wake_word_engine_location).state == "Device"; + then: + - wait_until: + not: + voice_assistant.is_running: + - micro_wake_word.start: on_error: - if: condition: @@ -196,14 +218,35 @@ voice_assistant: then: - wait_until: not: ble.enabled - - voice_assistant.start_continuous: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.start - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; else: - lambda: id(voice_assistant_phase) = ${voice_assist_muted_phase_id}; - lambda: id(init_in_progress) = false; - script.execute: draw_display on_client_disconnected: - - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.stop + - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; - script.execute: draw_display script: @@ -272,26 +315,71 @@ switch: - if: condition: lambda: return !id(init_in_progress); - then: - - lambda: id(va).set_use_wake_word(true); + then: - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; - if: condition: not: - voice_assistant.is_running then: - - voice_assistant.start_continuous + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.start - script.execute: draw_display on_turn_on: - if: condition: lambda: return !id(init_in_progress); - then: - - voice_assistant.stop + then: - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop + - micro_wake_word.stop - lambda: id(voice_assistant_phase) = ${voice_assist_muted_phase_id}; - script.execute: draw_display +select: + - platform: template + entity_category: config + name: Wake Word Engine Location + id: wake_word_engine_location + optimistic: True + restore_value: True + options: + - Home Assistant + - Device + initial_option: Device + on_value: + - wait_until: + lambda: return id(voice_assistant_phase) == ${voice_assist_muted_phase_id} || id(voice_assistant_phase) == ${voice_assist_idle_phase_id}; + - if: + condition: + lambda: return x == "Home Assistant"; + then: + - micro_wake_word.stop + - delay: 500ms + - if: + condition: + switch.is_off: mute + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous: + - if: + condition: + lambda: return x == "Device"; + then: + - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop + - delay: 500ms + - micro_wake_word.start + globals: - id: init_in_progress type: bool diff --git a/voice-assistant/esp32-s3-box-lite.yaml b/voice-assistant/esp32-s3-box-lite.yaml index 452b86ea..aa90d257 100644 --- a/voice-assistant/esp32-s3-box-lite.yaml +++ b/voice-assistant/esp32-s3-box-lite.yaml @@ -23,6 +23,8 @@ substitutions: voice_assist_error_phase_id: "11" voice_assist_muted_phase_id: "12" + micro_wake_word_model: okay_nabu + esphome: name: ${name} friendly_name: ${friendly_name} @@ -63,6 +65,10 @@ external_components: - source: github://pr#5230 components: esp_adf refresh: 0s + # Could soon be removed once micro_wake_word is in stable. + - source: github://pr#6136 + components: micro_wake_word + refresh: 0s api: on_client_connected: @@ -199,6 +205,11 @@ speaker: - platform: esp_adf id: box_speaker +micro_wake_word: + model: ${micro_wake_word_model} + on_wake_word_detected: + - voice_assistant.start + voice_assistant: id: va microphone: box_mic @@ -220,6 +231,17 @@ voice_assistant: on_tts_stream_end: - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; - script.execute: draw_display + on_end: + - if: + condition: + and: + - switch.is_off: mute + - lambda: return id(wake_word_engine_location).state == "Device"; + then: + - wait_until: + not: + voice_assistant.is_running: + - micro_wake_word.start: on_error: - if: condition: @@ -243,14 +265,35 @@ voice_assistant: then: - wait_until: not: ble.enabled - - voice_assistant.start_continuous: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.start - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; else: - lambda: id(voice_assistant_phase) = ${voice_assist_muted_phase_id}; - lambda: id(init_in_progress) = false; - script.execute: draw_display on_client_disconnected: - - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.stop + - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; - script.execute: draw_display script: @@ -319,26 +362,71 @@ switch: - if: condition: lambda: return !id(init_in_progress); - then: - - lambda: id(va).set_use_wake_word(true); + then: - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; - if: condition: not: - voice_assistant.is_running then: - - voice_assistant.start_continuous + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.start - script.execute: draw_display on_turn_on: - if: condition: lambda: return !id(init_in_progress); - then: - - voice_assistant.stop + then: - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop + - micro_wake_word.stop - lambda: id(voice_assistant_phase) = ${voice_assist_muted_phase_id}; - script.execute: draw_display +select: + - platform: template + entity_category: config + name: Wake Word Engine Location + id: wake_word_engine_location + optimistic: True + restore_value: True + options: + - Home Assistant + - Device + initial_option: Device + on_value: + - wait_until: + lambda: return id(voice_assistant_phase) == ${voice_assist_muted_phase_id} || id(voice_assistant_phase) == ${voice_assist_idle_phase_id}; + - if: + condition: + lambda: return x == "Home Assistant"; + then: + - micro_wake_word.stop + - delay: 500ms + - if: + condition: + switch.is_off: mute + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous: + - if: + condition: + lambda: return x == "Device"; + then: + - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop + - delay: 500ms + - micro_wake_word.start + globals: - id: init_in_progress type: bool diff --git a/voice-assistant/esp32-s3-box.yaml b/voice-assistant/esp32-s3-box.yaml index 58117ce3..e1339cb5 100644 --- a/voice-assistant/esp32-s3-box.yaml +++ b/voice-assistant/esp32-s3-box.yaml @@ -24,6 +24,8 @@ substitutions: voice_assist_error_phase_id: '11' voice_assist_muted_phase_id: '12' + micro_wake_word_model: okay_nabu + esphome: name: ${name} friendly_name: ${friendly_name} @@ -64,6 +66,10 @@ external_components: - source: github://pr#5230 components: esp_adf refresh: 0s + # Could soon be removed once micro_wake_word is in stable. + - source: github://pr#6136 + components: micro_wake_word + refresh: 0s api: on_client_connected: @@ -145,6 +151,11 @@ speaker: - platform: esp_adf id: box_speaker +micro_wake_word: + model: ${micro_wake_word_model} + on_wake_word_detected: + - voice_assistant.start + voice_assistant: id: va microphone: box_mic @@ -166,6 +177,17 @@ voice_assistant: on_tts_stream_end: - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; - script.execute: draw_display + on_end: + - if: + condition: + and: + - switch.is_off: mute + - lambda: return id(wake_word_engine_location).state == "Device"; + then: + - wait_until: + not: + voice_assistant.is_running: + - micro_wake_word.start: on_error: - if: condition: @@ -189,13 +211,34 @@ voice_assistant: then: - wait_until: not: ble.enabled - - voice_assistant.start_continuous: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.start - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; else: - lambda: id(voice_assistant_phase) = ${voice_assist_muted_phase_id}; - - lambda: id(init_in_progress) = false; + - lambda: id(init_in_progress) = false; - script.execute: draw_display on_client_disconnected: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop: + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.stop - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; - script.execute: draw_display @@ -266,25 +309,70 @@ switch: condition: lambda: return !id(init_in_progress); then: - - lambda: id(va).set_use_wake_word(true); - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; - if: condition: not: - voice_assistant.is_running then: - - voice_assistant.start_continuous + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Home Assistant"; + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous + - if: + condition: + lambda: return id(wake_word_engine_location).state == "Device"; + then: + - micro_wake_word.start - script.execute: draw_display on_turn_on: - if: condition: lambda: return !id(init_in_progress); then: - - voice_assistant.stop - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop + - micro_wake_word.stop - lambda: id(voice_assistant_phase) = ${voice_assist_muted_phase_id}; - script.execute: draw_display +select: + - platform: template + entity_category: config + name: Wake Word Engine Location + id: wake_word_engine_location + optimistic: True + restore_value: True + options: + - Home Assistant + - Device + initial_option: Device + on_value: + - wait_until: + lambda: return id(voice_assistant_phase) == ${voice_assist_muted_phase_id} || id(voice_assistant_phase) == ${voice_assist_idle_phase_id}; + - if: + condition: + lambda: return x == "Home Assistant"; + then: + - micro_wake_word.stop + - delay: 500ms + - if: + condition: + switch.is_off: mute + then: + - lambda: id(va).set_use_wake_word(true); + - voice_assistant.start_continuous: + - if: + condition: + lambda: return x == "Device"; + then: + - lambda: id(va).set_use_wake_word(false); + - voice_assistant.stop + - delay: 500ms + - micro_wake_word.start + globals: - id: init_in_progress type: bool From 4d5533492552a16f3e53834c3b5251df063e4c02 Mon Sep 17 00:00:00 2001 From: JLo Date: Mon, 19 Feb 2024 09:28:57 +0100 Subject: [PATCH 2/5] Remove external component for micro_wake_word --- voice-assistant/esp32-s3-box-3.yaml | 4 ---- voice-assistant/esp32-s3-box-lite.yaml | 4 ---- voice-assistant/esp32-s3-box.yaml | 4 ---- 3 files changed, 12 deletions(-) diff --git a/voice-assistant/esp32-s3-box-3.yaml b/voice-assistant/esp32-s3-box-3.yaml index d5781d0a..5d30d23c 100644 --- a/voice-assistant/esp32-s3-box-3.yaml +++ b/voice-assistant/esp32-s3-box-3.yaml @@ -72,10 +72,6 @@ external_components: - source: github://pr#5230 components: esp_adf refresh: 0s - # Could soon be removed once micro_wake_word is in stable. - - source: github://pr#6136 - components: micro_wake_word - refresh: 0s api: on_client_connected: diff --git a/voice-assistant/esp32-s3-box-lite.yaml b/voice-assistant/esp32-s3-box-lite.yaml index aa90d257..da6fbb0e 100644 --- a/voice-assistant/esp32-s3-box-lite.yaml +++ b/voice-assistant/esp32-s3-box-lite.yaml @@ -65,10 +65,6 @@ external_components: - source: github://pr#5230 components: esp_adf refresh: 0s - # Could soon be removed once micro_wake_word is in stable. - - source: github://pr#6136 - components: micro_wake_word - refresh: 0s api: on_client_connected: diff --git a/voice-assistant/esp32-s3-box.yaml b/voice-assistant/esp32-s3-box.yaml index e1339cb5..20b5bfcc 100644 --- a/voice-assistant/esp32-s3-box.yaml +++ b/voice-assistant/esp32-s3-box.yaml @@ -66,10 +66,6 @@ external_components: - source: github://pr#5230 components: esp_adf refresh: 0s - # Could soon be removed once micro_wake_word is in stable. - - source: github://pr#6136 - components: micro_wake_word - refresh: 0s api: on_client_connected: From 110488a4b2eeec27b1f0e643d2d85ac4079bfa45 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:34:18 +1300 Subject: [PATCH 3/5] Use beta for va firmware --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c56e6282..02ff09eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,7 @@ concurrency: env: FIRMWARES: esp-web-tools esphome-web voice-assistant bluetooth-proxy media-player + VOICE_ASSISTANT_VERSION: beta jobs: prepare: @@ -43,6 +44,12 @@ jobs: device=${device##*/} device=${device%.yaml} version="latest" + $fw=${firmware//-/_} + $fw=${fw^^} + $fw_version=${fw}_VERSION + if [[ -n "${!fw_version}" ]]; then + version=${!fw_version} + fi matrix="$matrix{\"firmware\":\"$firmware\",\"device\":\"$device\", \"version\":\"$version\"}," done done From 5e8ba7086c5e1f1817533c37be107f19c2dc84a0 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 20 Feb 2024 14:35:26 +1300 Subject: [PATCH 4/5] Fix --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 02ff09eb..5d6b195a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,9 +44,9 @@ jobs: device=${device##*/} device=${device%.yaml} version="latest" - $fw=${firmware//-/_} - $fw=${fw^^} - $fw_version=${fw}_VERSION + fw=${firmware//-/_} + fw=${fw^^} + fw_version=${fw}_VERSION if [[ -n "${!fw_version}" ]]; then version=${!fw_version} fi From 444b9f7ed3b1fb0b8c4836804e4ca2cd26dae411 Mon Sep 17 00:00:00 2001 From: JLo Date: Tue, 20 Feb 2024 09:44:35 +0100 Subject: [PATCH 5/5] Cosmetic changes to the selector --- voice-assistant/esp32-s3-box-3.yaml | 26 +++++++++++++------------- voice-assistant/esp32-s3-box-lite.yaml | 26 +++++++++++++------------- voice-assistant/esp32-s3-box.yaml | 26 +++++++++++++------------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/voice-assistant/esp32-s3-box-3.yaml b/voice-assistant/esp32-s3-box-3.yaml index 5d30d23c..bb958673 100644 --- a/voice-assistant/esp32-s3-box-3.yaml +++ b/voice-assistant/esp32-s3-box-3.yaml @@ -185,7 +185,7 @@ voice_assistant: condition: and: - switch.is_off: mute - - lambda: return id(wake_word_engine_location).state == "Device"; + - lambda: return id(wake_word_engine_location).state == "On device"; then: - wait_until: not: @@ -216,13 +216,13 @@ voice_assistant: not: ble.enabled - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(true); - voice_assistant.start_continuous: - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.start - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; @@ -233,13 +233,13 @@ voice_assistant: on_client_disconnected: - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(false); - voice_assistant.stop: - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.stop - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; @@ -320,13 +320,13 @@ switch: then: - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(true); - voice_assistant.start_continuous - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.start - script.execute: draw_display @@ -344,20 +344,20 @@ switch: select: - platform: template entity_category: config - name: Wake Word Engine Location + name: Wake word engine location id: wake_word_engine_location optimistic: True restore_value: True options: - - Home Assistant - - Device - initial_option: Device + - In Home Assistant + - On device + initial_option: On device on_value: - wait_until: lambda: return id(voice_assistant_phase) == ${voice_assist_muted_phase_id} || id(voice_assistant_phase) == ${voice_assist_idle_phase_id}; - if: condition: - lambda: return x == "Home Assistant"; + lambda: return x == "In Home Assistant"; then: - micro_wake_word.stop - delay: 500ms @@ -369,7 +369,7 @@ select: - voice_assistant.start_continuous: - if: condition: - lambda: return x == "Device"; + lambda: return x == "On device"; then: - lambda: id(va).set_use_wake_word(false); - voice_assistant.stop diff --git a/voice-assistant/esp32-s3-box-lite.yaml b/voice-assistant/esp32-s3-box-lite.yaml index da6fbb0e..6175aacf 100644 --- a/voice-assistant/esp32-s3-box-lite.yaml +++ b/voice-assistant/esp32-s3-box-lite.yaml @@ -232,7 +232,7 @@ voice_assistant: condition: and: - switch.is_off: mute - - lambda: return id(wake_word_engine_location).state == "Device"; + - lambda: return id(wake_word_engine_location).state == "On device"; then: - wait_until: not: @@ -263,13 +263,13 @@ voice_assistant: not: ble.enabled - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(true); - voice_assistant.start_continuous: - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.start - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; @@ -280,13 +280,13 @@ voice_assistant: on_client_disconnected: - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(false); - voice_assistant.stop: - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.stop - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; @@ -367,13 +367,13 @@ switch: then: - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(true); - voice_assistant.start_continuous - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.start - script.execute: draw_display @@ -391,20 +391,20 @@ switch: select: - platform: template entity_category: config - name: Wake Word Engine Location + name: Wake word engine location id: wake_word_engine_location optimistic: True restore_value: True options: - - Home Assistant - - Device - initial_option: Device + - In Home Assistant + - On device + initial_option: On device on_value: - wait_until: lambda: return id(voice_assistant_phase) == ${voice_assist_muted_phase_id} || id(voice_assistant_phase) == ${voice_assist_idle_phase_id}; - if: condition: - lambda: return x == "Home Assistant"; + lambda: return x == "In Home Assistant"; then: - micro_wake_word.stop - delay: 500ms @@ -416,7 +416,7 @@ select: - voice_assistant.start_continuous: - if: condition: - lambda: return x == "Device"; + lambda: return x == "On device"; then: - lambda: id(va).set_use_wake_word(false); - voice_assistant.stop diff --git a/voice-assistant/esp32-s3-box.yaml b/voice-assistant/esp32-s3-box.yaml index 20b5bfcc..69df6b3c 100644 --- a/voice-assistant/esp32-s3-box.yaml +++ b/voice-assistant/esp32-s3-box.yaml @@ -178,7 +178,7 @@ voice_assistant: condition: and: - switch.is_off: mute - - lambda: return id(wake_word_engine_location).state == "Device"; + - lambda: return id(wake_word_engine_location).state == "On device"; then: - wait_until: not: @@ -209,13 +209,13 @@ voice_assistant: not: ble.enabled - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(true); - voice_assistant.start_continuous: - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.start - lambda: id(voice_assistant_phase) = ${voice_assist_idle_phase_id}; @@ -226,13 +226,13 @@ voice_assistant: on_client_disconnected: - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(false); - voice_assistant.stop: - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.stop - lambda: id(voice_assistant_phase) = ${voice_assist_not_ready_phase_id}; @@ -313,13 +313,13 @@ switch: then: - if: condition: - lambda: return id(wake_word_engine_location).state == "Home Assistant"; + lambda: return id(wake_word_engine_location).state == "In Home Assistant"; then: - lambda: id(va).set_use_wake_word(true); - voice_assistant.start_continuous - if: condition: - lambda: return id(wake_word_engine_location).state == "Device"; + lambda: return id(wake_word_engine_location).state == "On device"; then: - micro_wake_word.start - script.execute: draw_display @@ -337,20 +337,20 @@ switch: select: - platform: template entity_category: config - name: Wake Word Engine Location + name: Wake word engine location id: wake_word_engine_location optimistic: True restore_value: True options: - - Home Assistant - - Device - initial_option: Device + - In Home Assistant + - On device + initial_option: On device on_value: - wait_until: lambda: return id(voice_assistant_phase) == ${voice_assist_muted_phase_id} || id(voice_assistant_phase) == ${voice_assist_idle_phase_id}; - if: condition: - lambda: return x == "Home Assistant"; + lambda: return x == "In Home Assistant"; then: - micro_wake_word.stop - delay: 500ms @@ -362,7 +362,7 @@ select: - voice_assistant.start_continuous: - if: condition: - lambda: return x == "Device"; + lambda: return x == "On device"; then: - lambda: id(va).set_use_wake_word(false); - voice_assistant.stop