Is it possible to use Assist input phrase in Automation?
In Assist debug log I see
stt.speech_to_phrase
output: music off
and
conversation.home_assistant
Input: music off
The idea is to use “music off” as condition in automation.
Is it possible to use Assist input phrase in Automation?
In Assist debug log I see
stt.speech_to_phrase
output: music off
and
conversation.home_assistant
Input: music off
The idea is to use “music off” as condition in automation.
Hi, you can use the condition of a mediaplayer anyhow → Media player - Home Assistant
“music off” was just example of input phrase. It could be “turn on the lamp” phrase.
I am trying to use variable, but without success so far.
Probably event syntax is wrong.
actions:
- variables:
phrase: '{{ event("stt-end", "stt_output") }}'
If I understand correctly, you want to say for example: “turn on the lamp” and have HA do normal processing through the Assist pipeline including returning a textual/speech response and turning the lamp on, and at the same time you want to trigger an automation based on the text “turn on the lamp”.
If this is correct, I don’t see a way to trigger directly off an event like this.
I think the events you are seeing (stt.speech_to_phrase, conversation.home_assistant) are events going through the Assist pipeline, and but they are not being presented on the “Event” bus (the Event bus is what is needed to trigger an automation).
I tested this out, when I tell Assist to say turn on a light, the only event showing up on the event bus (other than the light being turned on), is the conversation assistant is providing its state change on the event bus but nothing more.
I have a working automation that lower music volume when assist in progress and restore volume to initial state when assist is done.
The problem here I can’t use another automation that does volume up and down or set volume. Because it conflicts with first automation and I get the same volume. Yes, I tested it
So my idea is to use stt_output
phrase as condition:
if stt_output=“volume up” then intial_volume + 10
if stt_output=“volume down” then intial_volume - 10
where intial_volume is variable from first automation that store volume value before assist was activated. I wanted to do it in one automation.