Page 7 of 8

Re: Alexa text to speech

Posted: Saturday 23 May 2020 8:40
by renerene
Gave up two years ago: not reliable, cookies issue, lots of trail and error when installing: what account, what language... Been using Jarvis on my wall tablet as alternative.

Before I drive into Alexa speak again; What is the status nowadays?

Re: Alexa text to speech

Posted: Saturday 23 May 2020 8:55
by sammyke007
Has been working 3 months without MFA, but then one day I got a captcha after expired cookies.
Setup MFA and it works very fine since then over here!

Re: Alexa text to speech

Posted: Saturday 23 May 2020 10:06
by freijn
Google works perfectly for me. for months now and no cookies monster.

Re: Alexa text to speech

Posted: Sunday 24 May 2020 9:58
by renerene
ok, got it running again, this time with MFA. Good to have voice on Alexa again.

Questions
1) how does the volume parameter work?
2) in Dzvents the following line is used:

Code: Select all

os.execute ("/home/pi/domoticz/scripts/alexa_remote_control.sh -d ALL -e speak:'"..message.."'")
However, when adding another line, only the last line is executed; the kitchen device is silent:

Code: Select all

os.execute ("/home/pi/domoticz/scripts/alexa_remote_control.sh -d Kitchen -e speak:'"..message.."'")
os.execute ("/home/pi/domoticz/scripts/alexa_remote_control.sh -d Bathroom -e speak:'"..message.."'")

Re: Alexa text to speech

Posted: Thursday 28 May 2020 20:33
by renerene
It seems that Alexa is missing messages because of some sort of sleep mode. It starts with the second attempt, when calling the script after an hour or so.

SOLVED Re: Alexa text to speech

Posted: Saturday 11 July 2020 22:24
by Opus
If I start the script ./alexa_remote_control.sh -ALL speak:'MESSAGE' an error occurs:
bash: ./alexa_remote_control.sh: /bin/sh^M: Defekter Interpreter: Datei oder Verzeichnis nicht gefunden

jq and oathtools are installed. The scripts looks fine.
Any hints?

UTF-8 was the solution...

Re: Alexa text to speech

Posted: Tuesday 25 August 2020 15:11
by renerene
all of a sudden Alexa is silent. MFA was working since May, but now this error:

Code: Select all

Try logging in to https://alexa.amazon.de with your browser. In your browser
 make sure to have all Amazon related cookies deleted and Javascript disabled!

 (For more information have a look at /tmp/.alexa.login)

 To avoid issues with captcha, try using Multi-Factor Authentication.
 To do so, first set up Two-Step Verification on your Amazon account, then
 configure this script (or the environment) with your MFA secret.
 Support for Multi-Factor Authentication requires 'oathtool' to be installed.

Re: Alexa text to speech

Posted: Tuesday 25 August 2020 23:39
by philchillbill
Me too. Refreshing the cookie does not help

Re: Alexa text to speech

Posted: Wednesday 26 August 2020 9:53
by sammyke007
Tested, still working fine here using MFA.

Re: Alexa text to speech

Posted: Wednesday 26 August 2020 23:54
by philchillbill
I fixed mine by changing my store from .de to .co.uk. No idea why it even worked with .de because my account is indeed .co.uk. And .de worked for a few months with MFA. Anyway, solved.

Re: Alexa text to speech

Posted: Thursday 27 August 2020 12:34
by sammyke007
That might be a possible solution as my Alexa account is indeed an .co.uk account

Re: Alexa text to speech

Posted: Saturday 29 August 2020 14:53
by vengeance
I can't get Alexa to speak on my Sonos Beam from my Raspberry Pi. alexa_remote_control.sh -a gives me the correct devices back, and when I do a

Code: Select all

sudo /home/pi/domoticz/scripts/alexa_remote_control.sh -e goodmorning -d 'Sonos Beam' 
she also says the correct things as if you would say 'goodmorning' to it.

My account is an Amazon.com account and my settings:

Code: Select all

SET_MFA_SECRET='<52 character from https://www.amazon.com/a/settings/approval>'

SET_LANGUAGE='en-US'

SET_TTS_LOCALE='en-US'

SET_AMAZON='amazon.com'

SET_ALEXA='alexa.amazon.com'
When I try to use the speak command (so no error):

Code: Select all

pi@raspberrypi:~ $ sudo /home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:'Why am I not talking' -d 'Sonos Beam'
sending cmd:speak:Why am I not talking to dev:Sonos Beam type:A3NPD82ABCPIDP serial:<myserial> customerid:<mycustomeridhere>
Any suggestions to get it working?

EDIT: I'm afraid this script will not work with Sonos. Some speech and things like routines are not possible on certain (or most?) third party devices. I guess I'll try to achieve the same goal another way.

Re: Alexa text to speech

