This commit is contained in:
radu
2026-12-02 16:19:15 +07:00
parent f329c518ff
commit 515cdb83fb
2 changed files with 50 additions and 20 deletions
+24 -9
View File
@@ -150,6 +150,8 @@ voice_assistant:
- script.execute: rboot
#- script.execute: reset_led
on_client_connected:
- lambda: id(voice_assistant_phase) = 1; # connected again: clear "disconnected" state
- script.stop: rboot # cancel the pending reboot
- delay: 1s # Give the api server time to settle
- script.execute: start_wake_word
on_client_disconnected:
@@ -166,6 +168,7 @@ interval:
- api.connected:
- not:
- voice_assistant.is_running:
- switch.is_off: stop_listen
then:
- script.execute: start_wake_word
@@ -176,8 +179,10 @@ script:
- delay: 180s
- if:
condition:
lambda: |-
return id(voice_assistant_phase) == 4;
and:
- lambda: 'return id(voice_assistant_phase) == 4;'
- not:
- api.connected: # only reboot if HA is still not connected
then:
- switch.turn_on:
id: rbt
@@ -227,17 +232,27 @@ script:
- lambda: id(va).set_use_wake_word(false);
- voice_assistant.stop:
switch:
# - platform: restart
# name: Restart
# id: rbt
- platform: template
name: Stop Listen
id: stop_listen
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
#entity_category: config
on_turn_on:
- microphone.mute: mic_id
#- script.execute: stop_wake_word
# Stop streaming to HA completely instead of sending silence
- script.execute: stop_wake_word
- light.turn_off: led
on_turn_off:
- microphone.unmute: mic_id
#- script.execute: listening_timeout
- script.execute: start_wake_word
start_wake_word script: add the switch.is_off condition.
- id: start_wake_word
then:
- if:
condition:
- not:
- voice_assistant.is_running:
- switch.is_off: stop_listen
then:
- lambda: id(va).set_use_wake_word(true);
- voice_assistant.start_continuous:
+26 -11
View File
@@ -136,7 +136,9 @@ voice_assistant:
- delay: 2s
- script.execute: rboot
#- script.execute: reset_led
on_client_connected:
on_client_connected:
- lambda: id(voice_assistant_phase) = 1; # connected again: clear "disconnected" state
- script.stop: rboot # cancel the pending reboot
- delay: 1s # Give the api server time to settle
- script.execute: start_wake_word
on_client_disconnected:
@@ -153,6 +155,7 @@ interval:
- api.connected:
- not:
- voice_assistant.is_running:
- switch.is_off: stop_listen
then:
- script.execute: start_wake_word
@@ -163,8 +166,10 @@ script:
- delay: 180s
- if:
condition:
lambda: |-
return id(voice_assistant_phase) == 4;
and:
- lambda: 'return id(voice_assistant_phase) == 4;'
- not:
- api.connected: # only reboot if HA is still not connected
then:
- switch.turn_on:
id: rbt
@@ -214,17 +219,27 @@ script:
- lambda: id(va).set_use_wake_word(false);
- voice_assistant.stop:
switch:
# - platform: restart
# #name: Restart
# id: rbt
- platform: template
- platform: template
name: Stop Listen
id: stop_listen
optimistic: true
restore_mode: RESTORE_DEFAULT_OFF
#entity_category: config
on_turn_on:
- microphone.mute: echo_microphone
#- script.execute: stop_wake_word
# Stop streaming to HA completely instead of sending silence
- script.execute: stop_wake_word
- light.turn_off: led
on_turn_off:
- microphone.unmute: echo_microphone
#- script.execute: listening_timeout
- script.execute: start_wake_word
start_wake_word script: add the switch.is_off condition.
- id: start_wake_word
then:
- if:
condition:
- not:
- voice_assistant.is_running:
- switch.is_off: stop_listen
then:
- lambda: id(va).set_use_wake_word(true);
- voice_assistant.start_continuous: