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

yep, I usually compose TTS dinamically.

local lastTrip = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "LastTrip", sensorID) or os.time()
local minutes = round((os.time() - lastTrip) / 60)

luup.call_action("urn:dlna-org:serviceId:DLNAMediaController1", "Say", {Text="Front door was opened " .. minutes .. " ago"}, 666)

This is used to notify about entry left open. I have a scheduled scene running every 5 minutes and checking for doors being opened more than 5 minutes ago, and reporting back with a message.

I’m not familiar with iPhone Locator plugin, but look at the variables and report back, we can build it together.

1 Like

Wow super
Trial and error :slight_smile:
Sorted! Thanks so much!
C

I am struggling with this though:

local ETA = round(ETASeconds / 60)

Trying (natch) to get minutes as opposed to seconds and a sensible number of decimals.

local ETA = (ETASeconds / 60)

Works fine?

Can’t see what I’m doing wrong here.

TIA

C

OK I think I got it. You’ve defined your own round function?

I’m using math.ceil which works perfectly!

C

1 Like

Yes, your solution will be ok as well.

1 Like

Working perfectly. I screwed up some stuff but managed to claw my way from the mire. The last bit was that round function. Too cool!

C

This sounds really cool. When I get some spare time I’ll have to install and give it a go.

It is. Very much. The delay can be disconcerting, you can’t make all the devices speak simultaneously, but hey. It’s still much cool

I have a couple of Reactors that use this, and it’s a step into the future :slight_smile:

All I’d say to @therealdb is that I suspect your scenes could be profitably replaced by Reactor, but grandmother egg sucking classes are over there >>>>> :wink:

C

Anyone having this running on Vera (FW 7.30) and have gotten around the captcha login?

Here is what I did:
I did the same steps as @shady.hamilton in post 20 (or so).

Downloaded the files from github
After editing the shell script, uploaded to Vera.
Edited the shell script:
SET_EMAIL and SET_PASSWORD to my login acct
SET_LANGUAGE=‘en-US’
SET_TTS_LOCALE=‘en-US’
SET_AMAZON=‘amazon.com
SET_ALEXA=‘alexa.amazon.com
Created the device.
No device is displayed. (But when I go into Reactor, it shows a device was created but nothing shows up in the Vera UI.)
I ssh into my VeraEdge and there is no /storage/alexa directory.

Just for kicks, while ssh’ed I copied over my edited shell script and executed as: ./alexa_remote_control_plain.sh 2>&1 > output.txt

In the output.txt file it says to look in /tmp/.alexa.login and when I display this in a browser, it shows a captcha was displayed.

Since it sounds like oathtool isn’t supported on a Vera, then I am not sure how to get around this.

Any suggestions or pointers?

I had some luck with running it on a browser and complete a login from the same ip.

Look at my comment above. for how i passed the 2 step verification. you need to set up 2 stage to text you a on time pass code.

I’ve got it running on 7.30

The User and pass info should be edited in the device so not sure what’s gone wrong as a start there.

For the captcha issue you can use Firefox with an add-in to log in, then save the cookie then copy that into the /storage/alexa folder

But until you have that device created properly…

FWIW mine was created on 7.29 I think

C

I have a new version with zero delay almost ready. Unfortunately synch’ed tts on multiple devices is not supported. When routines could be launched, you can set a routine with static text and execute it. This will work.

2 Likes

Wow. Just gets better! Thanks!

C

Yep. I’m waiting on getting jq package, so the full commands can be sent. I have a beta version coming up on GitHub, supporting jq on openluup. Unfortunately I have to wait for the jq package in order to release it on Vera as well.

1 Like

Greetings!

Keen to get my Alexa to talk! I have followed the instructions on Github, but have not being able to get a device set up successfully.

The files have been downloaded as a zip and extracted whereafter it was uploaded to the VeraPlus.
Next I created a new device and can see the device is created in the devices screen. When accessing the newly created device the “params” page is populated with the Device & implementation file names etc. So at least that appears to work. However the “variables” page is complete blank and therefore I cannot continue.

