If you want to tame your Alexa using graphical interface and TTS (text to speech) – this video is for you.

In this article I will show you how you can easily interact with the Alexa APIs. We will play a little bit with TTS & SSML. Don’t worry no coding skills are required.

If you don’t want to read then watch the video below!

SSML is a markup language that provides a standard way to mark up text for the generation of synthetic speech. The Alexa Skills Kit supports a subset of the tags defined in the SSML specification.

For example:
You may want a longer pause within the speech, or you may want a string of digits to be read as a standard telephone number or maybe you want to make Alexa to whisper like in the beginning of the video and so on so on.

Requirements:

The things that you need to complete this How-To are:

  1. Working Node-Red installation or Docker client
  2. Alexa device – Link
  3. Comment and share this article in your favourite social media (just kidding)

If you already have working Node-RED you can skip the “Steps with Docker” and go straight to “Steps in Node-RED” header.

Steps with Docker

After successful installation of the Docker client open a terminal/console/command prompt (whatever you like to name it).

To run Node-RED in Docker just type the following and don’t forget the -p 3456:3456 option, because it is very important for the Alexa API authentication:

docker run -it -p 1880:1880 -p 3456:3456 --name mynodered nodered/node-red

After successful execution of the above command you should have something similar in the console.

Successful start of Node-RED within Docker
Successful start of Node-RED within Docker

Now you can open the URL http://127.0.0.1:1880 (or whatever your IP and port is) in a browser. If you see the Node-RED dashboard you can continue happily ahead.

Steps in Node-RED

Open the “Manage palette” from the Node-RED menu in the upper right corner. In “Install” tab search for the following modules/plugins and install them:

  • node-red-dashboard – This module provides a set of nodes in Node-RED to quickly create a live data dashboard. If you wish to learn more, check the GitHub page of the project.
  • node-red-contrib-alexa-remote2 – which is node-red nodes for interacting with Alexa. Again If you wish to learn more, this is the GitHub page of the project.

Go to this page and copy one of the examples let’s say the 1. Alexa Speak Dashboard is a good for a start – link

Import the example using the Node-RED menu by pasting the copied text there and by click on the “import” button.

Import Menu in the Node-RED UI
Import Menu in the Node-RED UI

Double click on the nodes with the red triangle in their upper right corner

Alexa TTS example in Node-RED
Alexa TTS example in Node-RED

Click on the pencil button next to the “Add new alexa-remote-account…” label and…

Be careful here from this configuration more or less depends your success with enabling of the Alexa Text-To-Speach.

Adding new Alexa Account config node
Adding new Alexa Account config node

You want to double check the following things:

This IP field should be the IP where the Node-RED is installed. This maybe is the localhost or maybe it is different IP. If it’s different change it.

The Port should match the port in the Docker command. Remember the “-p 3456:3456” option. Most of the time you shouldn’t have to change this, so you can leave it like that.

File Path is the place where you should type something/anything, meaningful to you like “authFile”. The plugin will create a file with that name and inside the file, it will store your encrypted Amazon credentials. This is needed because otherwise it will ask you to re-login every time you re-deploy your Node-RED flow.

Service Host and Page

Then you want to change Service Host and Page depending of your location and the table below.

Have in mind that there are some cases when everything seems to be OK, there is no errors anywhere, but Alexa don’t want to speak at all. And the reason for this on all of the cases was the Service Host and Page.

Some nice guys from India manage to make this work by typing alexa.amazon.it and amazon.it as their Service Host and Page. And it worked for some reason. So if you face similar issue try change them one by one.

Service Host Page Language
USApitangui.amazon.comamazon.com en-US
UKalexa.amazon.co.ukamazon.co.uk en-UK
GERlayla.amazon.deamazon.de de-DE
ITAalexa.amazon.itamazon.it it-IT
AUSalexa.amazon.com.auamazon.com.au en-US

After you change the above things hit the “Deploy” button and if there is no errors, you should see something similar:

Successfully deployed flow asking to open a new URL
Successfully deployed flow asking to open a new URL

Open a new browser/tab and type the localhost:3456 or Whatever_your_IP_is:3456. Now you should see the amazon alexa sign-in page. And you should enter your Amazon credentials.

After you do that you will see a welcoming green ready under your Alexa nodes like this

green + ready = beautiful
green + ready = beautiful

Testing the Alexa TTS in the Node-RED dashboard

And the final and most fun part is to test our creation. Go to your Node-RED dashboard by either typing the http://localhost:1880/ui or by clicking the following buttons:

Open the Node-RED dashboard from the Node-RED menu
Open the Node-RED dashboard from the Node-RED menu

You should see something like this at the end.

Node-RED Alexa TTS dashboard
Node-RED Alexa TTS dashboard

Click on the blue refresh button and choose your Alexa device. In the text field below enter your text that you want Alexa to speak – like “Subscribe for the Kiril’s newsletter” and press the SPEAK button.

Question of the day

For what do you plan to use Alexa’s text to speech? Let me know your answers in the comments. Also let me know if you have any questions.

I’m really interested about what kind of clever ideas and routines you will create using TTS.

Support my work

Check my other post about Alexa, Node-Red & MQTT on this link

