The Vera Community forums have moved!

Advanced => Plugins & Plugin Development => Programming => Sonos Plugin => Topic started by: JohnGiddings on April 29, 2018, 04:42:10 am

Title: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on April 29, 2018, 04:42:10 am
Hi all

My Sonos TTS using Responsive voice has stopped working. I can only get it to repeat the previously working announcement, which makes me think somehow its not overwriting the previous file received from responsive voice.

If I run this, it works (don't laugh, its an announcement for the kids :) )
Code: [Select]
local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"

luup.call_action(LS_SID, "Say", {Text = "Yippee. Mummy is home" ,Volume=60}, 64)

If I run this, it doesnt
Code: [Select]
local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"

luup.call_action(LS_SID, "Say", {Text = "Please talk to me" ,Volume=60}, 64)

With Debug switched on in the Sonos plugin, this is the only message I get
Code: [Select]
08 04/29/18 9:25:27.829 JobHandler_LuaUPnP::HandleActionRequest argument action=RunLua <0x6e3a0520>
08 04/29/18 9:25:27.829 JobHandler_LuaUPnP::HandleActionRequest argument Code=local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"

luup.call_action(LS_SID, "Say", {Text = "Please talk to me" ,Volume=60}, 64) <0x6e3a0520>
01 04/29/18 9:25:27.830 sbrk JobHandler_LuaUPnP::HandleActionRequest Problem with getnameinfo <0x6e3a0520>
08 04/29/18 9:25:27.830 JobHandler_LuaUPnP::HandleActionRequest device: 64 service: urn:micasaverde-com:serviceId:Sonos1 action: Say <0x6e3a0520>
08 04/29/18 9:25:27.830 JobHandler_LuaUPnP::HandleActionRequest argument Volume=60 <0x6e3a0520>
08 04/29/18 9:25:27.830 JobHandler_LuaUPnP::HandleActionRequest argument Text=Please talk to me <0x6e3a0520>
02 04/29/18 9:25:28.077 luup_log:64: Sonos: warning: RV TTS: failed! <0x6e3a0520>

It appears this stopped working while I was away on business, and no changes have been made.

Is anyone else getting this or know how to fix it?

Thanks
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: cokeman on April 29, 2018, 06:45:21 am
Hi

got this issue to, for the last few days my alarm system ain't talking to me :-/
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: michelhamelin on April 29, 2018, 07:45:23 am
Same problem , changed nothing and i m not on beta firmware.
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on April 29, 2018, 10:22:35 am
I've fixed it. I'm not sure how this ever worked before for me.

In the copy of L_SonosTTS.lua I was using, there is a mistake in the url for the responsive voice PHP page on line 140. Essentially it repeats "/getvoice.php" twice.

I changed
Code: [Select]
"%s/getvoice.php?t=%s&tl=%s&sv=&vn=&pitch=&rate=%s"]]
To this
Code: [Select]
"%s?t=%s&tl=%s&sv=&vn=&pitch=&rate=%s"]]
Attached is my copy of the file.

I hope this helps someone else.

Thanks

John

Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on April 29, 2018, 09:12:48 pm
I've fixed it. I'm not sure how this ever worked before for me.

In the copy of L_SonosTTS.lua I was using, there is a mistake in the url for the responsive voice PHP page on line 140. Essentially it repeats "/getvoice.php" twice.

I changed
Code: [Select]
"%s/getvoice.php?t=%s&tl=%s&sv=&vn=&pitch=&rate=%s"]]
To this
Code: [Select]
"%s?t=%s&tl=%s&sv=&vn=&pitch=&rate=%s"]]
Attached is my copy of the file.

I hope this helps someone else.

Thanks

John
Hi John,
Can you or anyone else confirm that their responsive voice is working please? Mine has also stopped working and I have changed nothing....
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on April 29, 2018, 11:41:24 pm
I've fixed it. I'm not sure how this ever worked before for me.

In the copy of L_SonosTTS.lua I was using, there is a mistake in the url for the responsive voice PHP page on line 140. Essentially it repeats "/getvoice.php" twice.