Notes:
There is no /storage/alexa directory created.

The log file is somewhat meaningless:
08 01/08/20 19:36:36.174 JobHandler_LuaUPnP::HandleActionRequest argument action=CreateDevice <0x70b27520>
08 01/08/20 19:36:36.174 JobHandler_LuaUPnP::HandleActionRequest argument deviceType=urn:dlna-org:device:DLNAMediaController:1 <0x70b27520>
08 01/08/20 19:36:36.174 JobHandler_LuaUPnP::HandleActionRequest argument internalID=qa <0x70b27520>
08 01/08/20 19:36:36.174 JobHandler_LuaUPnP::HandleActionRequest argument Description=aa <0x70b27520>
08 01/08/20 19:36:36.175 JobHandler_LuaUPnP::HandleActionRequest argument UpnpDevFilename=D_VeraAlexa1.xml <0x70b27520>
08 01/08/20 19:36:36.175 JobHandler_LuaUPnP::HandleActionRequest argument UpnpImplFilename=I_VeraAlexa1.xml <0x70b27520>
08 01/08/20 19:36:36.175 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNumParent=0 <0x70b27520>
08 01/08/20 19:36:36.175 JobHandler_LuaUPnP::HandleActionRequest argument RoomNum=0 <0x70b27520>
01 01/08/20 19:36:36.485 mUserData::WriteUserData saved–before move File Size: 92698 save size 92698 <0x76568520>
02 01/08/20 19:36:36.485 UserData::TempLogFileSystemFailure start <0x76568520>
02 01/08/20 19:36:36.508 UserData::TempLogFileSystemFailure 4951 res:1
-rw-r–r-- 1 root root 33 Nov 15 20:08 /etc/cmh/HW_Key
-rw-r–r-- 1 root root 31 Jan 1 2000 /etc/cmh/HW_Key2
-rw-r–r-- 1 root root 9 Nov 15 20:08 /etc/cmh/PK_AccessPoint
-rw-r–r-- 1 root root 7 Nov 15 20:08 /etc/cmh/PK_Account
-rw-r–r-- 1 root root 4610 Jan 8 19:14 /etc/cmh/alerts.json

Even if another device is created the same error occurs. Not sure if the "TempLogFileSystemFailure " is significant or not… Either way this "TempLogFileSystemFailure " error seems to appear quite often in the log file…

What other troubleshooting can I do?

Any assistance is much appreciated.

Andre

Hard refresh your browser?

C

It seems like you have no space left. What firmware are you on?

Done a hard refresh and reboot of the Vera, as that is usually the first thing to do.

Firmware version 1.7.4453

Filesystem Size Used Available Use% Mounted on
rootfs 8.6M 6.4M 2.2M 75% /
/dev/root 10.0M 10.0M 0 100% /rom
tmpfs 124.8M 3.1M 121.7M 2% /tmp
/dev/mtdblock6 8.6M 6.4M 2.2M 75% /overlay
overlayfs:/overlay 8.6M 6.4M 2.2M 75% /
tmpfs 512.0K 0 512.0K 0% /dev
/dev/mtdblock10 50.0M 11.2M 38.8M 22% /storage
/dev/mtdblock10 50.0M 11.2M 38.8M 22% /etc/cmh-firmware
/dev/mtdblock10 50.0M 11.2M 38.8M 22% /etc/cmh-backup
/dev/mtdblock9 9.8M 9.8M 0 100% /mios

I also thought it is an issue with space…Don’t often ssh in and to a df, but assume /rom and /mios can be 100% full.

I am able to create reactor devices etc. I would assume if it was a space issue I would not be able to create any other devices either.

Andre

After not making much progress I eventually decided to switch on verbose logging and also write the logs to USB. As a result of these changes the Vera had to reboot a few more times. Weird enough now the new device is there and the missing “variables” page is there. Yay!

I’ll continue with the configuration steps tomorrow…

Andre