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« .
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
Search Alexa, our component will appear as below:
Click on it, then enter your identifiers Amazon
You can validate by clicking on Submit
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
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
Here, for example, we searched for the map Media control which will allow us to control the music of the selected entity
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:
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.
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)
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.
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 perform next to the name of our 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
- Do not put quotes whether double or single quotes. These could conflict with the system code. (See example above, "topicality" replaces "topicality")
- 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 🙂
Do not hesitate to share your dashboard or automations in comments or on the facebook group : )