Alexa TTS (Text-To-Speech) [and more] plug-in for Vera

You’d use everywhere, since all is cycling all the devices, but yes, it works!

2 Likes

Ok i am still not getting this to work on openluup.
It downloads the remot.sh script and .alexa.login.
but if i upload the cookie it deletes it.

where is log in the altui?

I got excited then but I have a Vera Plus not OpenLuup :roll_eyes:

Jq needs to be added by the Vera people?

Damn, just saw this. Another reason to move to OpenLuup perhaps. Another Raspberry Pi in the house! :smiley:
C

Anyone running into this issue, every time I upload the new updated files from GitHub I lose TTS. Ive tried updating the cookie file, inputting a new OTP code and still can’t get TTS to work. Last time I uploaded the new files I had to create a new device to get Alexa to work, anyone recommend anything else?

50 02/22/20 10:14:27.532 luup_log:632: VeraAlexa(executeCommand@235): Response from Alexa.sh: “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.ca 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 /storage/alexa/.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.” <0x70837520>
50 02/22/20 10:14:27.533 luup_log:632: VeraAlexa(sayTTS@275): Executing command [TTS]: “export EMAIL="" && export PASSWORD="***" && export SPEAKVOL=50 && export TTS_LOCALE=en-CA && export LANGUAGE=en-CA && export AMAZON=amazon.ca && export ALEXA=alexa.amazon.ca && export TMP="/storage/alexa" && /storage/alexa/alexa_remote_control_plain.sh -e speak:Hello_from_Vera_Alexa -d "Arman’s Sonos One"” <0x70837520>
50 02/22/20 10:14:27.533 luup_log:632: VeraAlexa(sayTTS@280): Queue will be checked again in 2.302 secs <0x70837520>
50 02/22/20 10:14:27.534 luup_log:0: ALTUI: Evaluation of lua code returned: nil <0x70837520>
50 02/22/20 10:14:29.102 luup_log:632: VeraAlexa(checkQueue@192): checkQueue: 632 - 0 in queue <0x72734520>
50 02/22/20 10:14:29.102 luup_log:632: VeraAlexa(checkQueue@196): checkQueue: 632 - queue is empty <0x72734520>

Yep. I have under a private repo for devs, and it’s working on Vera too. It will be published on 7.32, so it should be soon, maybe weeks.

Things I tried:

  • Male voice mixed with female one
  • TTS in different (or mixed) languages (hooray for my 2nd echoes not supporting Italian)
  • whispered mode, to scare the wife :slight_smile:
  • breaks
  • say-as (for units, numbers, etc)
  • everything else supported by SSML
  • sounds
2 Likes

@therealdb
The otp works fine in vera
but

In openluup it appends the device id and not the otp

Ouch. Let me test it again tomorrow. I should have time to release the new version with sync’ed announcements. If you can, please send some logs via PM.

local password = getVar(MYSID, "Password", "", masterID) .. getVar("OneTimePassCode", "", masterID)

should be.

local password = getVar(MYSID, "Password", "", masterID) .. getVar(MYSID, "OneTimePassCode", "", masterID)

and i believe this should be devNum

initVar(MYSID, "AlexaHost", "pitangui.amazon.com", devNum)
	initVar(MYSID, "AmazonHost", "amazon.com", devNum)

	-- OTP
	initVar(MYSID, "OneTimePassCode", "", masterID)
1 Like

ok i am up and running with VeraAlexa running on debian(android) OpenLuup.

Just let me know what you would like me to test.

edit/
may be add a defaultRepeat value to.

There is an error in latest version should be fixed shortly.

ah, was wondering why there was a 632 (device ID) at the end of my password. Thanks for the heads up.

my bad, I will push it shortly. I’m still jet-lagged after my vacation and I didn’t noticed that. I will also push a new version with announcements running on openluup (plus routines, that are already supported, and a generic way to run any command). Just wait a little bit for it :slight_smile:

1 Like

0.2.5 is on GitHub!

New features:

  • OTP support is fixed
  • auto-update of the bast script on every new version
  • Announcements: set UseAnnoucements to 1 and be sure to enable announcements on your devices (under settings). You can use groups (case sensitive!) to have sync’ed announcements. Rich SSML is supported, see below. New variable DefaultBreak (in seconds) to set the break between messages
  • Commands: any command can be now executed (see below)

Announcements and Commands will run on openluup only. They may be supported on Vera, just try them. Routines are Openluup only at the moment.

A couple of examples:

-- routines luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1", "RunRoutine", {RoutineName="cane", GroupZone="Bedroom"}, 666)

-- any command you want luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1", "RunCommand", {Command="-e weather -d 'Bedroom'"}, 666)

-- sounds - see https://developer.amazon.com/en-US/docs/alexa/custom-skills/ask-soundlibrary.html luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1", "RunCommand", {Command="-e sound:amzn_sfx_trumpet_bugle_04 -d 'Bedroom'"}, 666) -- sounds only work on device, no groups

-- different voices, SSML - see https://developer.amazon.com/en-US/docs/alexa/custom-skills/speech-synthesis-markup-language-ssml-reference.html luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Kendra"><lang xml:lang="en-US">Hello from Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Matthew"><lang xml:lang="en-US">Hello from Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Amy"><lang xml:lang="en-GB">Hello from Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

-- different language
luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1","Say", {Text='<voice name="Carla"><lang xml:lang="it-IT">Ciao da Vera Alexa</lang></voice>', Volume=50, GroupZones="Bedroom", Repeat = 3}, 666)

Enjoy and let me know if you have any problems!

2 Likes

You are a star!

Umm, this announcements thing? Can you give an example? Also, where do we set UseAnnouncements? There appears to be no need to set it in the Vera devices, though (from the docs I’ve found). Am I right?

Cheers!

PS Get over the jet lag first!

C

Thanks, I manage jet-lag very easily, it’s just affecting my ability to write code at late night :slight_smile:

Anyway, to reply to your question:

  • announcements are opt-in and will substitute TTS. If you want to use a group instead of a device, you have to enable them
  • UseAnnouncements is a variable under the device, you’re right.

Announcements seems to be quicker and, as I already said, you have the ability to have sync’ed TTS for a group, instead of cycling every device. I must say it’s very cool.

I will probably explicitly add lastalexa in the next days and then I’ll probably declare this plug-in as stable, just waiting for 7.32 to be released for jq to be officially supported.

Sorry still not with you at all. :(. Maybe I’m jet lagged :slight_smile:
C

ok
say is working
and anouncements.

no luck with routines or commands.
just get
ERROR: No implementation

you have to choose the one using urn:bochicchio-com:serviceId:VeraAlexa1, so just move over the button, you’ll see the serviceID. Choose the correct one and it’ll work.
Oh, and code will be ok as well.

ok all working.
i do not get a hover over on my browser. There were 3 to choose from, it turned out to be the middle one. All working fine.

Is there any way to sart smarthome devices, rather than routines?