Alexa Announce Feature - Text to Speach via Alexa now a possability?

I get the same error as you now. Do I have to create a separate folder called tmp?

/tmp folder should already be there in the root directory.

did you chmod +x the scripts?

1 Like

Hi all,
I am having the same login issue others are having (cookies and captcha).
I have HA running on an old Ubuntu Linux machine, but I use Chrome on Windows
(and the cookie extension) to download the cookies.txt file and ssh/samba between windows and Ubuntu.
When I run ./alexa_remote_control.sh -a I now get a “cookie expired” and the login fails again.

I’ve double-checked the script and it has the correct email and password that I use
to log into Amazon Alexa.

I’m running the script https://github.com/walthowd/ha-alexa-tts/blob/master/alexa_remote_control.sh
which appears to have U.S. settings (which is where I am from).

Any suggestions? (are cookies tied to the machine?)

I had quite a few issues getting mine going… they pretty much all seemed to be resolved by making homeassistant the owner of all the referenced files… I used Firefox on my Ubuntu machine with the cookies.txt extension and saved that as .alexa.cookie and also didn’t realize it but once it works the Alexa.login file turns into an html file which you can click in and login directly to amazon there… all was good at that point… so to answer your question I would suggest you do the cookies.txt thing directly on your homeassistant machine as the cookie is going to have OS and machine identifiers that may not transfer properly…

Solved!!! Alexa Announce Feature - Text to Speach via Alexa now a possability?
Running Firefox and its cookie extension on the same machine as HA solved this problem.

Thanks,

1 Like

the cookie file in tmp folder keep deleting itself automatically. It there a way to keep the cookie permanent? Or read the cookie from somewhere else that will not delete.

1 Like

I have the same issue as you @Sunonline. Did you find a solution? I am running my HA on raspberry pi.

delete the old /tmp/.alexa.login
save the cookie in your /home/user folder then
sudo cp /home/user/cookie.txt /tmp/.alexa.cookie
sudo chmod 777 /tmp/.alexa.cookie
then run the remote script.

1 Like

I’ve tried downloading the cookie.txt file and rename to .alexa.cookie and I get the below error message. My HASS instance is on a Synology NAS, I don’t think I can download the cookies file from the same machine.

Not sure what else I can do.

Edit: was able to use cookie from a different computer but just changed permisions for cookies file to 0777 and was able to get the list of devices. On to the next error.

image

Trying to get this set up but not having any luck :frowning: Getting the following response when running the command (which makes it look like its working, but the Echo’s aren’t saying anything. Any suggestions?

hass@raspberrypi:~$ ./alexa_remote_control.sh -d "Living Room Echo" -e weather
sending cmd:weather to dev:Living Room Echo type:A3S5BH2HU6VAYF serial:<redacted> customerid:<redacted> 
Sequence command: Alexa.Weather.Play
HTTP/1.1 0 x-amzn-RequestId: 66581e18-799c-11e8-abd0-87414a976996
Access-Control-Allow-Origin: https://alexa.amazon.com
Content-Encoding: deflate
Vary: Origin
Access-Control-Expose-Headers: x-amzn-dat-gui-client-upgrade,X-Amzn-Error,loginUrl,X-Amzn-RequestId,x-amzn-alt-domain,Date,Location
Access-Control-Allow-Credentials: true
Date: Tue, 26 Jun 2018 23:55:27 GMT
Connection: close

I can run commands to query information and it reports the correct info back so I don’t think its an auth issue.

I was able to get past my errors and now i’m running into the same issue.

Thank you very much. I will try again tonight.

By the way. I have back up the alexa.cookie / can I have the same tmp folder in homeassistant user folder instead.

The actual tmp file that alexa call for alexa.cookie is in pi user which I would like to put in homeassistant user folder and be call from homeassistant tmp folder.

sudo cp /home/homeassistant/.homeassistant/tmp/.alexa.cookie
sudo chmod 777 /tmp/.alexa.cookie

Also I use ssh under pi user not homeassistant user / to be able to save alexa.cookie do I have to change to homeassistant user first before do the sudo cp above?

Hi all

I’m trying to use this script (fantastic!), but even if I don’t get, apparently, any errors, no voice come from Echo.

Here is my config

EMAIL='amazon_email'
PASSWORD='amazon_pwd'

#LANGUAGE="de-DE"
LANGUAGE="it-IT"

#AMAZON='amazon.de'
AMAZON='amazon.it'

#ALEXA='layla.amazon.de'
ALEXA='alexa.amazon.it'

# cURL binary
CURL='/usr/bin/curl'

when I launch this command

./alexa_remote_control.sh -d 'Echo di Vittorio' -e speak:'Questo è un test'

I get this

cookie expired, logging in again ...
device list does not exist. downloading ...
sending cmd:speak:Questo è un test to dev:Echo di Vittorio type:<redacted> serial:<redacted> customerid:<redacted>
Sequence command: Alexa.Speak

but no sound

I tried also to get from the extension cookies.txt the cookie from the page https://alexa.amazon.it/spa/index.html#cards and save it as /tmp/.alexa.cookie but nothing changed

Any suggestion?

Thanks

thanks @juan11perez

I am still getting the same issues. I was wondering I might be making a mistake with the link under “ALEXA” does it have to be ALEXA=‘pitangui.amazon.com’ or my location i.e. UK? so ALEXA=‘alexa.amazon.co.uk’ ?

when I click into the html file i get an error on amazon’s website saying “we are sorry. the web address you entered is not a functioning page on our site.”

I understand you’re running on a synology?
are you running HA docker?
If yes are you using this alexa_remote_control.sh or alexa_remote_control_plain.sh

if using without “plain” you need to install jq. have a look at my note before.

@Sunonline the cookie has to go into whatever directory the .alexa.login file is being created.
In my case since Im running the script from the base op system, the .alexa.login file is created in /tmp

If pi is the user running the script, that’s what you need to use.

that should be the webaddress where you can login to your online webapp.
so if you use alexa.amazon.co.uk to change your settings, then you should use that.

1 Like

Thank you very much. I have tested. Normally when login via ssh. The default user is pi then I run the command.

The .alexa.login kept in root/tmp not home/pi/tmp and keep delete itself when reboot.
Both alexa.cookie and devicelist got deleted.

So now the easiest way that work for me after do the sudo cp and also sudo chmod 777, it still delete the file.

" I have edit in the alexa_remote_control.sh"
Line 76 and 77

###########################################
# nothing to configure below here
#
TMP="/tmp"
COOKIE="/home/homeassistant/.homeassistant/tmp/.alexa.cookie"  <= change to the location where the file is
DEVLIST="/home/homeassistant/.homeassistant/tmp/.alexa.devicelist.json"   <= change to the location where the file is