I’m a beginner with HA and, after discovering the Companion app will let me use voice without HTTPS (online posts on that topic are contradictory), am trying to make Assist more useful. There’s a lot in the documentation about using custom phrases etc (in Assist - Custom Sentences - Home Assistant). It isn’t clear to me from this instruction whether, after adding a custom sentence using “Create automation”, we’re meant to add this in configuration.yaml and/or the config directory as well. Anyway, doing all of this didn’t work initially for me this morning even after reloading YAML, and Assist just said “Sorry, I didn’t understand that”.
What worked for me for both TV_power_on and TV_power_off scripts after several attempts was just creating automations with the trigger sentence (When the sentence ‘Switch off the tele’ or 'Switch off the tally’ is said) and the action “Call a service ‘Scripts: TV_power_off’”.
This is my automation
alias: To turn off the TV
description: Should run the script TV_power_off
trigger:
- platform: conversation
command:
- Switch off the tele
- Switch off the tally
condition: []
action:
- service: script.tv_power_off
data: {}
response_variable: R
mode: single
I’m trying to understand how Home Assistant is processing voice commands but, strangely, the debug log below doesn’t show details of the script that was called (TV_power_off) - a potential source of confusion with similarly named scripts for on and off where the device remote only has a power toggle. (The reason for using scripts here is to check the device state before toggling - my Google Home incorrectly turns on the TV at bedtime when I run a routine.) Is there any way to get HA to show the exact action performed in response to the trigger?
Thanks.
(Assist debug log)
stage: done
run:
pipeline: 01h5z2s1a14bnzvqwfq7jn171b
language: en
events:
- type: run-start
data:
pipeline: 01h5z2s1a14bnzvqwfq7jn171b
language: en
runner_data:
stt_binary_handler_id: 1
timeout: 30
timestamp: "2023-07-31T09:39:06.885629+00:00"
- type: stt-start
data:
engine: stt.faster_whisper
metadata:
language: en
format: wav
codec: pcm
bit_rate: 16
sample_rate: 16000
channel: 1
timestamp: "2023-07-31T09:39:06.886010+00:00"
- type: stt-end
data:
stt_output:
text: " Switch off the tele."
timestamp: "2023-07-31T09:39:14.257017+00:00"
- type: intent-start
data:
engine: homeassistant
language: en
intent_input: " Switch off the tele."
conversation_id: null
device_id: null
timestamp: "2023-07-31T09:39:14.257093+00:00"
- type: intent-end
data:
intent_output:
response:
speech:
plain:
speech: Done
extra_data: null
card: {}
language: en-GB
response_type: action_done
data:
targets: []
success: []
failed: []
conversation_id: null
timestamp: "2023-07-31T09:39:14.334905+00:00"
- type: tts-start
data:
engine: tts.google_en_com
language: en-gb
voice: null
tts_input: Done
timestamp: "2023-07-31T09:39:14.335036+00:00"
- type: tts-end
data:
tts_output:
media_id: media-source://tts/tts.google_en_com?message=Done&language=en-gb
url: >-
/api/tts_proxy/e9b450d14bc2363d292c84f17cfad5cfbd58a458_en-gb_-_tts.google_en_com.mp3
mime_type: audio/mpeg
timestamp: "2023-07-31T09:39:14.335747+00:00"
- type: run-end
data: null
timestamp: "2023-07-31T09:39:14.335823+00:00"
stt:
engine: stt.faster_whisper
metadata:
language: en
format: wav
codec: pcm
bit_rate: 16
sample_rate: 16000
channel: 1
done: true
stt_output:
text: " Switch off the tele."
intent:
engine: homeassistant
language: en
intent_input: " Switch off the tele."
conversation_id: null
device_id: null
done: true
intent_output:
response:
speech:
plain:
speech: Done
extra_data: null
card: {}
language: en-GB
response_type: action_done
data:
targets: []
success: []
failed: []
conversation_id: null
tts:
engine: tts.google_en_com
language: en-gb
voice: null
tts_input: Done
done: true
tts_output:
media_id: media-source://tts/tts.google_en_com?message=Done&language=en-gb
url: >-
/api/tts_proxy/e9b450d14bc2363d292c84f17cfad5cfbd58a458_en-gb_-_tts.google_en_com.mp3
mime_type: audio/mpeg