Author Topic: Vera Plugin to push TTS (vs poll)  (Read 3675 times)

0 Members and 3 Guests are viewing this topic.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Vera Plugin to push TTS (vs poll)
« on: February 23, 2014, 07:12:27 PM »
I was wondering if your would ever consider adding a Vera based Luup plugin to push audio notifications (TTS) and OSD messages from Vera.  

The reason is using the polling has a 4-6 second delay if i fire from events on VoxCommando, which I'd like to avoid for entry or alarm messages.

Your Vera Luup plugin would then allow vera to use VoxCommando as TTS engine over the network in scenes.

I'm currently using a small custom TTS engine that is no longer being developed (but working) for those looking for a workaround:
http://forum.micasaverde.com/index.php?topic=5493.0 

« Last Edit: February 23, 2014, 07:15:05 PM by AgileHumor »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Vera Plugin to push TTS (vs poll)
« Reply #1 on: February 23, 2014, 09:51:40 PM »
I have found VC events generated by Scenes or Device states changing on the Vera occur almost instantly.  So if Vera knows something has happened, VC will know that it has happened within a fraction of a second.  I have certainly never seen anything approaching a delay of 4 or 5 seconds.  When I walk into the room, the VC TTS command that is triggered by the Vera event for my motion detector happens immediately after I see the red light on the motion sensor.  http://youtu.be/SF1aKh8aqZU?t=8m32s

In the case of some wall switches, Vera does not know they are on until they are polled, but I don't know how using luup to send messages to VC would make it any faster, because it still wouldn't happen until after Vera had decided to poll the device.  That is where the lag is.  Mabye there is something special about how locks work.  I don't know because i don't have one.

But if you want to send an event from Vera to VC using luup it is quite straightforward to do it.  Have a look at this thread: http://voxcommando.com/forum/index.php?topic=1357.msg11693#msg11693
« Last Edit: February 23, 2014, 09:55:35 PM by jitterjames »

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: Vera Plugin to push TTS (vs poll)
« Reply #2 on: February 23, 2014, 10:00:13 PM »
Thanks James, I'll see if there is something happening on my end causing the slowdown.

If I can get it working more quickly, then I'd prefer to keep the logic on VoxCommando vs Vera.

Could this be due to having 200 devices? 
Are you setup to poll or do you get an event send from the vera once your registered?  If your polling, then maybe it's taking 4-5 seconds to generate the status.  Or if your using events of what changed, it should be quicker.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Vera Plugin to push TTS (vs poll)
« Reply #3 on: February 23, 2014, 10:29:11 PM »
Could this be due to having 200 devices?  
It could be I guess.  If it means your Vera is not able to keep up with them all.  Vera will only poll devices in sequence.  It can sometimes help to increase the polling time for devices that you are not interested in so that they don't get in the Queue as often, which should make other devices more responsive.  But some devices like a motion sensor will push their information to the Vera so it should process them pretty quickly.  In that case it might still be struggling if your system is too complex.  The processing power of the Vera is relatively low I think.

Are you setup to poll or do you get an event send from the vera once your registered?  If your polling, then maybe it's taking 4-5 seconds to generate the status.  Or if your using events of what changed, it should be quicker.
The way that polling works with Vera is a bit weird but clever.  It is a poll, in that you ask for information about a change, but then it sits there waiting for a response from Vera.  Vera won't send a response until something changes and then it will send it right away and VC will process it right away, and then make a new request almost immediately.  The only time I can see there being a big delay would be if Vera had something(s) that was changing constantly so it was forced to keep refreshing over and over.  I have a minimum delay immediately after the poll is made to avoid it going crazy doing many successive polls, but it is still only 1.5 or 2 seconds if memory serves, and if several things have changed during that time they should all be reported immediately.  Under normal circumstances this short delay will not come into effect at all.

The first thing that you should verify, is whether there is a noticable difference between what the web interface for Vera is showing you, vs. the time that VC generates its event.  If they happen at about the same time, then the delay is internal to the Vera.  If the Vera web interface shows a change and it doesn't show up on VC for more than a second, then it bears further investigation.

There are situations where the luup code could still come in handy, and I have used it on occasion.  It is ridiculously easy to implement so I suggest you give it a try anyway, just to have one more tool at your disposal.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: Vera Plugin to push TTS (vs poll)
« Reply #4 on: February 23, 2014, 10:40:33 PM »
The delay is definitely between Vera and it showing up in Vox per the web interface and the logs.  However, maybe it is a delay on the Vera as I do run at about 20-30% CPU.

I have the same issue with mControl, which is the only other item connected to Vera other than Vox...and has a similiar delay.

Sadly, I have had months of debugging Vera/Z-Wave, and have actually split up into multiple Veras to get the rock solid performance.  I'm only using one for my initial foray into VoX...so that shouldn't factor in yet.

PS - Love this program!
« Last Edit: February 23, 2014, 10:43:12 PM by AgileHumor »