Page 3 of 8
Re: Alexa text to speech
Posted: Sunday 12 August 2018 20:21
by Hesmink
Jzjr wrote: ↑Sunday 12 August 2018 19:29
I can get it working with tts if I choose an individual device but not if I choose everywhere?
Has anyone got it working with the everywhere device?
Thanks
Fred
If I do:
./alexa_remote.sh -d ALL -e speak:'Hello!'
I will have all my dots say 'Hello!'
Re: Alexa text to speech
Posted: Sunday 12 August 2018 23:26
by renerene
Ok,
Got it working.
please note; the device is on the Amazon.de device. I'm in the Netherlands, my Dot speaks English. The cookie was received using the Rpi VNC terminal within Chromium, after logging in to the German site. This is in my .sh file:
Code: Select all
#LANGUAGE="de-DE"
LANGUAGE="en-US"
#AMAZON='amazon.de'
#AMAZON='amazon.com'
AMAZON='amazon.co.uk'
ALEXA='alexa.amazon.co.uk'
#ALEXA='layla.amazon.de'
#ALEXA='pitangui.amazon.com'
Complete procedure:
1) Install jq from
https://stedolan.github.io/jq/download/ by using command sudo apt-get install jq
2) Download script from
https://loetzimmer.de/patches/alexa_remote_control.sh (via blog
https://blog.loetzimmer.de/2017/10/amaz ... -echo.html) and placed it in /home/pi/domoticz/scripts/
3) Set permissions on the script to 777
4) (sudo chmod 777 /tmp/.alexa.login) ?neccessary? was not needed second time
5) (found the Dot on the german Amazon Site, my devices ) ? don't know if it matters, see note above
6) switch off 2-way authentication on Amazon
7) login to Rpi desktop, using VNC viewer. For me, I had to completely re-install, from RASPBIAN STRETCH LITE to RASPBIAN STRETCH WITH DESKTOP, because I could not get the desktop going from stretch lite
8)
add this extension to Chromium https://chrome.google.com/webstore/deta ... coicjekelh
Then goto https://alexa.amazon.com/, login to amazon, and run the extension.
Paste the text into /tmp/.alexa.cookie and you've bypassed captcha's and possibly 2fa.
more info:
https://github.com/thorsten-gehrig/alex ... /issues/10
9) test the script;
/home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:'hello, this is perfect'
Re: Alexa text to speech
Posted: Sunday 12 August 2018 23:32
by renerene
and now, for this amateur, how can I send a string to Alexa with this setup/script, using dzVents?
build a URL like this in dzVents?
script:///home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:'#MESSAGE'
Re: Alexa text to speech
Posted: Monday 13 August 2018 13:42
by freijn
renerene wrote: ↑Sunday 12 August 2018 23:26
Ok,
Got it working.
please note; the device is on the Amazon.de device. I'm in the Netherlands, my Dot speaks English. The cookie was received using the Rpi VNC terminal within Chromium, after logging in to the German site. This is in my .sh file:
Code: Select all
#LANGUAGE="de-DE"
LANGUAGE="en-US"
#AMAZON='amazon.de'
#AMAZON='amazon.com'
AMAZON='amazon.co.uk'
ALEXA='alexa.amazon.co.uk'
#ALEXA='layla.amazon.de'
#ALEXA='pitangui.amazon.com'
Rene
I am confused.. Your dot is registerd to amazon.de ???
In the script definitions I do see UK refer ?
The thing which annoy me is that I have lost all my US skills and can only use german skills now #$%#$%@$@#$$
Can you use US skills now? and still have Alexa talking to you by using the script ?
Cheers,
Frank
Re: Alexa text to speech
Posted: Monday 13 August 2018 14:53
by heggink
Same here. I switched to the German instance as well but needed to use the uk servers in the script. Dot also speaks British although I cannot install any skills unless I first switch to German, install German skills and then change back to English-uk. Really weird but at least I can use controlicz and let alexa speak...
Re: Alexa text to speech
Posted: Monday 13 August 2018 14:56
by freijn
heggink wrote: ↑Monday 13 August 2018 14:53
Really weird but at least I can use controlicz and let alexa speak...
Same here......Lost all skills, but still a happy user because of this new toy !!

Re: Alexa text to speech
Posted: Wednesday 15 August 2018 7:54
by quack3d
I'm trying to get this to work in Windows. I've downloaded the version of the script without jq and try to run it with win-bash. First I modified the script and put in email, password, changed language to en-US, amazon.com and pitangui.amazon.com, and changed curl path to be just 'curl'. I also changed paths to cookie, devlist and devtxt since Windows dont use /tmp/... .
But, when I try to run it it says 'cookie does not exist. logging in ... ERROR: Amazon Login was unsuccessful. Possibly you get a captcha...'
So I tried using an extension like suggested above. The suggested one can't be installed anymore, so I used this:
https://chrome.google.com/webstore/deta ... nbfjonfjfg . But the the script just says "cookie expired, logging in again ... ERROR: Amazon Login was unsuccessful...".
Any ideas?
Re: Alexa text to speech
Posted: Thursday 16 August 2018 8:23
by quack3d
Not possible without "moving" the Dot to .de perhaps? Don't wanna do that.

