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

I have the .sh and a file names .alexa.login. I assume the .alexa.login file is the cookie file. I even noticed that the .sh file has a configuration section at the top so I added my information there as well.
I’m still getting the nil value error. No worries though. I’ll wait a while and try again later. Thanks for the assist.

No need to change the.sh file, the credentials are sent via the plug in. Take a look at the local files and report back. Do not copy the cookie here.

Please add more logs, so I can try to understand what’s going on.

If you have no cookie file (from memory .alexa-cookie) it ain’t gonna work. Might be an MFA issue.

This is what should be in /storage/alexa
.alexa.cookie
.alexa.devicelist.all
.alexa.devicelist.json
.alexa.devicelist.txt
alexa_remote_control_plain.sh

C

exactly. please take a look at .alexa.cookie’s content, because if you have an error inside this find, you’ll find it here. I’ll probably add more checks about this in the future, to better inform the user about problems. right now this is a rough beta, with no frills and mostly devoted to technical people.

2 Likes

This morning I deleted the device, removed the alexa directory and replaced all the files.
I then created a new device with the information given in the README.md and created a scene with the test luup code from the README.md. 280 is my device id.
I then checked the alexa directory and here are the files present:

.alexa.login
alexa_remote_control_plain.sh

luup.call_action(“urn:dlna-org:serviceId:DLNAMediaController1”, “Say”, {Text=“Hello from Vera Alexa”, Volume=50, GroupZones=“Office”}, 280)

When running the scene i tailed the LuaUPnP.log file to a new log so i could see the results.
Here are the results… I have blanked out my username and password.

08 11/20/19 9:13:36.173 Scene::RunScene running 117 testTTS <0x70102520>
35 11/20/19 9:13:36.173 Scene::RunScene 117 testTTS. users=empty allow_evt_get 1, contains lua 1 (nil) (nil) <0x70102520>
35 11/20/19 9:13:36.173 Scene::RunScene 117 testTTS. Calling Lua <0x70102520>
10 11/20/19 9:13:36.174 sbrk JobHandler_LuaUPnP::HandleActionRequest Problem with getnameinfo <0x70102520>
08 11/20/19 9:13:36.174 JobHandler_LuaUPnP::HandleActionRequest device: 280 service: urn:dlna-org:serviceId:DLNAMediaController1 action: Say <0x70102520>
08 11/20/19 9:13:36.174 JobHandler_LuaUPnP::HandleActionRequest argument Text=Hello from Vera Alexa <0x70102520>
08 11/20/19 9:13:36.175 JobHandler_LuaUPnP::HandleActionRequest argument GroupZones=Office <0x70102520>
08 11/20/19 9:13:36.175 JobHandler_LuaUPnP::HandleActionRequest argument Volume=50 <0x70102520>
35 11/20/19 9:13:36.175 JobHandler_LuaUPnP::ConfirmGlobalActionRules start <0x70102520>
50 11/20/19 9:13:36.176 luup_log:280: VeraAlexa: TTS added to queue for 280 <0x70102520>
10 11/20/19 9:13:36.416 GlobalLog: mongoose put_socket: idle: 0 threads: 1 max: 100 s: d:1141 <0x70d4e520>
10 11/20/19 9:13:36.418 GlobalLog: PIDLOG mongoose worker thread s: d:1903486240 <0x7174e520>
10 11/20/19 9:13:36.419 GlobalLog: mongoose get_socket: 0x10286e8 idle: 0 threads: 2 max: 100 head: 11 tail: 10 s: d:1141 <0x7174e520>
10 11/20/19 9:13:36.419 GlobalLog: mongoose get_socket2: 0x10286e8 idle: 0 threads: 2 max: 100 head: 11 tail: 10 s: d:1141 <0x7174e520>
10 11/20/19 9:13:36.420 GlobalLog: mongoose get_socket3: 0x10286e8 idle: 0 threads: 2 max: 100 head: 11 tail: 11 s: d:1141 <0x7174e520>
10 11/20/19 9:13:36.420 GlobalLog: mongoose ctx: 0x10286e8 idle: 0 threads: 2 max: 100 pthread_self: 1903486240 s: d:1141 <0x7174e520>
10 11/20/19 9:13:36.421 mg_callback from IP:127.0.0.1:48414 /port_3480/data_request id=lu_status&DataVersion=259111339&MinimumDelay=1000&Timeout=60&LoadTime=1574259111&rand=0.06873251601757191 start id: 31 <0x7174e520>
12 11/20/19 9:13:36.422 luvd_get_info_data_request starting /data_request?id=lu_status&DataVersion=259111339&MinimumDelay=1000&Timeout=60&LoadTime=1574259111&rand=0.06873251601757191 pMem 0x1bd1000/29167616 diff: 14872576 <0x7174e520>

