Author Topic: How to control two Vera on Voxcommando?  (Read 4232 times)

0 Members and 1 Guest are viewing this topic.

manfaiho

  • Jr. Member
  • **
  • Posts: 47
  • Karma: 0
    • View Profile
How to control two Vera on Voxcommando?
« on: October 10, 2013, 11:02:33 AM »
I have two Vera Lite 3 devices at home. I can configure both on Vera Plugin and capture all events from Voxcommando. However, I don't know how to send control like ON/OFF on the second Vera. I can do it for the first one but it seems no option for the second Vera. Does anyone help?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to control two Vera on Voxcommando?
« Reply #1 on: October 10, 2013, 11:24:53 AM »
Hi manfaiho.  Welcome to the community.

I believe there is an action for this but somehow it was not added to the action xml so it does not appear.

Try to use this action

Vera.SelectVera

as the parameter you can use either 1 or 2

I only have one Vera so I did not really test this which is probably why I never noticed that the action was missing from the xml.  Try it and let me know.  If it does not work I will fix it.  I will release a new version soon anyway with the correct xml.

Thanks for bringing this to my attention.

Here is a simple group that will let you select either unit.  It is up to you to keep track of the different ID numbers on different Veras.  Let me know if you need help with this.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="Select Veras" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="173" name="select Vera 1" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Vera.SelectVera</cmdType>
      <cmdString>1</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>select Vera 1</phrase>
  </command>
  <command id="196" name="select Vera 2" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Vera.SelectVera</cmdType>
      <cmdString>2</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>select Vera 2</phrase>
  </command>
</commandGroup>

manfaiho

  • Jr. Member
  • **
  • Posts: 47
  • Karma: 0
    • View Profile
Re: How to control two Vera on Voxcommando?
« Reply #2 on: October 10, 2013, 11:45:20 AM »
Thanks, Jitterjames. I create the command to add two actions: (1) Vera.SelectVera:2 (2) Vera. SetState:71,1 then Click Save and Execute. It doesn't work. I put Vera.SelectVera:1 for another Device. It works so seems not work for the second Vera. Can you help? Thanks again!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to control two Vera on Voxcommando?
« Reply #3 on: October 10, 2013, 11:53:28 AM »
I can help, but maybe not today.  I will get back to you as soon as I can.

Can you please post your command, and also the voxcommando log file?

manfaiho

  • Jr. Member
  • **
  • Posts: 47
  • Karma: 0
    • View Profile
Re: How to control two Vera on Voxcommando?
« Reply #4 on: October 10, 2013, 12:18:02 PM »
Thanks.

Here is the actions of my test commands:

<macro>
<action actiontype="Vera.SelectVera" repeat="1" logic="False"><paramstring>2</paramstring></action>
<action actiontype="Vera.SetState" repeat="1" logic="False"><paramstring>71&amp;&amp;1</paramstring></action>
</macro>

Here is the log for your analysis: My Vera1 is 192.168.1.9 and Vera2 is 192.168.1.8. I can't see it has been changed to 192.168.1.8 after SelectVera is used to switch to 2. Look forward to seeing your findings. Thanks.

10/10/2013 11:10:54 PM   VoxLog created / UAC test passed.
10/10/2013 11:13:31 PM   551   [plugin] {
  "full": 0,
  "loadtime": 1381358867,
  "dataversion": 358947631,
  "state": 2,
  "comment": "GC100[95]: Failed to open IO Port",
  "devices": [
    {
      "altid": "22",
      "id": "36",
      "subcategory": "0",
      "room": "3",
      "parent": "1",
      "status": "0",
      "watts": "0",
      "state": "-1",
      "comment": ""
    },
    {
      "altid": "3",
      "id": "4",
      "subcategory": "0",
      "room": "5",
      "parent": "1",
      "status": "0",
      "watts": "0",
      "state": "-1",
      "comment": ""
    },
    {
      "altid": "2",
      "id": "3",
      "subcategory": "0",
      "room": "5",
      "parent": "1",
      "status": "1",
      "watts": "35",
      "state": "-1",
      "comment": ""
    }
  ]
}
10/10/2013 11:13:34 PM   54   [plugin] http://192.168.1.9:3480/data_request?

id=lu_sdata&loadtime=1381358867&dataversion=358947631&timeout=600&minimumdelay=15000
10/10/2013 11:13:38 PM   812   options: loading options
10/10/2013 11:13:38 PM   823   options: verifying speech engine culture language
10/10/2013 11:13:38 PM   825   options: language available for speech: zh-TW    -中文(台灣)
10/10/2013 11:13:38 PM   826   options: language available for speech: en-US    -English (United States)
10/10/2013 11:13:38 PM   828   options: language available for speech: en-GB    -English (United Kingdom)
10/10/2013 11:13:38 PM   830   options: trying to use language:en-US
10/10/2013 11:13:38 PM   831   options: pass - specified language is valid for recognition on this system
10/10/2013 11:13:38 PM   833   successfully set language to en-US
10/10/2013 11:13:44 PM   81   doCommand:test
10/10/2013 11:13:44 PM   85   action repeat set to: 1
10/10/2013 11:13:44 PM   88   Action:  Vera.SelectVera - 2
10/10/2013 11:13:44 PM   93   action repeat set to: 1
10/10/2013 11:13:44 PM   96   Action:  Vera.SetState - 71&&1
10/10/2013 11:13:44 PM   101   [plugin] http://192.168.1.9:3480/data_request?

