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

Howdy, how do we actually use this feature? I cant find anything in my install?

you use the code in the test lua , in apps - develop apps

do you mean this code?

luup.call_action("urn:bochicchio-com:serviceId:VeraAlexa1", "Reset", {}, 666)

Cause that kills the cookie too - I’ll just kill the device list files myself if need be.

yes, i mean that, it’s the only reset i know of.

Nice idea. I will add a new update action, just to update the files. Reset will be there if you want to be aggressive.

EDIT: setting Configured to 0 and a reload will produce the same effect anyway.

1 Like

Minor bug repot -
Since the update the bug of volume reseting to 10 has been cured.
The minor bug is -
When you send multiple speak commands in close succession the penultimate call is the resulting volume.

i.e.
original 50
send speak vol 30
send speak vol 30
final vol 30

1 Like

So heres a bug report:

As of recent my TTS commands stopped working. I thought maybe the cookie had expired so i uploaded a new one no help, reset the plugin and re-uploaded the cookie still no help. I was testing the commands on my Sonos One speakers and looking through the logs the commands made it through fine but I just wasnt getting any voice coming out of the Sonos speakers. I then tested on my echo dot and it seemed to work just fine. I am also running the Sonos plugin by @rigpapa and recall there was some conflicts with the service IDs. I tried using both urn:micasaverde-com:serviceId:Sonos1 and urn:bochicchio-com:serviceId:VeraAlexa1 service IDs in my TTS commands and neither of them work. Ive compared the logs from the commands to the echo dot vs the command to my sonos speakers and im seeing no differences in responses.

If the logs show a success, it’s something on Amazon servers. Wait a couple of hours and try again. Unfortunately I only have echoes to test.

Hm the dots were working fine, just not the sonos speakers maybe I am overlooking something in the logs. I will test again tomorrow and send the logs. Maybe amazon blocked TTS for Sonos devices :disappointed:

That’s probably the reason. btw, look at LatestResponse variable after sending the command, I added a new variable that just displays the last command to simplify debug.

Heres some of the logs I got everything seems to be fine, oddly enough the speaker changes to the volume I set in the code just no voice.

08	05/12/20 13:28:47.042	JobHandler_LuaUPnP::HandleActionRequest device: 632 service: urn:bochicchio-com:serviceId:VeraAlexa1 action: Say <0x70ea0520>
08	05/12/20 13:28:47.043	JobHandler_LuaUPnP::HandleActionRequest argument Repeat=3 <0x70ea0520>
08	05/12/20 13:28:47.043	JobHandler_LuaUPnP::HandleActionRequest argument Text=Hello from Vera Alexa <0x70ea0520>
08	05/12/20 13:28:47.043	JobHandler_LuaUPnP::HandleActionRequest argument GroupZones=Arman's Sonos One <0x70ea0520>
08	05/12/20 13:28:47.044	JobHandler_LuaUPnP::HandleActionRequest argument Volume=50 <0x70ea0520>
50	05/12/20 13:28:47.044	luup_log:632: VeraAlexa: addToQueue: added to queue for 632 <0x70ea0520>
50	05/12/20 13:28:47.045	luup_log:632: VeraAlexa(addToQueue@226): addToQueue: before: 0 <0x70ea0520>
50	05/12/20 13:28:47.046	luup_log:632: VeraAlexa(addToQueue@243): addToQueue: after: 3 <0x70ea0520>
50	05/12/20 13:28:47.047	luup_log:632: VeraAlexa(checkQueue@200): checkQueue: 632 - 3 in queue <0x70ea0520>
50	05/12/20 13:28:47.048	luup_log:632: VeraAlexa(checkQueue@208): checkQueue: 632 - play next <0x70ea0520>
50	05/12/20 13:28:47.049	luup_log:632: VeraAlexa(setVar@115): setVar("urn:bochicchio-com:serviceId:VeraAlexa1","OneTimePassCode","",632) old value "" <0x70ea0520>
50	05/12/20 13:28:47.049	luup_log:632: VeraAlexa(sayTTS@313): Executing command [TTS]: "-e speak:'Hello from Vera Alexa' -d \"Arman's Sonos One\"" <0x70ea0520> ```
.
.
.

``` 50	05/12/20 13:28:51.634	luup_log:632: VeraAlexa(setVar@115): setVar("urn:micasaverde-com:serviceId:HaDevice1","CommFailure","0",632) old value "0" <0x70ea0520>
50	05/12/20 13:28:51.637	luup_log:632: VeraAlexa(setVar@115): setVar("urn:bochicchio-com:serviceId:VeraAlexa1","LatestResponse","sending cmd:speak:Hello from Vera Alexa to dev:Arman's_Sonos_One type:A2OSP3UA4VC85F serial:57d7e15ca43946eba685e5408d38eac5 customerid:A9RSYF548LPJE",632) old value "sending cmd:speak:Hello from Vera Alexa to dev:Arman's_Sonos_One type:A2OSP3UA4VC85F serial:57d7e15ca43946eba685e5408d38eac5 customerid:A9RSYF548LPJE" <0x70ea0520>
50	05/12/20 13:28:51.644	luup_log:632: VeraAlexa(nil@270): Response from Alexa.sh: "sending cmd:speak:Hello from Vera Alexa to dev:Arman's_Sonos_One type:A2OSP3UA4VC85F serial:57d7e15ca43946eba685e5408d38eac5 customerid:A9RSYF548LPJE" <0x70ea0520>
50	05/12/20 13:28:51.646	luup_log:632: VeraAlexa(sayTTS@327): Queue will be checked again in "3" secs <0x70ea0520>
50	05/12/20 13:28:51.647	luup_log:0: ALTUI: Evaluation of lua code returned: nil <0x70ea0520>
08	05/12/20 13:28:52.156	JobHandler_LuaUPnP::HandleActionRequest device: 726 service: urn:micasaverde-com:serviceId:Sonos1 action: NotifyRenderingChange <0x6fce8520>
08	05/12/20 13:28:52.157	JobHandler_LuaUPnP::HandleActionRequest argument DeviceNum=726 <0x6fce8520>
08	05/12/20 13:28:52.157	JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:Sonos1 <0x6fce8520>
08	05/12/20 13:28:52.158^C