50 11/20/19 9:13:38.180 luup_log:280: VeraAlexa: Executing command: “export EMAIL="**@gmail.com" && export PASSWORD="" && export SPEAKVOL=50 && export TTS_LOCALE=en-us && export LANGUAGE=en-us && export AMAZON=amazon.com && export ALEXA=pitangui.amazon.com && export TMP="/storage/alexa" && /storage/alexa/alexa_remote_control_plain.sh -e speak:Hello_from_Vera_Alexa -d "Office"” <0x70102520>

25 11/20/19 9:13:38.185 LuaInterface::CallFunction_Scene Scene 117 didn’t return anything <0x70102520>
35 11/20/19 9:13:38.185 Scene::RunScene 117 testTTS. Lua Called <0x70102520>
35 11/20/19 9:13:38.185 Scene::RunScene 117 testTTS. Adding last run to json <0x70102520>
10 11/20/19 9:13:38.186 UserData::DataIsDirty RunScene was 1 incr 1 user data 259111007 variables 259111339 <0x70102520>
10 11/20/19 9:13:38.186 UserData::m_iDataVersion_Variables_incr dirty user data 259111008 variables 259111340 <0x70102520>
35 11/20/19 9:13:38.186 Scene::RunScene 117 testTTS. Returning <0x70102520>

If you haven’t got the cookie, it won’t work.

What is the content of .alexa.login?

C

I wonder why it doesn’t generate the cookie. The content of the .alexa.login looks like a html file.

Hmmm
Going back a stage or two. How did you get the files from Github?

Best guess is that’s it’s not generating the cookie as there’s something wrong with your settings or the authentication. It took me a while when I set it up on another machine, but when I got the right files (see above question) it worked pretty much out the box…

C

I wish mine had worked right away LOL.
To get the files, i backed up a directory on Github and downloaded the entire zip file with the http switch and everything included. after unzipping i grabbed the files from the VeraAlexa directory not including the README.md and uploaded to my controller.

1 Like

i just checked my firmware version and it appears there is an update.
|Running Version|1.7.4454|
|Latest Version|1.7.4834|

Maybe that has something to do with it?

OK sounds like you have the right files (I screwed it up)
It’s not the firmware.

Can you share what’s in the login file?

C

I’ve had a quick scan. Looks like you’re getting a captcha challenge.

You’ll have to look at the original posts to see how to get round it, if I’m correct :frowning:
C

I was afraid that may be the case. Thanks for looking. I’ll attempt to get around it and try again later. Hopefully this will be something that can be avoided in future versions. (Unfortunately probably not since it’s an amazon thing.) Thanks again.

No worries. There are workarounds but I didn’t have to look at them

C

Sigh yeah I was really excited about this one because I have waited a long time to get this functionality.
I turned on the MFA for Amazon and added an authenticator app using oathtool and then realized after reading the .sh file again that I may have to install oathtool on the controller itself. I’m not sure if it is supported by the OpenWrt that is running on it so I think this is a good place for me to stop before bricking my controller. This may be something to investigate if you plan to further develop for less technical users. Now I have to figure out how to sleep knowing that. is was so close. LOL

Thanks for all the help,
R

That’d be it :frowning:

Shame it’s not exactly reliable.
I appear to be getting cookie expiration issues as well :frowning:
C

If you have a Linux box, you can move it there and call it from openluup.

Cookie should be automagically renewed. If not, just set “Configured” to 0, it should do it. I will try to make it more robust, but unfortunately we depend upon Amazon’s cloud and this is a bit hacky at the moment.

Hmm, OK to be clear I had a cookie failure on my OS X box.

On the Vera I just get nothing right now.

Log entry:
01 11/21/19 9:10:15.101 LuaInterface::CallFunction_Timer-5 function checkQueue failed [string “module(“L_VeraAlexa1”, package.seeall)…”]:278: bad argument #1 to ‘remove’ (table expected, got nil) <0x73af6520>

Which means nothing to me (oh Vienna!)

C

a new minor version is on github. It will address this problem. Try it and let me know.

1 Like