I changed
Code: [Select]
"%s/getvoice.php?t=%s&tl=%s&sv=&vn=&pitch=&rate=%s"]]
To this
Code: [Select]
"%s?t=%s&tl=%s&sv=&vn=&pitch=&rate=%s"]]
Attached is my copy of the file.

I hope this helps someone else.

Thanks

John
I have had some time to look at this and applied your modified Sonos file and tts is now working again. Thanks John!!
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: lakewoodjazz on April 30, 2018, 04:09:58 pm
Thanks so much for the quick fix John.
It's people like you that keep our houses talking!
I just paste Johns corrected downloaded file in Develope Apps - Lua Files.
It overwrites the dead file and makes one of my favorite aspects of Vera work again!
Cheers!
Vera Edge UI7
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: ZW-Tom on May 01, 2018, 11:56:15 pm
Wow! I have been using Responsive voice forever. For everything from thermostat temp change, door monitoring, music announcements and my entire security system, all based on the functionality of Responsive voice. Then Friday, it stopped working.

I have spent 22 hours trying to fix it. Good work John!

Why, after so many months of working, did it suddenly stop? I looked at the SonosTTS.lua, and could not think it could have worked for so long, and then one day NOT.

John, how on earth did you find that?

Nice job. After 22 hours, your fix worked!!!

Thanks for the fix John!!!  :) :) :)

Tom
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on May 02, 2018, 05:58:23 pm
No problem, I guess responsive voice must have made a change to their web service to be less tolerant to errors.
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: kellerman on May 16, 2018, 06:02:12 pm
Excellent work John! Thanx!

I also noticed my TTS stopped working a couple of days ago...but first thought it was related to the latest firmware upgrade...
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: RogerO on May 16, 2018, 09:21:44 pm
Awesome work. Thanks for getting my washer and dryer notifications working again.
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on May 18, 2018, 04:55:13 am
What does every one use their tts for?
My uses are:
1st
If garage door is open for 30mins will send a message that xyz garage door is open (we have two) and keep sending every 30mins
This is using responsive voice
2nd
If there is a motion detection at two of our isolated entrances it will state a warning that the authorities have been notified
This is played from a local file
3rd
If there is motion detection inside a warning is spoken and siren
This is from local file
4th
When washing machine voltage (aeotec smart switch 6) drops below 1w it is spoken that the washing cycle is complete
This is using responsive voice
5th
Each weekday first motion detection in kitchen triggers say weather (but I am thinking this is this might be redundant with Alexa briefing)
This is using responsive voice

Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on May 18, 2018, 02:15:26 pm
I have the following notifications

Morning Welcome
The 1st time a motion sensor in the hall is tripped, I have a welcome message that includes.
?   The current time
?   The outside temperature
?   The previous days high and low temp, fastest wind speed and rainfall recorded on Netatmo
?   Todays Weather forecast
?   Events in the family Google Calendar

Reminder Messages
Vera reminds us to do events in the google calendar such as
a.   Pick up kids from school
b.   top up water softener with salt once a month
c.   Water the plants
d.   Put the waste or recycling bins out
e.   Check the smoke alarm
f.   etc

Notification that I have safely arrived at work
Informs my wife that I have entered the geofence for work and advises how long the commute time was

Notification I have left work
When I exit the work geofence it advise how long it will take to get home based on the information in the iPhone Locator plugin

Notification when my wife or I are home
If the house isn?t empty and we enter the home geofence, it announces our arrival and travel time if I was returning from work

Welcome home
If the house was empty and either my wife or I come home, it welcomes us and advises where the other person is. It also advises how many times the doorbell rang while the house was empty and confirms the heating has been turned back up.

Announce arrival of friends and family
Everyone who uses my wifi has a static IP address. When Vera pings the device, it announces who has arrived

We have received some post
A motion sensor is attached to the letter box. A push notification is also sent to iphones

When the doorbell rings
A lightwaveRF doorbell signal is picked up by rfxcom when the doorbell rings. A push notification is also triggered from Blue Iris with the picture from the door camera to our iphones

Weather Warnings
When wind speed exceeds a specific value, it warns us, so garden furniture can be moved

Back Door left open and heating on
If the back door is left open for 5 minutes and the heating is on, it warns us and the heating us turned off

