Skip to main content
Smarthome 6 mins

Home Assistant: Cleanly integrating entities into Amazon Alexa

One of the best features of a smart home hub is voice control via Amazon Alexa or Google Assistant. For this to work as desired and with your own names for the various lights, blinds, etc., these should be clearly defined in Home Assistant. Here’s how it works.

Home Assistant: Cleanly integrating entities into Amazon Alexa
Table of Contents

I’m repeating myself here, but a smart home only deserves the name if it works really smartly, and that means it must adjust things automatically according to the respective situation and need, without user intervention. However, sometimes it’s also necessary to be able to manually control lights, blinds, switches, etc. Of course, you don’t want to press a button or use the Home Assistant app every time, but rather control them conveniently by voice command.

⚠ [affiliate] Keine Produkte mit Cache für home-assistant. Bitte affiliate-sync --lang en ausführen.

Via the Nabu Casa service, Amazon Alexa and Google Assistant can be connected to Home Assistant with just a few clicks, and by using the paid service you also support the further development of Home Assistant.

However, the names of the entities are adopted as they were created in Home Assistant, and with names like “LR Ceiling” for the living room ceiling lights, this is neither easy to remember nor particularly safe to use. Alexa in particular tends to misunderstand things. Furthermore, you don’t want to have all entities available as devices in Alexa, but rather those that you actually want to use. Without this restriction, Home Assistant would make over 900 entities available in Alexa for us.

Cleaning up and deleting entities and Alexa devices

In the default setting, Home Assistant transfers all possible entities to Alexa that it finds. This has probably already been the case for most users, so you should clean up first. I’ll limit myself here to using Amazon Alexa, but the process is fundamentally comparable for Google Assistant.

First, go to Home Assistant under Settings -> Home Assistant Cloud to the voice assistant settings. Under Manage Entities you get a list of all entities that have been transferred to Alexa for voice control, and there can be a lot of them. Here you can deactivate all entities that you don’t need for voice control.

However, Home Assistant would automatically transfer all newly added entities to Alexa. To prevent this, select Manage Domains at the top right and deactivate all domains that you don’t need in Alexa. These often include binary sensors or boolean values. I have deactivated all domains because I want to determine myself what I want to use with Alexa. If you click on Reset Entities, all entities of this domain are deactivated and you don’t have to set each one individually.

Once you’ve made these settings, you can delete unnecessary devices that have already been transferred in Alexa. To do this, don’t go to the Alexa app, but to https://alexa.amazon.com , log in with your Amazon credentials and click on Smart Home. Under Devices, all currently available devices that Home Assistant (and other services) have transferred to Alexa are displayed. Now you can either remove individual devices or delete the entire list. To do this, click on Remove All at the end of the list. At the time of this post, the page always acknowledged this with an error message, but still deleted a large portion of the devices. To empty the complete list, I had to click the button multiple times.

This gives you a clean starting point from which you can begin with targeted and clearly defined setup.

Defining Alexa entities and names yourself

To now select the entities that you want to have available via voice control and to define their names, you need to edit the configuration.yaml. To keep the configuration.yaml clear, it makes sense to split it across multiple files. To do this, create a new file cloud.yaml and then enter the following in the configuration.yaml:

yaml
1
cloud: !include cloud.yaml

This tells the config that it should include the new file cloud.yaml. For example, I have outsourced all sensors, switches, scenes, etc. into their own files, which then looks like this in the configuration.yaml:

yaml
1
2
3
4
5
6
7
8
light: !include lights.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
switch: !include switch.yaml
cloud: !include cloud.yaml
sensor: !include sensors.yaml
lcn: !include lcn.yaml

This makes the entire configuration much clearer and easier to handle. The new cloud.yaml now contains all the entities that we want to pass to Amazon.

The cloud.yaml file begins once for Amazon Alexa with

yaml
1
2
alexa:
  entity_config:

Now define all entities, their names and category in Alexa, e.g.

yaml
1
2
3
4
5
6
7
alexa:
  entity_config:

    light.kuche_insel:
      name: Island
      description: Kitchen island lighting
      display_categories: LIGHT

light.kuche_insel is the name of the entity in Home Assistant. Below that is the name under which we want to address this entity with Alexa in the future. Alexa, turn on Island!

The description is optional, but helps later to identify corresponding devices. With display_categories you can assign the different entities to Alexa’s device categories. This creates clarity in the app or when you use Alexa devices with a display. Possible categories are listed here: Alexa.Discovery Interface | Alexa Skills Kit (amazon.com) . Here is an excerpt from my cloud.yaml

yaml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

    light.badschrank:
      name: Bathroom cabinet
      description: Bathroom cabinet lighting
      display_categories: LIGHT

    light.bad_dusche:
      name: Shower
      description: Shower light
      display_categories: LIGHT

    light.bad_decke:
      name: Bathroom ceiling
      description: Bathroom ceiling light
      display_categories: LIGHT

    light.sz_markus:
      name: Markus bedside table
      description: Markus bedside table light
      display_categories: LIGHT

    switch.kaffeemaschine:
      name: Coffee machine
      description: Espresso machine
      display_categories: COFFEE_MAKER

    switch.terrasse_sd:
      name: Terrace sockets
      description: Terrace sockets
      display_categories: SWITCH

    switch.lotkolben_werkstatt:
      name: Soldering iron
      description: Workshop table soldering iron
      display_categories: SWITCH

    vacuum.rockrobo:
      name: Dusty
      description: Roborock ground floor
      display_categories: VACUUM_CLEANER

    vacuum.staubi_2:
      name: Vorwerk
      description: Vorwerk robot
      display_categories: VACUUM_CLEANER

    cover.jalousie_buro_terrasse:
      name: Office door
      description: Office door blind
      display_categories: EXTERIOR_BLIND

    cover.jalousie_bad:
      name: Bathroom window
      description: Bathroom window blind
      display_categories: EXTERIOR_BLIND

And this is what it looks like in the Alexa app:

After you have saved the new configuration and restarted Home Assistant, these devices are automatically transferred to Alexa and also ONLY these. If you later decide that you want to call a device by a different name, simply change the corresponding entry in the cloud.yaml. Although this is a bit of effort during the initial setup, you are rewarded with a clear system that also responds to the voice commands you want to use - and that you can remember.

Another effect that should not be underestimated is that the voice commands are executed much faster because dozens of useless devices don’t have to be searched and interpreted.


Hi! I'm Markus – the Fricklr. ⚡ Electrical engineer, 🎵 musician (bass, guitar, keys) and professionally 'something with the internet' 🌐 for over 30 years – nowadays with AI too 🤖 – a 55-year-old generalist from Bavaria, Germany.

Your feedback helps me write even more interesting posts. After "Yes" there's also a small option to support my work.

Explore related topics

Content Map →
Show related content as a list
💡 Drag, hover & click to explore
Bigger dots are more relevant

What do you think? Leave a comment!

Share your thoughts, questions or experiences with the community.

Links marked with this symbol are affiliate links. As an Amazon Associate I earn from qualifying purchases. There are no additional costs for you.