Posted: Sunday 30 August 2020 8:19
by renerene
Is amazon messing with devices currently?
Has been working for months with MFA. I'm In the Netherlands and got my devices on Amazon.de, language = EN

My settings in alexa_remote_control.sh:

Code: Select all

SET_LANGUAGE='en-UK'
SET_TTS_LOCALE='de-DE'
SET_AMAZON='amazon.de'
SET_ALEXA='alexa.amazon.de'
Error after: /home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:'MESSAGE'

Code: Select all

cookie does not exist. logging in ...
ERROR: Amazon Login was unsuccessful. Possibly you get a captcha login screen.
 Try logging in to https://alexa.amazon.de with your browser. In your browser
 make sure to have all Amazon related cookies deleted and Javascript disabled!
1) Is anybody else having the same issues?
2) if i remember correctly the cookie and login error have been always there, even when things were working correctly. That would make it harder to debug. Can somebody with working Alexa report his/her feedback here from /home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:'MESSAGE'

Re: Alexa text to speech

Posted: Sunday 30 August 2020 8:29
by renerene
Update: problem gone of previous post
1) doing a sudo version got me a good login with sudo /home/pi/domoticz/scripts/alexa_remote_control.sh -e goodmorning -d 'kitchen'
2) got the wrong device name set, renamed it on amazon.de and did a Rpi reboot

To answer my own question 2): there is no login error message

Code: Select all

pi@raspberrypi:~ $ sudo /home/pi/domoticz/scripts/alexa_remote_control.sh -e speak:'MESSAGE' -d kitchen
sending cmd:speak:MESSAGE to dev:kitchen type:AB72C64C86AW2 serial:90F007187016046L customerid:A77JZ2BCLO7CQ

Re: Alexa text to speech

Posted: Wednesday 16 December 2020 1:09
by SnakeBonD
I love whispered effect :
Switch light ON

Code: Select all

script:///home/pi/domoticz/scripts/alexa/alexa_remote_control.sh -d "Echo Office" -e speak:'<speak><amazon:effect name="whispered">Light switch ON !</amazon:effect></speak>'
Switch light OFF

Code: Select all

script:///home/pi/domoticz/scripts/alexa/alexa_remote_control.sh -d "Echo Office" -e speak:'<speak><amazon:effect name="whispered">Light switch OFF !</amazon:effect></speak>'

Re: Alexa text to speech/Alexa started announcing “underscore” for every space

Posted: Saturday 16 January 2021 14:43
by KatMan57
Thank you all for your great contributions to this capability.

A very simple guide to setting TTS for Alexa can be found here https://www.machinon.com/post/autonomous-tts-with-alexa

Once setup I then ran into a problem of Alex converting spaces to underscore (for alexa.amazon.co.uk) e.g. "Hellounderscorethisunderscore..." The fix (for the moment) is to insert a hyphen between each word e.g. ./alexa_tts.sh -d Kitchen -e speak:'Hello-I-can-talk-now'. (link https://forums.homeseer.com/forum/homes ... tant/page7)

Re: Alexa text to speech

Posted: Friday 29 January 2021 21:07
by garethiowc
This works great.

can you combine a speak and sound effect command?

this did not work > ./Alexa_tts.sh -e sound:amzn_sfx_trumpet_bugle_04, speak:'hello', -d 'Kitchen echo'

Re: Alexa text to speech

Posted: Sunday 07 March 2021 14:41
by poweredge
philchillbill wrote: Wednesday 26 August 2020 23:54 I fixed mine by changing my store from .de to .co.uk. No idea why it even worked with .de because my account is indeed .co.uk. And .de worked for a few months with MFA. Anyway, solved.
how did you do that ? im from NL as well - and have an international amazon account but i keep gettting failed MFA logins (mfa activated oathtool works etc)

Re: Alexa text to speech

Posted: Sunday 07 March 2021 18:58
by philchillbill
poweredge wrote: Sunday 07 March 2021 14:41 how did you do that ? im from NL as well - and have an international amazon account but i keep gettting failed MFA logins (mfa activated oathtool works etc)
In the script towards the beginning:

SET_AMAZON='amazon.co.uk'
SET_ALEXA='alexa.amazon.co.uk'

Re: Alexa text to speech

Posted: Monday 08 March 2021 9:07
by poweredge
philchillbill wrote: Sunday 07 March 2021 18:58
poweredge wrote: Sunday 07 March 2021 14:41 how did you do that ? im from NL as well - and have an international amazon account but i keep gettting failed MFA logins (mfa activated oathtool works etc)
In the script towards the beginning:

SET_AMAZON='amazon.co.uk'
SET_ALEXA='alexa.amazon.co.uk'
thanks - tried it but no luck... did you login on the DM machine prior with browser so it recognizes your instance? i still get the captcha and MFA etc.