id=action&output_format=xml&DeviceNum=71&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1
10/10/2013 11:13:46 PM   328   no change in: launch
10/10/2013 11:13:46 PM   332   no change in: Vox Commands
10/10/2013 11:13:46 PM   336   Checking if any .cfg files need to be updated
10/10/2013 11:13:46 PM   340   srgs\launch.cfg: is OK
10/10/2013 11:13:46 PM   344   srgs\Vox Commands.cfg: is OK
10/10/2013 11:13:49 PM   60   [plugin] {
  "full": 0,
  "loadtime": 1381358867,
  "dataversion": 358947671,
  "state": 2,
  "comment": "GC100[95]: Failed to open IO Port",
  "scenes": [
    {
      "id": "76",
      "room": "6",
      "active": "1",
      "state": "4",
      "comment": "Baby Toilet Master Lamp: Transmit was ok"
    }
  ],
  "devices": [
    {
      "altid": "49",
      "id": "111",
      "subcategory": "3",
      "room": "6",
      "parent": "1",
      "armed": "1",
      "batterylevel": "100",
      "state": "-1",
      "comment": "",
      "tripped": "1",
      "lasttrip": "1381418028"
    },
    {
      "altid": "e2",
      "id": "13",
      "subcategory": "0",
      "room": "6",
      "parent": "11",
      "status": "1",
      "watts": "10",
      "state": "4",
      "comment": "Baby Toilet Fan: Transmit was ok"
    },
    {
      "altid": "11",
      "id": "11",
      "subcategory": "0",
      "room": "6",
      "parent": "1",
      "status": "1",
      "watts": "35",
      "state": "4",
      "comment": "Baby Toilet Master Lamp: Transmit was ok"
    },
    {
      "altid": "37",
      "id": "65",
      "subcategory": "0",
      "room": "3",
      "parent": "1",
      "status": "0",
      "state": "-1",
      "comment": ""
    }
  ]
}

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to control two Vera on Voxcommando?
« Reply #5 on: October 10, 2013, 05:00:21 PM »
OK.  I found a single character typo (bug) that prevented this action from working.  :bonk

Here is a new version of the plugin (version 0.1.5.1), and also an updated xml for the auto-complete actions.  Put the attached files in your plugins\vera folder, overwriting the original files:

manfaiho

  • Jr. Member
  • **
  • Posts: 47
  • Karma: 0
    • View Profile
Re: How to control two Vera on Voxcommando?
« Reply #6 on: October 10, 2013, 09:17:22 PM »
You are so awesome, jitterjames  :) It works perfectly. One thing I want to let you know for this update. I need to add SelectVera before the action for any SetState to ensure a right Vera is selected for its control. That's fine and make-sense. Thank you very much and I love Voxcommand so much.

One more question, I can see all events from Vera on Voxcommando, is it a polling or real time alert? Is it same effect with Vera's home page? I found some devices ON/OFF can't populate its state in real time (unitl the next polling interval) in Vera, I am thinking if the same issue we should see it on your plugin as well. 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to control two Vera on Voxcommando?
« Reply #7 on: October 10, 2013, 09:48:01 PM »
If you use the SelectVera action, it will remember which Vera you have selected until VoxCommando is closed and continue to send messages to that Vera until you change it again.  So you can call it in every command if you want, or only when you need to.  It will depend a lot on your particular setup.

The events are based on polling, but they should still be more or less real time.  The way that the polling works, VC asks vera for an update, and then waits until Vera has something new to report.  As soon as Vera has something new to report, VC should hear about it almost instantly, generate the event, and then perform another poll.  Each poll has a minimum delay and a maximum time that it will wait before trying again.  If multiple things change one after the other, there is a minimum delay for each poll, so in that case you might see a short delay after the first event, but then several events will arrive at once.  The polling mechanism is something that I might also fine-tune, or possibly allow the user to override the delays if they want.

The sending of a command to Vera is not dependent on the polling.  The state of polling should not have any effect on sending a command to Vera so if you are seeing delays trying to set the state of a device it is most likely caused by Vera being busy with something else and that the processing power of the Vera is relatively limited.  Usually when I set a device state it takes less than a second to turn on or off.

manfaiho

  • Jr. Member
  • **
  • Posts: 47
  • Karma: 0
    • View Profile
Re: How to control two Vera on Voxcommando?
« Reply #8 on: October 10, 2013, 10:29:57 PM »
yes, understood. You are so excellent and I like it so much  :D :D :D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: How to control two Vera on Voxcommando?
« Reply #9 on: October 10, 2013, 10:39:04 PM »
I am happy that you appreciate the program!  ::wiggle

Let me know if there is anything else that needs improvement on the Vera plugin.  It is still a work in progress.  I have not been able to dedicate enough time to it to implement everything that I would like.  Since it has been working well for my needs I have left it "as is" for a while.