Warning if unexpected movement detected
If both my wife and I are outside the home geofence, it warns that we have been notified. A push notification also goes to the iphones
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on May 18, 2018, 02:38:46 pm
I have the following notifications

Morning Welcome
The 1st time a motion sensor in the hall is tripped, I have a welcome message that includes.
?The current time
?The outside temperature
?The previous days high and low temp, fastest wind speed and rainfall recorded on Netatmo
?Todays Weather forecast
?Events in the family Google Calendar

Reminder Messages
Vera reminds us to do events in the google calendar such as
a.Pick up kids from school
b.top up water softener with salt once a month
c.Water the plants
d.Put the waste or recycling bins out
e.Check the smoke alarm
f.etc

Notification that I have safely arrived at work
Informs my wife that I have entered the geofence for work and advises how long the commute time was

Notification I have left work
When I exit the work geofence it advise how long it will take to get home based on the information in the iPhone Locator plugin

Notification when my wife or I are home
If the house isn?t empty and we enter the home geofence, it announces our arrival and travel time if I was returning from work

Welcome home
If the house was empty and either my wife or I come home, it welcomes us and advises where the other person is. It also advises how many times the doorbell rang while the house was empty and confirms the heating has been turned back up.

Announce arrival of friends and family
Everyone who uses my wifi has a static IP address. When Vera pings the device, it announces who has arrived

We have received some post
A motion sensor is attached to the letter box. A push notification is also sent to iphones

When the doorbell rings
A lightwaveRF doorbell signal is picked up by rfxcom when the doorbell rings. A push notification is also triggered from Blue Iris with the picture from the door camera to our iphones

Weather Warnings
When wind speed exceeds a specific value, it warns us, so garden furniture can be moved

Back Door left open and heating on
If the back door is left open for 5 minutes and the heating is on, it warns us and the heating us turned off

Warning if unexpected movement detected
If both my wife and I are outside the home geofence, it warns that we have been notified. A push notification also goes to the iphones
Some great ideas here John
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on May 25, 2018, 04:37:19 am
Hi all

My Sonos TTS using Responsive voice has stopped working. I can only get it to repeat the previously working announcement, which makes me think somehow its not overwriting the previous file received from responsive voice.

