We have moved at community.getvera.com

Author Topic: VoxCommando - Control Vera by Voice  (Read 24629 times)

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #30 on: February 28, 2014, 04:59:34 pm »
If a scene is triggered, then VC will trigger a scene event automatically, which you can assign to a command.  I'm not sure why that does not solve your problem right there.

Or does something happen within the scene, where it then decides whether or not to send the notification?  Is this where PLEG comes in?  Does PLEG kick in when the scene is triggered and then call the Vera Alerts?

The more information you can give me the faster I will be able to come up with a solution.

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #31 on: February 28, 2014, 05:19:36 pm »
Sorry about that, multitasking...

Anyways, I just tested having the garage door send me an alert that it was opened. I use PLEG (which if you own vera and don't have this, you are crippled on functionality) to create complex conditions (IE turn lights off after x amount of no motion being sent and during the night). Vera doesn't allow for this function easily without Lua coding which as you know, I can't do.

I looked at the logs and I see where PLEG marked the condition as true (amongst telling the status of all my other conditions, so this isn't a viable option i don't think to trigger off of), but I don't see any notification trigger from VERA in the logs.

So, you can see from my screenshot, that PLEG is still creating a trigger in vera. I do use vera alerts to push my notifications (PLEG and vera alerts were designed by the same person so they integrate well), but it still looks like at its core, its still using vera code to generate the notification since the alerts are in the vera UI... again I could be wrong and RTS step in if you see this and I am.

I thought there would be something in the logs for when the notification was being generated and I could spark an event in VC based on that, but now that I am digging into it, my brain can't figure out how it would even be possible. If Vera Alerts can do this, that may be a doable approach to my ask.

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #32 on: February 28, 2014, 06:09:14 pm »
OK.  That mostly confused me more, and I don't really feel that you actually answered my question, but anyway, it seems that detecting the activation/deactivation of Scenes or the changing of device states does not meet your needs.

In that case, you can use VeraAlerts to send a message to VoxCommando:
- Create a new VeraAlerts profile of type: Vera-Alerts-LAN
- Rename it to VoxCommandoAlert or similar if you want
- Set the IP to the address of your VoxCommando machine on the LAN
- You can use any port you want but I used the default of 2048 which is a nice round number.
- Do whatever else you need to do to make sure this is being triggered / sent by PLEG etc. as you would with your other Vera Alerts.

In VoxCommando you need to enable the TCP plugin and then add this command to your tree:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="TCP Vera Alerts" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="245" name="create server to listen for Vera Alerts" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TCP.Server.Start</cmdType>
      <cmdString>2048</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>VC.Loaded</event>
  </command>
</commandGroup>
This command will execute automatically when VC starts and create a TCP server that listens for messages on port 2048.

What message you send exactly and what you do with it once it gets to VC is another story but probably worth crossing the first bridge or two before worrying about that

...but for example your VeraAlerts profile could use a message prefix of tts.speak&& and then VC would speak your notifications out loud.  Or if you wanted to be able to trigger commands you message prefix could be something like: VC.TriggerEvent&&VeraAlert.

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #33 on: February 28, 2014, 06:59:52 pm »
What you propose with Vera alerts serves my needs. Thank you.

Definitely check out pleg. A much needed plugin.

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: VoxCommando - Control Vera by Voice
« Reply #34 on: February 28, 2014, 07:38:45 pm »
Hi @Jitterjames

Do you actually need Vera Alerts, could you not just send/post some text over a specified IP/port to VoxCommander.  (As I'm not that technical, I may have got the terminology wrong.)

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: VoxCommando - Control Vera by Voice
« Reply #35 on: February 28, 2014, 07:39:40 pm »
I wasn't able to get this to work.

Vox is working...but I can't telnet (it OK's after every charachter) or use the VeraAlerts settings.

Screenshots attached
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline parkerc

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2479
  • Karma: +35/-48
  • Life Moves Pretty Fast....
Re: VoxCommando - Control Vera by Voice
« Reply #36 on: February 28, 2014, 07:56:34 pm »
I do know that you can send messages to VoxCommando using UDP, TCP, or HTTP messages.  To send a message to VC using luup code is quite easy, so if you were creating your own scene in Vera you could send a message to VoxCommando.

I believe you can also send messages to VoxCommando using the Vera alerts plugin for Vera.  But unless PLEG allows you to customize how or where notifications are sent so that you can redirect them to something other than an email I don't see how you can use that.

I'm not able to test it, but would something like this work from Vera.

Code: [Select]
local socket = require("socket")
host = "192.168.1.25"

local sensor = luup.variable_get("urn:upnp-org:serviceId:TemperatureSensor1","CurrentTemperature", 5)

c = assert(socket.connect(host, 2048))
c:send("the temperature is now," .. Sensor)
c:close()

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #37 on: February 28, 2014, 08:35:42 pm »
I think yes.

waynehead99 was pretty specific that he did not want to use luup.  But if you want to, then it's easy enough.

http://voxcommando.com/forum/index.php?topic=1357.msg11693#msg11693

What you posted would probably also work fine, except that I haven't tested it, and I happen to like UDP.  VC is always listening for UDP without needing to enable a plugin.

@AgileHumour: when did Telnet come into it?
« Last Edit: February 28, 2014, 08:50:22 pm by jitterjames »

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: VoxCommando - Control Vera by Voice
« Reply #38 on: February 28, 2014, 08:57:46 pm »
@jitterjames  I typically use this to test TCP IP sockets commands like VMCController.

I do make a connection so it's not a firewall, but per the example settings (and the VC code for the tcp socket)...it is currently not working with Vera Alerts as described in my screenshot (at least the test message).

@waynehead99  I just found out a day or two ago PLEG now supports Luup Code now in actions.  Would a Luup method work better if that is the case?
« Last Edit: February 28, 2014, 09:00:37 pm by AgileHumor »
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #39 on: February 28, 2014, 10:09:16 pm »
I was just looking for a way to trigger an action in VC based off a notification in Vera. Doesn't matter what's producing the notification so luup for my case. Plus I am not big on coding. If I can trigger events with Vera alerts my needs have been met.

Offline waynehead99

  • Sr. Member
  • ****
  • Posts: 296
  • Karma: +16/-1
Re: VoxCommando - Control Vera by Voice
« Reply #40 on: February 28, 2014, 10:11:21 pm »
I was just looking for a way to trigger an action in VC based off a notification in Vera. Doesn't matter what's producing the notification so luup for my case. Plus I am not big on coding. If I can trigger events with Vera alerts my needs have been met.

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #41 on: February 28, 2014, 10:22:28 pm »
I just found out a day or two ago PLEG now supports Luup Code now in actions.  Would a Luup method work better if that is the case?

If you would prefer to use this method, then go ahead.  They both work.  I noticed that the function I defined in my Vera luup startup code is not accessible from the luup code in the scene defined by the PLEG action, so if you want to it this way you will probably need to define the entire method each time, rather than just calling the function with a single line of code.

I think the choice comes down to how you want to use it.  If you already have alerts and you want to send a message to VC for all of them, then using Vera Alerts makes perfect sense.  But if you just want to add a few specific messages to VC from PLEG actions, then maybe using the luup code makes more sense.  For my humble needs so far, I have found that the scene and devices events that VC is already generating are enough.

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: VoxCommando - Control Vera by Voice
« Reply #42 on: March 01, 2014, 11:22:31 am »
Vera Alerts is not working for me.

Has anyone tried it successfully?
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker

Offline jitterjames

  • Sr. Newbie
  • *
  • Posts: 34
  • Karma: +3/-3
Re: VoxCommando - Control Vera by Voice
« Reply #43 on: March 01, 2014, 12:10:47 pm »
Yes.

Offline AgileHumor

  • Hero Member
  • *****
  • Posts: 984
  • Karma: +51/-27
  • KISS
Re: VoxCommando - Control Vera by Voice
« Reply #44 on: March 01, 2014, 12:53:42 pm »
@JitterJames thanks for posting your instructions however.   However, it is not working for me personally.  And your not providing an troubleshooting advice or confirmation my screenshot is correct.   I'm not asking if your environment is working as I assume it does (as your well versed in your product)....I'm on the forum asking for help as to why it does not as I'm not expert.


Has anyone been able to duplicate the configuration of Vera Alerts?   As of now, nobody else has confirmed it is working and I'm trying to compartmentalize the problem.

« Last Edit: March 01, 2014, 12:58:24 pm by AgileHumor »
WMC Leviton:18xVPE06,8xVRS15,3xVRP03-W,2xVRR15,4xVRCS4,2xVRCS2,VP00R,8xVRS15 Aeon:5xDSC06106,4xDSC24,4xDSC25,12xDSB29,2xDSC11,4xDSB54,DSB05,3xDSA22,DSA38,2xDSA03202B,DSB09104,HEM Other:3xYale,12xHSM100v3,7xSP103,45604,WDHA-12,SSA2USR,EVLCD1T,6xWWA02A,7xIPC-HFW2100,URTSI,Hue,Russound,OpenSprinker