fixes
This commit is contained in:
@@ -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:
|
||||
@@ -137,6 +137,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:
|
||||
@@ -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
|
||||
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:
|
||||
Reference in New Issue
Block a user