If I run this, it works (don't laugh, its an announcement for the kids :) )
Code: [Select]
local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"

luup.call_action(LS_SID, "Say", {Text = "Yippee. Mummy is home" ,Volume=60}, 64)

If I run this, it doesnt
Code: [Select]
local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"

luup.call_action(LS_SID, "Say", {Text = "Please talk to me" ,Volume=60}, 64)

With Debug switched on in the Sonos plugin, this is the only message I get
Code: [Select]
0804/29/18 9:25:27.829JobHandler_LuaUPnP::HandleActionRequest argument action=RunLua <0x6e3a0520>
0804/29/18 9:25:27.829JobHandler_LuaUPnP::HandleActionRequest argument Code=local LS_SID = "urn:micasaverde-com:serviceId:Sonos1"

luup.call_action(LS_SID, "Say", {Text = "Please talk to me" ,Volume=60}, 64) <0x6e3a0520>
0104/29/18 9:25:27.830sbrk JobHandler_LuaUPnP::HandleActionRequest Problem with getnameinfo <0x6e3a0520>
0804/29/18 9:25:27.830JobHandler_LuaUPnP::HandleActionRequest device: 64 service: urn:micasaverde-com:serviceId:Sonos1 action: Say <0x6e3a0520>
0804/29/18 9:25:27.830JobHandler_LuaUPnP::HandleActionRequest argument Volume=60 <0x6e3a0520>
0804/29/18 9:25:27.830JobHandler_LuaUPnP::HandleActionRequest argument Text=Please talk to me <0x6e3a0520>
0204/29/18 9:25:28.077luup_log:64: Sonos: warning: RV TTS: failed! <0x6e3a0520>

It appears this stopped working while I was away on business, and no changes have been made.

Is anyone else getting this or know how to fix it?

Thanks
Hi John,
Is your responsive voice working? Mine has stopped working and I am not sure if it is since I applied the latest Vera update last week or perhaps responsive voice may of changed something again?
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on May 26, 2018, 12:51:55 pm
Hi

Everything is working for me at the moment.

I?m still running firmware 1.7.3453 on my Vera Plus because I don?t want anything to break.

John
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on May 26, 2018, 10:51:55 pm
Hi

Everything is working for me at the moment.

I?m still running firmware 1.7.3453 on my Vera Plus because I don?t want anything to break.

John
My tts responsive voice is working again today, not sure if the Vera restart fixed it :-/
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on May 27, 2018, 07:09:32 am
Hi

You were right, something HAS changed and again I think this is on the Responsive Voice side.

I noticed this morning that my morning greeting was cut short.

It looks like the number of characters that can be processed in each section has been shortened.

I have decreased the "cutSize" on line 154 from 1000 to 200. Unfortunately, this has re-introduced the some pauses on long phrases we had when the code was first released, but at least its working again.

I've uploaded the code change again.

Thanks

John
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on May 28, 2018, 01:49:08 am
Hi

You were right, something HAS changed and again I think this is on the Responsive Voice side.

I noticed this morning that my morning greeting was cut short.

It looks like the number of characters that can be processed in each section has been shortened.

I have decreased the "cutSize" on line 154 from 1000 to 200. Unfortunately, this has re-introduced the some pauses on long phrases we had when the code was first released, but at least its working again.

I've uploaded the code change again.

Thanks

John
Thanks John
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: swfire271 on May 30, 2018, 11:37:07 am
First off - thanks for the fix for my TTS - it is working again!! 

Second - could you point me in the direction of finding the info to program TTS to say some of the examples that you quoted below?  I'd love to get some of those working on my system too but not sure how to accomplish it.  Thanks!!


I have the following notifications

Morning Welcome
The 1st time a motion sensor in the hall is tripped, I have a welcome message that includes.
?   The current time
?   The outside temperature
?   The previous days high and low temp, fastest wind speed and rainfall recorded on Netatmo
?   Todays Weather forecast
?   Events in the family Google Calendar

Reminder Messages
Vera reminds us to do events in the google calendar such as
a.   Pick up kids from school
b.   top up water softener with salt once a month
c.   Water the plants
d.   Put the waste or recycling bins out
e.   Check the smoke alarm
f.   etc

Notification that I have safely arrived at work
Informs my wife that I have entered the geofence for work and advises how long the commute time was

Notification I have left work
When I exit the work geofence it advise how long it will take to get home based on the information in the iPhone Locator plugin

Notification when my wife or I are home
If the house isn?t empty and we enter the home geofence, it announces our arrival and travel time if I was returning from work

Welcome home
If the house was empty and either my wife or I come home, it welcomes us and advises where the other person is. It also advises how many times the doorbell rang while the house was empty and confirms the heating has been turned back up.

Announce arrival of friends and family
Everyone who uses my wifi has a static IP address. When Vera pings the device, it announces who has arrived

We have received some post
A motion sensor is attached to the letter box. A push notification is also sent to iphones

When the doorbell rings
A lightwaveRF doorbell signal is picked up by rfxcom when the doorbell rings. A push notification is also triggered from Blue Iris with the picture from the door camera to our iphones

Weather Warnings
When wind speed exceeds a specific value, it warns us, so garden furniture can be moved

Back Door left open and heating on
If the back door is left open for 5 minutes and the heating is on, it warns us and the heating us turned off

Warning if unexpected movement detected
If both my wife and I are outside the home geofence, it warns that we have been notified. A push notification also goes to the iphones
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on May 31, 2018, 09:17:52 am
Hi SWFire

All of my TTS has been created using code from other people here on this forum.

I?m away at the moment but if you let me know which example you are interested in, I?ll share my code and explain the plugins I use when I?m home again.

Thanks

John
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: swfire271 on June 01, 2018, 10:04:10 pm
Hi SWFire

All of my TTS has been created using code from other people here on this forum.

I?m away at the moment but if you let me know which example you are interested in, I?ll share my code and explain the plugins I use when I?m home again.

Thanks

John


-I'm interested in how to pull events from a Google calendar and have them say them

-Also interested in the geofence for arriving/leaving work

-Announce arrival of friends and family

These are what interests me the most.  Thanks for your guidance!  Looking forward to implementing some of these cool features to my system  :)





Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on June 03, 2018, 02:10:15 am
Hi SWFire

