-
-
Notifications
You must be signed in to change notification settings - Fork 37.1k
Description
The problem
Have an intent script that calls a regular script and nothing happens.
Something like:
- action: script.turn_on
metadata: {}
target:
entity_id: script.adjust_temperature
data:
variables:
satellite: "{{ activeSatellite }}"
thermostat: "{{ activeThermostat }}"
does nothing in an intent script.
What version of Home Assistant Core has the issue?
core-2026.3.4
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
intent_script
Link to integration documentation on our website
https://www.home-assistant.io/integrations/intent_script/
Diagnostics information
No response
Example YAML snippet
- action: script.turn_on
metadata: {}
target:
entity_id: script.adjust_temperature
data:
variables:
satellite: "{{ activeSatellite }}"
thermostat: "{{ activeThermostat }}"Anything in the logs that might be useful for us?
Additional information
Have many custom sentences and intent scripts. Wanted to add a way to interactively change the set temperature on a thermostat.
What I usually do with a new voice command is to create an automation to fully test and debug the command then copy the automation yaml code into my intents.yaml. This has aways worked well.
When I copied the automation yaml code with assist_satellite.ask_question into the intent script, it didn't work.
After doing some research, it looked like assist_satellite.ask_question needed to be used in a script. (I could find no documentation for this and it seemed the only way people could get assist_satellite.ask_question to work.)
I created an adjust_temperature script with the assist_satellite.ask_question code and called it from the intent script and nothing happened. I was calling the adjust_temperature script directly using "action: script.adjust_temperature".
When I changed the intent script to use script.turn_on, the adjust_temperature script still didn't work. Needed to pass some values to the adjust_temperature script so thought that could be the problem. When I removed passing values to the adjust_temperature script, it still didn't work.
Looking at the trace for the adjust_temperature script it looks like the intent script is never calling the adjust_temperature script. Checked all the logs and no errors found.
This is the intent code:
- action: assist_satellite.announce
metadata: {}
target:
entity_id: "{{ activeSatellite }}"
data:
message: >-
The temperature is {{
states('sensor.'~activeThermostat~'_air_temperature') | int }} degrees.
preannounce: false
- action: script.turn_on
metadata: {}
target:
entity_id: script.adjust_temperature
data:
variables:
satellite: "{{ activeSatellite }}"
thermostat: "{{ activeThermostat }}"
This is the script code:
description: ""
alias: Adjust Temperature
sequence:
- action: assist_satellite.ask_question
metadata: {}
data:
question: Do you want to change it?
preannounce: false
entity_id: "{{ satellite }}"
answers:
- id: "yes"
sentences:
- "yes"
- id: "no"
sentences:
- "no"
response_variable: answer
The assist_satellite.announce in the intent code works fine so I know the intent script is being called and my variables are OK.