Alexa text to speech Topic is solved

Alexa, Google Home and Siri

Moderator: leecollings

Hesmink
Posts: 168
Joined: Monday 22 June 2015 10:48
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: The Netherlands
Contact:

Re: Alexa text to speech

Post 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!'
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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'
renerene
Posts: 316
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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'
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Alexa text to speech

Post 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
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Alexa text to speech

Post 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...
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Alexa text to speech

Post 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 !! :-)
quack3d
Posts: 86
Joined: Sunday 26 March 2017 17:03
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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?
quack3d
Posts: 86
Joined: Sunday 26 March 2017 17:03
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

Post by quack3d »

Not possible without "moving" the Dot to .de perhaps? Don't wanna do that. :P
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Alexa text to speech

Post 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
Boredcat
Posts: 38
Joined: Friday 17 March 2017 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9639
Location: Netherlands
Contact:

Re: Alexa text to speech

Post 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.
RFXCom(E) - Yeelight Lights - KaKu / Alexa HA Bridge
Windows 2012 / Windows 2012R2 / Xpenology/ Pi 3 / Milight / Home build ESP8266 / Sonoff
quack3d
Posts: 86
Joined: Sunday 26 March 2017 17:03
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

Post by quack3d »

It's also supposed to work if you use the cookies.txt extension in Firefox (not in Chrome).
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Alexa text to speech

Post 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.
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Alexa text to speech

Post 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.
Prutsium
Posts: 92
Joined: Monday 18 June 2018 11:31
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Germany / Netherlands
Contact:

Re: Alexa text to speech

Post 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

User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Alexa text to speech

Post 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.
Last edited by philchillbill on Wednesday 05 September 2018 11:35, edited 1 time in total.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
freijn
Posts: 536
Joined: Friday 23 December 2016 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands Purmerend
Contact:

Re: Alexa text to speech

Post 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
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexa text to speech

Post 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.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Alexa text to speech

Post by heggink »

So a headless system will not work
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
philchillbill
Posts: 396
Joined: Monday 12 September 2016 13:47
Target OS: Linux
Domoticz version: beta
Location: Eindhoven. NL
Contact:

Re: Alexa text to speech

Post 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
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Alexa text to speech

Post by heggink »

Ah, brill! Thx!
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest