The Intent Script integration allows users to configure actions and responses to intents. Intents can be fired by any integration that supports it. Examples are Alexa (Amazon Echo) and Dialogflow (Google Assistant). Internally they can be fired by custom sentences.
If you are using intent script with LLMs and have parameters, make sure to mention the parameters and their types in the description.
# Example configuration.yaml entry
intent_script:
GetTemperature: # Intent type
description: Return the temperature and notify the user
speech:
text: We have {{ states('sensor.temperature') }} degrees
action:
action: notify.notify
data:
message: Hello from an intent!
Inside an intent we can define these variables:
Configuration Variables
Name of the intent. Multiple entries are possible.
Description of the intent.
List of domains that the entity supports.
Defines an action to run to intents.
Set to True to have Home Assistant not wait for the script to finish before returning the intent response.
The script mode in which to run the intent script. Use this to define if the intent should be able to run multiple times in parallel.
Card to display.
Text or template to return.
Type of speech.
Text to speech.
Using the action response
When using a speech template, data returned from the executed action are
available in the action_response variable.
conversation:
intents:
EventCountToday:
- "HowmanymeetingsdoIhavetoday"
intent_script:
EventCountToday:
action:
- action: calendar.get_events
target:
entity_id: calendar.my_calendar
data_template:
start_date_time: "{{today_at('00:00')}}"
duration: { "hours": 24 }
response_variable: result # get action response
- stop: ""
response_variable: result # and return it
speech:
text: "{{action_response['calendar.my_calendar'].events|length}}" # use the action's response
List of actions
The Intent Script integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] provides the following actions. Each link below opens a dedicated page with examples, parameters, and a step-by-step UI walkthrough.
-
Reload intent scripts (
intent_script.reload) Reloads the intent scripts from the YAML configuration.
For an overview of every action across all integrations, see the actions reference.