Furthermore feel free to add me on Twitter by search for this username – KPeyanski

I post there pretty much daily.

I really hope that you find this information useful and wish you good luck with your TTS enabled Alexa.

Thank you, stay safe and see you next time.


22 Comments

ravi · 13/02/2020 at 7:44 am

can you visit this link for clearing my doubt as i followed your turorial but having some troble in making alexa speak.
https://github.com/586837r/node-red-contrib-alexa-remote2/issues/55#issuecomment-584789390

    Kiril Peyanski · 13/02/2020 at 7:55 am

    Sure, I will take a look in an hour or so. Thanks for your comment.

    Kiril Peyanski · 13/02/2020 at 11:23 am

    Hey Ravi, check the comments under the video from Achyuth Kassa. He had the same problem and now he found that if he change the configuration to “alexa.amazon.it amazon.it it-IT” everything works fine. Let me know what happened. Good luck.

ravi · 14/02/2020 at 11:23 am

if we want to build speech to text then what we have to do can you help me out. so the requirement is like if we will say anything to alexa (echo dot 3rd generation) then it has to write it in plain text form. can you help me out with this.

James Robinson · 04/03/2020 at 3:27 am

thanks Kiril, you are the man 🙂

    Kiril Peyanski · 04/03/2020 at 9:27 am

    Thanks James, did you manage to run it?

Keith · 29/03/2020 at 2:42 am

I have followed your tutorial and linked my Google login.
However when I try to bring up the Dashboard I am challenged for a password.
My Home Assistant and Node-Red are both running on the following IP 192.168.1.12
When I click on the Dashboard the URL is 192.168.1.12:1880

    Kiril Peyanski · 29/03/2020 at 9:46 am

    Send me some more info like screens of your configuration and the dashboard password dialog that is showing to understand this. You can use my Discord server.

Nigel James · 07/04/2020 at 10:32 am

Great tutorial Kiril! I’ve managed to get it working!
I’m no coder, but I am a magpie that can copy and change bits and learn from there – are you able to point me to any examples (or make a video…..) that would include how to have alexa read some MQTT data?

Volkmar · 22/04/2020 at 2:33 pm

Hello,

I followed your youtube video und have a problem with the first example:

In node-RED everthing looks fine. The credentials working and the green button “success” is below the node “GET ECHO DEVICE” and “Routine Speak”. I can choose my devices in the dashboard and can send some text (ic can see that, because the success button below “Routine Speak” say “sending” and went then back to success. But I can hear nothing and there is no error message in the debug window when I am sending text
Do you konow what the problem could be?

    Kiril Peyanski · 22/04/2020 at 4:03 pm

    Hi Volkmar and welcome. It seems that this is a known problem 🙂 Check carefully the “Service Host and Page” section of the article. In general you have to change Service Host, Page and Language with the correct values for you. There is a table in the article there with all possible values. Try them all one by one, until you make it run. Good luck.

      Volkmar · 23/04/2020 at 1:55 pm

      Thanks a lot Kiril! The german settings for “Service Host and Page” was the right for me – now it works 🙂

      Thank you very much for sharing your knowledge!

Martin · 23/05/2020 at 9:09 pm

My Node-Red runs on the Raspberry with the iP 192.168.1.45
But no matter which path I enter, cookies are not saved. What is your advice?

Sergio · 29/05/2020 at 10:24 am

Hey Kiril really amazing work, thanks a million!! i am trying now to implemented with my Fibaro HC2 to set up a complete alarm and notification center, i struggle a bit at the beginning because of the host and the page, since i am from Spain and my Alexa speaks spanish, for the Spanish community out there, I had to modify to Host: alexa.amazon.es and Page: amazon.es, important not to put the http:// otherwise it will not work.
Now i have a question for you, will it be possible in any way to make alexa reproduce a mp3 tone? i would like to implement it with my door sensors and i want to make a sound everytime the door opens.
Thanks a lot and once again impressive job!!

    Kiril · 29/05/2020 at 1:08 pm

    Hey Sergio,

    check this article https://peyanski.com/alexa-and-home-assistant/ and pay attention on the “Sound Effects” title and this library. You can easily implement the door sound with this functionality.

      Sergio · 02/06/2020 at 11:45 am

      Ok great, i will, thanks!

HoHO · 06/06/2020 at 11:45 am

Hi Kiril, I have a problem, when I set the Italy option, it says ready and when I send TTS from the dashboard it says success, but I can hear nothing.
I tried to change the service host, the page and the language, but the only works is italian, I cannot change. Can you help me

    HoHO · 06/06/2020 at 11:48 am

    Sorry for my bad English, I’m italian, in Italy nobody can speak english

Marcos Medeiros · 06/07/2020 at 12:35 am

Is this authentication mode (proxy) safe? We need to provide Amazon username, password, and authentication token. Can my credentials be used by someone to access my account?

Andreas Posch · 13/07/2020 at 12:01 pm

Great tutorial!
That’s what I am looking for. But I have a problem with the signin-process on amazon. Whenever I open the IP-address and enter my Amazon account info, it says that I have to use a valid e-mail address. But my address is valid – it works on my normal amazon page. Do you have any idea, what could be wrong? I am using the german site. Thank!

Regards,
Andreas

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.