All of my TTS has been created using code from other people here on this forum.

I?m away at the moment but if you let me know which example you are interested in, I?ll share my code and explain the plugins I use when I?m home again.

Thanks

John
Look like responsive voice is not working again:-/
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on June 03, 2018, 04:17:55 pm
Hi

I?m not home to verify everything is working correctly, but my wife says Responsive is working for us.

Have you tried restarting vera again?

John
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: swfire271 on June 03, 2018, 09:53:54 pm
Mine is still working as of today.  *fingers crossed*
Title: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: PrincessCleavage on June 05, 2018, 04:23:28 am
Hi

I?m not home to verify everything is working correctly, but my wife says Responsive is working for us.

Have you tried restarting vera again?

John
Thanks gents,
It seems when you add a Sonos stereo pair during the setpup process when prompted to press the button on the back of the left unit in the stereo pair you must press the unit that you have configured in the Vera Sonos app (I.p address in my setup) or adjust the I.p address in the Vera Sonos app to mirror the ?left speaker? that you selected during the Sonos stereo pair creation or tts will not work:-/
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on June 10, 2018, 02:31:42 pm
Would it be difficult to add responsive voice to this app:
http://code.mios.com/trac/mios_dlna-cntroller
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: JohnGiddings on June 10, 2018, 03:06:21 pm
I suspect it?s possible, does that plugin work with Sonos?

I would recommend you open another thread and ask the question, it would best if the original developer made the changes.
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on June 16, 2018, 06:12:57 am
Gents Can anyone help with the below please:
what would be the correct addition to the below code to return the volume to 50% after the tts completes?

luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say",
                 {Text="The washing cycle has completed", Language="en", Volume=75},
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: anthonyris on June 23, 2018, 12:22:02 pm
+1 on many thanks 🙏🏼 to John for the original fix and this update for TTS.

Hi

You were right, something HAS changed and again I think this is on the Responsive Voice side.

I noticed this morning that my morning greeting was cut short.

It looks like the number of characters that can be processed in each section has been shortened.

I have decreased the "cutSize" on line 154 from 1000 to 200. Unfortunately, this has re-introduced the some pauses on long phrases we had when the code was first released, but at least its working again.

I've uploaded the code change again.

Thanks

John
Title: Re: Sonos - Responsive Voice - "Sonos: warning: RV TTS: failed!"
Post by: fyford on June 26, 2018, 07:51:54 am
+1 for having had lots of trouble with this one. Not at home at the min, but I have noticed that it has stopped working for us as well. Will try your fix, hopefully that works.

I've been using it to let us know if the postman opens the porch door, weather (WU plugin) in the mornings etc. but yours are next level John. I'd be interested too in a step though on how you set some of those up. I assume you are using PLEG to sort those out? I've just dipped my toes in PLEG and it seems like it might be the way to go. I'm using Fibraro 3in1 sensors as triggers for most things, but they have all become unresponsive since the last FW update, so I need to get that sorted first....

Looking forward to hearing how you achieved some of these. I'd like to know when the garage door is left open for example, what sensor are you using for your backdoor?

Cheers
Title: Re: Sonos - Responsive Voice - &quot;Sonos: warning: RV TTS: failed!&quot;
Post by: PrincessCleavage on June 27, 2018, 06:42:07 am
Anyone that gets a fright at wee hours of the morning when they say Alexa and she responds with 100% full vocal force ( set too 100% volume from a previously triggered security warning or such and volume didn?t return to previous setting volume setting) can use the below code addition to return volume to xyz setting after tts finish?s

The below returns volume to 50% for device 176 just need to ensure the luup.sleep (milliseconds value) has to be longer than the tts or the volume reduces mid speech
luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say",
                 {Text="The Washing cycle has completed", Language="en", Volume=75},
                 176)
luup.sleep (4000)
luup.call_action('urn:upnp-org:serviceId:RenderingControl', 'SetVolume', {DesiredVolume = 50}, 176)

Credit and thanks goes to Member A-Lurker (creator of the broadlink plugin and others)

Of course use at your own risk as I tweaked it and I am no luup programmer :-)