Re: Alexa text to speech
Posted: Thursday 16 August 2018 10:22
by freijn
Quack
it started working for me when I moved the dot to .de immediately.
Alexa still speaks UK-English , it does keep my real home address and weather is local still but.........
I have lost all my "toy" skills. (good weather, news and games and find my phone) however,
Controlicz is fortunately still working and available in the .de store.
If you got it to work from the .com USA link, I would be VERY interested ! and you would be my Hero !
I have asked the same question to the german guy as well, awaiting the answer....
Frank
Re: Alexa text to speech
Posted: Tuesday 04 September 2018 18:12
by Boredcat
Got it working. Yes !!
and my Echo Dot is registered in THE US
I used the ReneRene method where I ofcourse used the US servers of Amazon. Altough I didn't did step 6 had no how to disable 2 way auth on amazon.
I used RASPBIAN STRETCH WITH DESKTOP , I think this did the trick of getting the correct cookie file and bypassing the captcha,
Next step is integrate the script into some Domoticz events
Hopes it keeps working.
Re: Alexa text to speech
Posted: Tuesday 04 September 2018 18:52
by quack3d
It's also supposed to work if you use the cookies.txt extension in Firefox (not in Chrome).
Re: Alexa text to speech
Posted: Tuesday 04 September 2018 22:07
by sijones
Ok, if you're having capture issues, install authenticator (Google app) on your phone, turn on 2 factor authentication on your amazon account and set it up following the information given by the page.
Once it's setup, in the password field put your password followed by the 6 digit code with no space, so the script will be:
PASSWORD='PASSWORD433588'
Then run ./alexa_remote_control.sh -a
This will then login and give you the cookie without a capture, you then set the PASSWORD= to just your password.
It's a good idea to leave 2 factor authentication on so no one can take control of your account even if they know your password.
Re: Alexa text to speech
Posted: Tuesday 04 September 2018 22:08
by sijones
The passcodes time out, so wait for the app to change to a new one before editing the file, this gives you chance to edit, save and then run.
Re: Alexa text to speech
Posted: Wednesday 05 September 2018 10:03
by Prutsium
Hmmmmmz got it partly working with grabbing the cookie but got no text.
With -a i get nicely a list of all my devices but i wont get any speech output.
Code: Select all
./alexa_talk.sh -d Kitchen -e speak:'Test'
sending cmd:speak:Test to dev:Kitchen type:******** serial:******* customerid:**********
Sequence command: Alexa.Speak
HTTP/1.1 0 x-amzn-RequestId: d3211204-b0e1-11e8-9cdc-7f035b0ba494
Access-Control-Allow-Origin: https://alexa.amazon.de
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: Wed, 05 Sep 2018 08:00:59 GMT
Connection: close
Alexa text to speech
Posted: Wednesday 05 September 2018 11:35
by philchillbill
Got it ! And all with UK settings.
I had it all working a few weeks ago with everything setup for UK amazon (so no switch to DE needed) as a test and recently when I went to actually start using it things had suddenly stopped working, with the dreaded cookie/captcha warning showing. I have the script running on an Intel NUC under Ubuntu. I tried using the chrome cookie-saver extension to create a cookie on a windows machine and paste the contents into /tmp/.alexa.cookie on the NUC, but no joy. Also no joy with the cookies.txt extension in Firefox on the PC. Message was now about expired cookie instead of no cookie. Damn.
However, when I ran Firefox on the NUC itself natively (it opens a window on my PC via SmarTTY even though I login via SSH to the NUC) and used the cookie.txt plugin from there, renaming the file thus saved in my home directory on the NUC to /tmp/alexa.cookie got it all working again. WIth everything on UK and no DE linkage in sight. Didn't know cookie files were linked to the local machine in some way, but there you go.
Re: Alexa text to speech
Posted: Wednesday 05 September 2018 12:36
by freijn
Phil
You make me jealous

Can you please share the config parts of the script?
Alexa is behaving perfectly on Domoticz events here but......registered to the DE.
Would love to have my Alexa in US again.....
Thanks Frank
Re: Alexa text to speech
Posted: Wednesday 05 September 2018 15:05
by philchillbill
Frank,
I just use the well-known
Code: Select all
LANGUAGE="en-US"
AMAZON='amazon.co.uk'
ALEXA='alexa.amazon.co.uk'
The rocket science is not in those settings but in using the cookies.txt plugin to create the cookie in Firefox run locally on the same machine as the script. As mentioned, running Firefox on a different machine and capturing that cookie didn't work for me.
Re: Alexa text to speech
Posted: Wednesday 05 September 2018 15:56
by heggink
So a headless system will not work

Re: Alexa text to speech
Posted: Wednesday 05 September 2018 16:31
by philchillbill
Yes it will. My NUC is headless. I use SmarTTY to login to it with ssh and key-based login. In the terminal window I type ‘firefox’ and it launches in some kind of x-terminal on the PC I’m logging in from. After saving the cookie file I open a second SmarTTY login to the NUC and rename the cookie file to /tmp/.alexa.cookie and then kill Firefox in the first SmarTTY session with ctrl-c. Voila.
Sent from my iPhone using Tapatalk
Re: Alexa text to speech
Posted: Wednesday 05 September 2018 16:56
by heggink
Ah, brill! Thx!