Today, I’m going to show you how to integrate Amazon Alexa with Home Assistant Cloud.
So you can control your entities from any Amazon Echo device without exposing your Home
Assistant to the Internet.
I’m also going to show you how to configure what entities can be controlled with Alexa,
and how to customize the response when a command is giving.
Open Home Assistant and on the sidebar, click on Configuration and then Home Assistant Cloud.
If this is the first time using the Cloud service, you can sign up and get a 30 days
free trial so you can test it out.
After you’re signed in, enable the Alexa integration.
Then, you need to enable the Home Assistant skill so, on a mobile device, open the Amazon
Alexa app.
Tap on Menu and then Skills & Games.
Search and select Home Assistant.
Then tap Enable to use, and sign in to Home Assistant Cloud to link your account.
After Home Assistant is linked, on the next page, click on Discover devices to sync your
entities with Alexa and assign them to groups.
All right, so Alexa is now integrated with Home Assistant and you can start controlling
your entities from any Amazon Echo device.
To trigger entities that have an on and off switch, for example, a light, you can simply
say “Alexa, turn on living room light”, And it would turn the light on with no problem.
However, entities like scripts, for example, a script to lock your computer, you wouldn’t
be able to just say, “Alexa, lock computer” You would actually have to say “Alexa, activate”
and then the name for the script.
A solution to this would be to use routines and set up a phrase that would trigger a specific
Home Assistant script.
Let me show you an example of how to set up a routine using a script to lock my computer.
On the Amazon Alexa app, tap on Menu, Routines, and then the “+” plus icon to create a
new routine.
Tap on When this happens, Voice, and then enter the phrase that would trigger the command.
Save the phrase and then tap on Add action, Smart Home, Control scene, and select the
script that you would like to use.
Now, if you want to customize Alexa’s response you can add another action, select Alexa says,
custom, and enter the phrase that you would like Alexa to respond back.
After that, tap on Next and then Add.
Now, any time you say the phrase on the routine, it would execute the action that was set up.
Now, let’s go ahead and put it to the test, “Alexa, lock computer”
All right so it ran the command that I wanted and it gave me a better response.
The last thing that we’re going to look at is how to configure in Home Assistant the
entities that can be controlled from Alexa, and which ones to exclude.
Also, how to change the name of the entities, add a description, and assign them to specific
categories.
All right, in your Home Assistant config folder, create a new file and name it cloud.yaml.
Then, in the configuration.yaml file, add the following to the cloud component.
After that, open the cloud.yaml file and add the following:
Under filter, there are a few variables that you can use.
So, depending on your setup, and the number of entities that you would like to expose
to Alexa, you can either use include_entities which would only expose the list of entities
that you specify, or exclude_entities, which exclude the entities in that list.
Alternatively, you can either use include_domains or exclude_domains which can either include
or exclude all entities inside of a specific domain.
Now, to configure how entities are exposed to Amazon Alexa, you can use the variable
entity_config.
With this, you can change the entity’s name, add a description and also specify the category
that the entity belongs to.
I personally suggest setting this option for the entities exposed to Alexa.
So like that, if you unlink and then relink the Home Assistant skill, it would automatically
set all the entities with a description and also set them up in the specific category.
After you finish making changes to the cloud.yaml file, restart Home Assistant and then sync
the updates to Alexa by simply asking, “Alexa, discover new devices”
All right guys, that's all I have for you today.
Remember to check the written guide on my website for any changes.
You can find a link in the description.
If you have a Google home, make sure to check out my previous video where I show you how
to set up Google Assistant with Home Assistant Cloud.
Like always guys, thank you for watching.
If you like this video, give it a thumbs up.
Don’t forget to subscribe if you haven’t done so already, and, I would see you in the
next video.