Alexa text to speech Topic is solved

Alexa, Google Home and Siri

Moderator: leecollings

renerene
Posts: 350
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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?
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: Alexa text to speech

Post 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!
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 »

Google works perfectly for me. for months now and no cookies monster.
renerene
Posts: 350
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

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

Re: Alexa text to speech

Post 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.
Opus
Posts: 21
Joined: Monday 05 October 2015 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

SOLVED Re: Alexa text to speech

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

Re: Alexa text to speech

Post 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.
User avatar
philchillbill
Posts: 399
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 »

Me too. Refreshing the cookie does not help
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: Alexa text to speech

Post by sammyke007 »

Tested, still working fine here using MFA.
User avatar
philchillbill
Posts: 399
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 »

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.
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: Alexa text to speech

Post by sammyke007 »

That might be a possible solution as my Alexa account is indeed an .co.uk account
vengeance
Posts: 1
Joined: Saturday 29 August 2020 14:36
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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.
Last edited by vengeance on Monday 31 August 2020 20:47, edited 2 times in total.
renerene
Posts: 350
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: Alexa text to speech

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

Re: Alexa text to speech

Post 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
SnakeBonD
Posts: 1
Joined: Sunday 25 October 2020 2:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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>'
KatMan57
Posts: 1
Joined: Sunday 11 August 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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)
garethiowc
Posts: 28
Joined: Sunday 03 December 2017 23:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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'
poweredge
Posts: 21
Joined: Thursday 05 July 2018 13:54
Target OS: Linux
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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)
DM2021.1 (pri+sec) VM/RPI4. Dashticz @touchscreen. IT: Dell ESXi cluster, UPS, fiber+4g WAN. Smart: Aeotec/Neo/Qubino/Eurotronic zwave, Philips Hue, P1, rfxom433, OTGW, ITHO WiFi, Shelly shutter/water sens, NEST v3, 9x Alexa
User avatar
philchillbill
Posts: 399
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 »

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'
Alexa skills author: EvoControl, Statereport, MediaServer, LMS-lite
poweredge
Posts: 21
Joined: Thursday 05 July 2018 13:54
Target OS: Linux
Domoticz version:
Contact:

Re: Alexa text to speech

Post 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.
DM2021.1 (pri+sec) VM/RPI4. Dashticz @touchscreen. IT: Dell ESXi cluster, UPS, fiber+4g WAN. Smart: Aeotec/Neo/Qubino/Eurotronic zwave, Philips Hue, P1, rfxom433, OTGW, ITHO WiFi, Shelly shutter/water sens, NEST v3, 9x Alexa
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest