Home Assistant tutorial: your Echo devices as media players

Want your favorite playlist to play when you get home from work? Use Text-to-Speech Markup Language (SSML) so thatAlexa inform you of a leak under your dishwasher? You are on the right page ! Today, we are going to see together how to integrate very easily and in less than 5 minutes your Echo devices fromAmazon on your Home Assistant server.

Integration Alexa Media Player in Home Assistant

Go to the page HACS, then in the tab integrations are looking « Alexa« .

Click on Alexa media Player. This component created by keatontaylor et alandtse allows us to control devices Amazon Alexa from Home Assistant

Once on the integration page (component, whatever the name), all you have to do is click on install to install it. 🙂

The integration is now installed, Home Assistant will offer to restart your server. Just click on Restart Home Wizard in order to finalize the installation ofAlexa media Player

Your server is restarted, perfect! Always on the page HACS but this time in the tab Installed you will find the component Alexa media Player, it is therefore well installed.

Echo devices: configuration Alexa media Player

We are now going to configure this component in Home Assistant, nothing could be simpler, just go to the page Configuration then click integrations

A list of brands and / or devices that can be integrated into Home Assistant appears. As before, with the tutorial of xiaomi gateways we will search for the component that interests us.

Search Alexa, our component will appear as below:

Click on it, then enter your identifiers Amazon

For the region, be sure to inform Amazon. Fr

You can validate by clicking on Submit

Congratulations your connected speakers Amazon Echo are available on your Home Assistant server : ) 

Echo devices: adding maps to Home Assistant

Your devices do not appear on your Home Assistant dashboard? You just have to click on the 3 dots at the top right then on Configure user interface

add a card to the home assistant dashboard

A small + on an orange background appears at the bottom right of your page, click on it to display the different types of cards available

home assistant media player card for Echo devices

Here, for example, we searched for the map Media control which will allow us to control the music of the selected entity

card hassio

Select the entity (device) you want to control with this map, for example, my Echo Show 8.

Validate by clicking on record, your Echo device has now appeared on your dashboards Home Assistant.

Here is an example showing two devices of the range Amazon Echo (here, Echo Show 8 and Echo Dot 3) as well as the different services they offer:

dash board alexa in hassio

Make your Amazon Echo

We will see together how to make our Echo speakers or Echo Show devices talk so that they alert us whena water leak for example !

For that, nothing very complicated, go to the page Configuration then click Automations.

hassio automations

Click on the small + on an orange background at the bottom right of the page to create a new automation. Ignore the first pop-up by clicking on Skip (This first pop-up allows you to create automations by writing a sentence, thank you Almond for this solution, unfortunately only in English for the moment)

first integration home assistant

This page appears, perfect, let's go to automation creation. As above, give a name and a description (optional) to recognize it among all your automations.

For the example no trigger and no condition in order to simplify as much as possible and focus only on the service notify tts

alexa notify home helper echo

In the section Actions select the type of action Call a service then select the service notify.your_echo_device (for example, notify.alexa_media_aurelien_echo_show)

So we call the service notify on an Echo device of our choice, we must now provide it with the data. To do this, copy the following three lines:

data: type: tts message: lesalexiens.fr first French-speaking news site devoted to Alexa and devices Amazon Echo

our data contains two pieces of information:

  • le type : TTS(text-to-speech)
  • le message : Very simple, the message you want (example: The sensor under the dishwasher indicates a water leak)

Save your automation by clicking the small diskette on an orange background at the bottom right of the page

Run our Home Assistant automation

As I told you a little earlier, we have created a very simple automation that only contains one action (the call to our notify service). To test this automation, simply click on Execute next to the name of our automation:

execute hassio automation

Is your Echo device reading your message? Perfect, automation is working 🙂

Important information about the format of TTS messages

Some information should be known in order not to make a mistake when designing a TTS message

  1. Do not put quotes whether double or single quotes. These could conflict with the system code. (See example above, "topicality" replaces "topicality")
  2. As for all lines in YAML the indentation must be respected, for example in our example above, type: tts  is shifted by a tab relative to the data and message lines, this is quite normal 🙂

Congratulation! Electronics Amazon Echo on Home Assistant no longer hold any secrets for you

Do not hesitate to share your dashboard or automations in comments or on the facebook group : )

Several feathers of enthusiastsAlexa to concoct articles with 4 or more hands ... Collaborative writing to address the most specialized or transversal subjects, the best home automation and connected home plans on the web, and much more ...