⚠️ Before continuing, ensure everything is already working with the original Assist integration in Home Assistant and your instance of HA is exposed to the Internet with an valid domain and HTTPS certificate.
- Creating the Alexa Skill
- Obtaining the home_assistant_agent_id
- Obtaining the home_assistant_token
- Setting the Invocation Name
- Publishing the Skill
- Enabling room recognition
- Enabling conversation starter with prompt from Home Assistant
- Create a Skill in the Alexa Developer Console by following the steps below:
- Name your Skill: Choose a name of your preference (e.g., Home Assistant Assist)
- Choose a primary locale: Portuguese (BR)
- Choose a type of experience: Other
- Choose a model: Custom
- Hosting services: Alexa-hosted (Python)
- Hosting region: US East (N. Virginia) is the default, but you must use the same region where you created the AWS account and configured IAM Instructions here
- Templates: Click on
Import skill - Insert the address: https://github.com/fabianosan/HomeAssistantAssist.git and click
Import
- Go to the Code tab.
- Insert your information into the configuration file as instructed below:
-
Open the
config.cfgfile in the project's root directory (/Skill Code/lambda/). -
Insert the following information (required settings):
home_assistant_url=https://YOUR-HOME-ASSISTANT-EXTERNAL-URL home_assistant_token=YOUR-HOME-ASSISTANT-TOKEN
-
home_assistant_url: External URL of your Home Assistant (root path).
-
home_assistant_token: Long-lived access token for your Home Assistant.
-
You can add these
optionalsettings as well (but pay attention to the instructions each requires):home_assistant_agent_id=YOUR-AGENT-ID home_assistant_language=pt-BR home_assistant_room_recognition=False home_assistant_dashboard=YOUR-DASHBOARD-ID home_assistant_kioskmode=False assist_input_entity=input_text.assistant_input ask_for_further_commands=False suppress_greeting=False debug=True
-
(optional) home_assistant_agent_id: Conversation agent ID configured in your Home Assistant; if not set, Assist will be used (Default).
-
(optional) home_assistant_language: Language to call the Home Assistant conversation API. If not set, the agent's default language will be used.
-
(optional) home_assistant_room_recognition: Enable device area recognition mode with
True. Attention, it only works with AI and need extra setup in Home Assistant. if you're using the default Assist, disable this option, as no command will work. -
(optional) home_assistant_dashboard: Dashboard path to display on Echo Show, e.g.,
mushroom; if not set, "lovelace" will be loaded. -
(optional) home_assistant_kioskmode: Enable kiosk mode with
True. Attention, only activate this option if you have the kiosk mode component installed. -
(optional) assist_input_entity: Enable conversation starter with prompt from Home Assistant
input_text.assistant_input. Attention, this feature require extra setup in Home Assistant. -
(optional) ask_for_further_commands, This variable determines whether Alexa will ask for further commands after responding. Set it to
Trueto enable this behavior orFalseto disable it. The default isFalse.
-
- (optional) suppress_greeting, This variable determines whether Alexa will speak the initial greeting/question when opening the skill. Set it to
Trueto disable the greeting orFalseto keep it. The default isFalse. - (optional) debug, Enable debbuging with
True. Set this variable to log the debug messages.
- If you wish, change the skill responses in the
/locale/en-US.langfile or another supported language. - After making any changes in the code or configuration, click
Save. - Then click
Deploy. - Finally, go back to the
Buildtab and clickBuild skill.
- Navigate to Developer Tools, go to the
Actionstab, and follow the steps below:
- Search for
conversation.processin the action field and select it:
- Enable the
Agentfield and select the desired conversation agent from the list:
- Switch to
YAML MODEand copy the ID from theagent_idfield:
-
With your Home Assistant open, go to your user profile in the bottom-left corner, click on it, and then go to the
Securitytab at the top:- At the bottom of the page, click the
CREATE TOKENbutton: - Enter a name that you find appropriate, e.g.,
Home Assistant Skill Assistand clickOK:
- Copy the token:
- Place the generated token in the configuration
- At the bottom of the page, click the
- The default invocation name set in the code is "smart house."
- To change the invocation name:
- Go to the Build tab.
- Click on
Invocationsand then onSkill Invocation Name. - Enter the desired new invocation name and save the changes (test if this wake word can be used in the Test tab).
- Rebuild the model by clicking on
Build skillif you make changes.
-
After deploying the code in the Code tab, return to the Build tab and click on Build skill.
-
Then go to the Alexa app on your phone:
More>Skills & Games> scroll to the bottom and click onYour Skills>Dev., click on the skill you just created and activate it. -
Go back to the
Alexa Developer Consoleand test the Skill in the Test tab to ensure the wake word and skill are working correctly.
-
In this mode, the skill sends the device ID (from the
Echodevice running the skill) in the Home Assistant conversation API call. Then, with a command instruction for the AI and a label associated with the device, the AI can identify the devices in the same area where yourAlexais located. To enable it, follow the steps below:Attention!
- Change the
home_assistant_room_recognitionsetting toTrue, then redeploy and perform a newBuild Modelfor the skill; - Enable conversation API debug logging by adding the following configuration to Home Assistant's
configuration.yaml:
- Insert the following information:
logger: logs: homeassistant.components.conversation: debug
- Restart Home Assistant and start the skill from the desired Echo device. After activation, the log will show the instruction received by the skill as in the example below:
2024-10-10 11:04:56.798 DEBUG (MainThread) [homeassistant.components.conversation.agent_manager] Processing in en-US: turn on the living room light. device_id: amzn1.ask.device.AMAXXXXXX
You can also obtain the device_id from the log "device: " in the
Alexa Developer ConsoleinCloud Watchif you know how to do it. 4. Take the entire identifier after the device_id, e.g.,amzn1.ask.device.AMAXXXXXX, and add a new label to the Echo device using theAlexa Media PlayerIntegration:- Update your preferred AI command prompt with the following instruction:
If asked to perform an action and no area is specified for the device, capture the identifier contained after "device_id:" in the command, obtain the label with the same identifier, and associate the device requested in the command to the label area found.
- Change the
⚠️ Before continuing, ensure that you must have Alexa Media Player installed and configured.
-
Enable the configuration in Alexa skill: - Add the following line to your
config.cfgfile:assist_input_entity = input_text.assistant_input -
Create a Text Helper in Home Assistant:
- Open Home Assistant.
- Go to: Settings → Devices & Services → Helpers
- Click Create Helper → Choose Text.
- Set the following options:
- Name:
assistant_input - Maximum number of characters:
255(this is the hard limit)
- Name:
- Click Create.
⚠️ Note: 255 characters is a hard limitation for prompt size. There's no reliable workaround yet, except embedding other text inputs into the prompt. -
Create a Script in Home Assistant:
-
Go to the Alexa Developer Console.
-
On your skill’s home page, click Copy Skill ID.
-
In Home Assistant, navigate to Settings → Automations & Scenes → Scripts.
-
Click Add Script and enter a name like
Prompt Alexa Device. -
Click the three-dot menu (⋮) and switch to YAML mode.
-
Paste the following YAML into the editor.
Replace the placeholders:*Your Skill ID*→ Your actual Alexa skill ID
sequence: - action: input_text.set_value metadata: {} data: value: "{{prompt}}" target: entity_id: input_text.assistant_input - action: media_player.play_media data: media_content_id: *Your Skill ID* media_content_type: skill target: entity_id: "{{alexa_device}}" - delay: hours: 0 minutes: 0 seconds: 10 milliseconds: 0 - action: input_text.set_value metadata: {} data: value: none target: entity_id: input_text.assistant_input alias: Prompt on Alexa device description: "" fields: prompt: selector: text: null name: prompt description: The prompt to pass to the skill, used as the first message to start a conversation. required: true alexa_device: selector: text: null name: alexa_device description: The Alexa device you need to start the skill to prompt. required: true -
Click Save.
-
-
Call the Script from an Automation
Now that the script is configured, you can trigger it from an automation or test it using Developer Tools > Actions:
- Send a prompt to your Alexa skill;
- Start a voice conversation with the assistant's response.
### Example Automation Action
```
action: script.prompt_on_alexa_device
data:
prompt: Suggest that I remember to lock all doors and windows before leaving
alexa_device: media_player.echoshow_office
```
Other prompt examples:
```
- What is the weather forecast?
- Ask if I would like to turn off the lights
```
> ⚠️ **Important:** Prompts must be **less than 255 characters**, otherwise the call will not
Now you can use your Alexa skill to integrate and interact with Home Assistant via voice using Assist or open your favorite dashboard on the Echo Show. If you enjoyed it, remember to send a Thank You to the developers.
Special thanks
To [rodrigoscoelho](https://github.com/rodrigoscoelho), who started the development of this skill.