as you can see, the command is sent. I’m sorry, we just have to wait for it to come back, they probably altered something on their backend.

1 Like

Hopefully someone has a Sonos One and confirm if theirs stopped working too!

Wow, this is great. I’d been hoping for a way to put my Amazon Echo to use from Vera.

Unfortunately, despite following the instructions exactly as listed at vera/VeraAlexa at master · dbochicchio/vera · GitHub, after creating the new device I’m getting the same error as previous posters:

System error : Device: 119. Fail to load implementation file D_VeraAlexa1.xml

There no no “alexa” folder being created under /storage/. I’m 100% sure that I uploaded all the files correctly:

la— 5/14/2020 2:53 PM 66296 alexa.png
la— 5/14/2020 2:52 PM 80299 D_VeraAlexa1.xml
la— 5/14/2020 2:52 PM 103316 I_VeraAlexa1.xml
la— 5/14/2020 2:52 PM 218833 L_VeraAlexa1.lua
la— 5/14/2020 2:53 PM 72789 LICENSE
la— 5/14/2020 2:53 PM 109696 S_VeraAlexa1.xml

and I’m 100% I specified D_VeraAlexa1.xml as the Upnp Device Filename and I_VeraAlexa1.xml as the Upnp Implementation Filename. I’d like to start all over again, but by now I’ve got two phantom Alexa TTS devices (two errors complaining about “Fail to load implementation file D_VeraAlexa1.xml”), so need to know how to clean the mess up and what might have gone wrong. I have SSH access and Linux apptitude, but don’t know where to go to clean things up. (Don’t want to break my Vera.)

Can anyone offer any advice? Would really love to get this working, would really help with my migration from Imperihome to TheHomeRemote for my home control tablet (since no TTS in THR.)

Thanks in advance.

Mike Reynolds

Oops, forgot to mention:

  • Vera Plus
  • Fimware version: 1.7.4970 (7.31)

Looks like when you installed, and created the device, you put the wrong values in the wrong fields. Delete the device and try again.

Thanks for replying. Unfortunately, I am 100% sure I did put the correct values into the correct fields. But I would be happy to delete the device and try again, but Vera has kindly removed the (two now) failed devices from the gui.

What I’d really like to do is clean all this up and do it all over again. would you by any chance know the correct LUUP to delete my failed devices? And also where in the Linux filesystem to delete the files that I had uploaded? (In case some problem with the file upload is what caused the problem.)

Well, the error message says it’s trying to use D_VeraAlex1.xml as an implementation file, and that’s not right… the implementation file would be I_VeraAlexa1.xml. I checked the instructions and there’s no error there. But anyway, run this code (copy-paste to Test Luup Code tool), it might straighten it out:

luup.attr_set( "device_file", "D_VeraAlexa1.xml", 119 )
luup.attr_set( "impl_file", "I_VeraAlexa1.xml", 119 )
luup.reload()

Give it a minute, then do a hard-refresh of your browser.

Edit: Fixed a typo in the code, so you may need to make a second attempt.

Hmm. OK, found the right data_request url to delete the broken devices, and have carefully added the device again – this time pasting the strings from vera/VeraAlexa at master · dbochicchio/vera · GitHub to Notepad and from there to Vera, to avoid any non-ascii characters – and thought for awhile that had helped a bit. I was no longer getting those errors from Vera and my “unknown” device was staying put. Unfortunately, the Advanced/Variables tab was blank, and there’s still no Amazon folder in /storage.

No errors on LuaUPnP.log, but found entries that seemed to indicate device created ok:

08 05/14/20 15:36:03.030 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: ^[[36;1mCreateDevice^[[0m <0x7394a520>
08 05/14/20 15:36:03.031 JobHandler_LuaUPnP::HandleActionRequest argument serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1 <0x7394a520>
08 05/14/20 15:36:03.031 JobHandler_LuaUPnP::HandleActionRequest argument action=CreateDevice <0x7394a520>
08 05/14/20 15:36:03.031 JobHandler_LuaUPnP::HandleActionRequest argument deviceType=urn:dlna-org:device:DLNAMediaController:1 <0x7394a520>
08 05/14/20 15:36:03.031 JobHandler_LuaUPnP::HandleActionRequest argument UpnpDevFilename=D_VeraAlexa1.xml <0x7394a520>
08 05/14/20 15:36:03.031 JobHandler_LuaUPnP::HandleActionRequest argument UpnpImplFilename=I_VeraAlexa1.xml <0x7394a520>
08 05/14/20 15:36:03.031 JobHandler_LuaUPnP::HandleActionRequest argument DeviceNumParent=0 <0x7394a520>
08 05/14/20 15:36:03.032 JobHandler_LuaUPnP::HandleActionRequest argument RoomNum=0 <0x7394a520>
02 05/14/20 15:36:03.096 ^[[33;1mUserData::CommitToDatabase data size 224436 224436^[[0m <0x7394a520>
01 05/14/20 15:36:03.213 ^[[31;1mUserData::WriteUserData saved–before move File Size: 53783 save size 53783^[[0m <0x7714a520>
02 05/14/20 15:36:03.214 ^[[33;1mUserData::TempLogFileSystemFailure start 0^[[0m <0x7714a520>
02 05/14/20 15:36:03.230 ^[[33;1mUserData::TempLogFileSystemFailure (not failure, only WriteUserData) 0^[[0m <0x7714a520>
02 05/14/20 15:36:03.231 ^[[33;1mUserData::TempLogFileSystemFailure 699 res:1
-rw-r–r-- 1 root root 504 Jun 23 2015 /etc/cmh/user_data.json.luup.lzo
-rw-r–r-- 1 root root 53819 May 14 15:27 /etc/cmh/user_data.json.lzo
-rw-r–r-- 1 root root 53802 May 14 15:27 /etc/cmh/user_data.json.lzo.1
-rw-r–r-- 1 root root 53803 May 14 15:26 /etc/cmh/user_data.json.lzo.2
-rw-r–r-- 1 root root 53793 May 14 15:20 /etc/cmh/user_data.json.lzo.3
-rw-r–r-- 1 root root 53699 May 14 15:14 /etc/cmh/user_data.json.lzo.4
-rw-r–r-- 1 root root 53681 May 14 14:59 /etc/cmh/user_data.json.lzo.5
-rw-r–r-- 1 root root 53783 May 14 15:36 /etc/cmh/user_data.json.lzo.new
^[[0m <0x7714a520>
02 05/14/20 15:36:03.314 ^[[33;1mUserData::TempLogFileSystemFailure start 0^[[0m <0x7714a520>
02 05/14/20 15:36:03.330 ^[[33;1mUserData::TempLogFileSystemFailure (not failure, only WriteUserData) 0^[[0m <0x7714a520>
02 05/14/20 15:36:03.331 ^[[33;1mUserData::TempLogFileSystemFailure 610 res:1
-rw-r–r-- 1 root root 504 Jun 23 2015 /etc/cmh/user_data.json.luup.lzo
-rw-r–r-- 1 root root 53783 May 14 15:36 /etc/cmh/user_data.json.lzo
-rw-r–r-- 1 root root 53819 May 14 15:27 /etc/cmh/user_data.json.lzo.1
-rw-r–r-- 1 root root 53802 May 14 15:27 /etc/cmh/user_data.json.lzo.2
-rw-r–r-- 1 root root 53803 May 14 15:26 /etc/cmh/user_data.json.lzo.3
-rw-r–r-- 1 root root 53793 May 14 15:20 /etc/cmh/user_data.json.lzo.4
-rw-r–r-- 1 root root 53699 May 14 15:14 /etc/cmh/user_data.json.lzo.5
^[[0m <0x7714a520>

Since the Variables tab was blank, I decided maybe what was needed was a Z-Wave engine reload. I did that, and “voila!” The dreaded " System error : Device: 121. Fail to load implementation file D_VeraAlexa1.xml" is back. Baahhh!

Open to suggestions.

That’s the other device. Do this:

for k,v in pairs(luup.devices) do
    if v.device_type == "urn:bochicchio-com:device:VeraAlexa:1" then
        luup.attr_set( "device_file", "D_VeraAlexa1.xml", k )
        luup.attr_set( "impl_file", "I_VeraAlexa1.xml", k )
    end
end
luup.reload()

Edit: Forgot the reload.

Also, after creating or deleting devices, you must reload Luup and hard refresh your browser, per my earlier reply. Always. Get in the habit. You’ll notice the Variables tab is less blank when you do it.