I've created an automation that will ask me a yes or no question (using an assist satellite, HA voice preview edition). The answer is stored in a variable. I can't figure out how use an input_text helper to pull the answer/variable from that automation so I can use it as a trigger to run other automations. Should I create an input_text helper with the same name as the response variable? How do I get a differ automation trigger to 'notice' that the question was answered? Any help would be appreciated!
#Run Automations from 'Ask a question' response variable
1 messages · Page 1 of 1 (latest)
I guess when one automation asks you, you give an answer and automation will get this answer. Then you can immediately do whatever this "yes/no" means, or you can store the result to the input_text helper and then trigger another automation
Thanks for the reply. That's exactly what I want to do, store the result in an input_text helper, but I don't know how to do that. How do I 'store' it, and how do I know what is stored?
In your "yes/no" automation request, I guess there is a response variable, which gives you certain result
but why don't you simply receive a yes/no answer to the response variable, and then continue in the same automation with the activity according to the yes/no response? Use the if option
You also have an action for input_text.set_value to store the value to your input text helper, whatever the value is (yes/no) or (1/0)
That would be ideal, honestly, where does the 'if' option need to go? Here's what it looks like so far
can you share the yaml of the full automation you have so far?
the response variable should be "variable_name_type" text, no spaces, as it is a "programming" one.
I haven't done anything in yaml, I'm pretty unfamiliar with it, how do I do that?
top-right on the page, you have "show YAML"
and then copy it here, use the formatting with triple ` characters
Got it, I haven't updated it to have underscores yet:
description: ""
triggers:
- trigger: state
entity_id:
- binary_sensor.everything_presence_one_5b2078_occupancy
from: "off"
to: "on"
for:
hours: 0
minutes: 0
seconds: 1
conditions:
- condition: state
entity_id: input_boolean.automation_override
state: "off"
actions:
- action: assist_satellite.ask_question
metadata: {}
data:
question: Good morning! Would you like to know what's on your agenda for today?
preannounce: true
entity_id: assist_satellite.home_assistant_voice_09bdfd_assist_satellite
answers:
- id: "Yes"
sentences:
- "Yes"
- id: "No"
sentences:
- "No"
response_variable: Morning Agenda Answer
mode: single
actions:
- action: assist_satellite.ask_question
metadata: {}
data:
question: Good morning! Would you like to know what's on your agenda for today?
preannounce: true
entity_id: assist_satellite.home_assistant_voice_09bdfd_assist_satellite
answers:
- id: "Yes"
sentences:
- "Yes"
- id: "No"
sentences:
- "No"
response_variable: response_answer_hoes_here
- if:
- condition: template
value_template: "{{ response_answer_hoes_here == 'Yes' }}"
then:
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id: light.lights_all
See my actions part, First you execute the assist_satellite, and then you do another action just after, that is an if statement, depends on the value from previous.
A demo of my simple AI task that asks for data and gets the reply:
sequence:
- action: ai_task.generate_data
data:
task_name: home summary
instructions: >-
Randomly select "yes" or "no" word and reply with a single word. use all
lowercase
response_variable: ai_response
- action: system_log.write
metadata: {}
data:
level: debug
message: "{{ ai_response }}"
- if:
- condition: template
value_template: "{{ ai_response.data == 'yes' }}"
then:
- action: light.turn_on
target:
entity_id: light.office_ceiling
else:
- action: light.turn_off
target:
entity_id: light.office_ceiling
alias: New script
description: ""
I think I'm getting it. I'm trying to do this via the UI, so I've adjusted the response variable to be be Morning_Agenda_Answer
I'm adding a second action afterward that is if/then - so isthe Morning_Answer_Agenda an entity?
Sorry, I just have no idea how to interact with yaml 🙁
This would ideally be the first in several, thank you for your help
when your action will ask you by voice do you wantblabla and you reply with yes/no, then this yes/no will be stored in your "response variable", which you have named as Morning_Answer_Agenda
And this action is now completed. You can, in your automation, put next action afterwards, and this next action can use the result from previous one
you see in my example, how my first action is the "get data in the response varaible"
and second action is "write log" of the data from action before
I do, yes
ok, so then, the third action is the if check
where I made a decision that if the answer was yes, I turn on the light, and if answer was no, I do something else
I use the jinja template, because it is considered as an advanced check operation
in my case the variable name is ai_response and ai_response.data holds the information
If you run actions you have so far, you can see the content of the variable in the traces view
Okay, so then I just need to work on the if statement after the response is provided
yes
when you look at traces, you will see step by step the exeuction for example in my case
First step was t oget yes/no answeR:
I got the yes, so ai_response.data was set to yes
my if executed the then part because the if was a success
so now when I run the script multiple times, light is a bit on a bit off 🙂
So this is only accomplishable using the traces? I understand the logic, but I don't know how to use traces or yaml, so I have to use the UI for now
I do really appreciate the help, I just am limited, coding is a little out of my expertise right now
no, traces are there for you to debug what is going on 🙂
when your automation runs, you have traces, that allows you to see what happened in the past, so you can debug the problem
you can contact me privately and we organize voice if you want - up to you
Possibly, I'd like to keep it here if possible so others can see how this was resolved, or I can refer back to it in the future, it's been very helpful so far
So right now I need to know what options to select for the second action, I'm choosing 'add built block' then 'if-then'
yes
for condition use "template"
Hmm, to guide you step-by-step like this it might be tough, because I'd like to know the variable response format from the first action. For that you must run the automation actions first to see the traces, and then see the result, like I showed you just above in my example
Ah, I understand
so, with the first action only, can you run the automation once (top right corner -> run actions)
and see what is the variable response under the traces?
This is all that I see afterward
entity_id: automation.morning_agenda
state: 'on'
attributes:
id: '1753811331742'
last_triggered: '2025-09-21T17:46:23.816775+00:00'
mode: single
current: 1
friendly_name: Morning Agenda
last_changed: '2025-09-21T17:44:50.914043+00:00'
last_reported: '2025-09-21T17:46:23.816888+00:00'
last_updated: '2025-09-21T17:46:23.816888+00:00'
context:
id: 01K5PP4M6865ESEKTC4RYNBZZN
parent_id: 01K5PP4M67MJQ5BY32WVB0KBW5
user_id: null
trigger:
id: '0'
idx: '0'
alias: null
platform: state
entity_id: binary_sensor.everything_presence_one_5b2078_occupancy
from_state:
entity_id: binary_sensor.everything_presence_one_5b2078_occupancy
state: 'off'
attributes:
device_class: occupancy
friendly_name: Everything Presence One 5b2078 Occupancy
last_changed: '2025-09-21T17:45:41.887504+00:00'
last_reported: '2025-09-21T17:45:41.887504+00:00'
last_updated: '2025-09-21T17:45:41.887504+00:00'
context:
id: 01K5PP3B7ZG7QAA3MN4NVVRQEQ
parent_id: null
user_id: null
to_state:
entity_id: binary_sensor.everything_presence_one_5b2078_occupancy
state: 'on'
attributes:
device_class: occupancy
friendly_name: Everything Presence One 5b2078 Occupancy
last_changed: '2025-09-21T17:46:29.302924+00:00'
last_reported: '2025-09-21T17:46:29.302924+00:00'
last_updated: '2025-09-21T17:46:29.302924+00:00'
context:
id: 01K5PP4SHP5SEZG5XATMJ4CY89
parent_id: null
user_id: null
for:
__type: <class 'datetime.timedelta'>
total_seconds: 1
attribute: null
description: state of binary_sensor.everything_presence_one_5b2078_occupancy```
this is the automation one (trigger one)
click on one step on the side and click "changed variable"
these points are clickable so you can see each step
find the step that asks you for yes/no
Oh, I didn't realize that, thank you. It looks like maybe it isn't changing the variable
metadata: {}
data:
question: Good morning! Would you like to know what's on your agenda for today?
preannounce: true
entity_id: assist_satellite.home_assistant_voice_09bdfd_assist_satellite
answers:
- id: 'Yes'
sentences:
- 'Yes'
- id: 'No'
sentences:
- 'No'
response_variable: Morning_Agenda_Answer```
and you got the voice in reality and you said "yes" as a response ?
I did, it asked the question as usual, i verbally responded yes, and then it stopped listening
then this step did execute
you sure you have clicked the correct icon on the left of the steps?
there are 2 orange, which one did you enable?
click all 4 icons and check "changed variables" for all of them....
if you got voice then it was executed
please make sure that you are looking at correct trace -> there are several on top
I've asked GPT to see if it will be the same what I asked above, seems so:
alias: Example - Ask Yes/No with Assist Satellite
sequence:
- service: assist_satellite.ask_question
target:
entity_id: assist_satellite.living_room
data:
question: "Do you want me to turn on the heater?"
type: "yes_no"
response_variable: answer
- if:
- condition: template
value_template: "{{ answer == 'yes' }}"
then:
- service: switch.turn_on
target:
entity_id: switch.heater
else:
- service: notify.mobile_app_myphone
data:
message: "Heater left off"
mode: single
Do you think it's not capturing the response?
Hah, I was hoping this would be a simple mistake on my end
I think there is one 🙂
Okay, I've made some progress
I watched this video on YouTube: https://www.youtube.com/watch?v=3SaQlqrnFpo
It is now possible for Home Assistant to ask YOU a question and you be able to answer conversationally. This does not require that you use an LLM. It is all handled locally. If you don't have the local hardware power for this and you subscribe to the Nabu Casa cloud, you can use their hardware for super-fast responses.
Support this channel by b...
show YAML, let's see
Basically after following his steps, it still wasn't quite working, so I changed the response to 'Deny' and 'Affirm' instead of 'Yes' and 'No' because one of the commenters said they had trouble with that, but it still wasn't working
So I looked at the traces you showed me how to use, and realized that it was capturing the last word of the verbal response as part of my answer, so if the last word of the question it asks is 'today', it will hear 'Today Yes'
And this is happening because there is a slight delay caused by the bluetooth speaker I am using which is connected to voice assistant
alright, so then the traces helped you to get a solution, very good