Author Topic: Vera and Building Voice Commands  (Read 9361 times)

0 Members and 1 Guest are viewing this topic.

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Vera and Building Voice Commands
« on: October 22, 2013, 12:19:39 PM »
I'm brand new to VoxCommando but with the XBMC functionality built-in, I went ahead and bought it    8)

When I had installed the XMBC plugin, I see numerous commands already created for me [open VoxCommando and then select Edit from the menu bar] and it's working fantastically

I installed the Vera plugin and was able to connect to my Vera unit and Generate XML and Update. I can see events while they happen in VoxCommando as well. However, I don't see any pre-built commands from my devices and/or scenes. Do I have to manually create these or is there a way to automate their creation?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Vera and Building Voice Commands
« Reply #1 on: October 22, 2013, 12:30:41 PM »
There are no pre-configured commands for Vera, so yes, you'll have to create them yourself.

And since people  tend to have different devices and scenes anyhow, it wouldn't necessarily make sense.

Hopefully there's enough documentation available that it will be fun rather than overwhelming, but let us know if you run into obstacles you can't overcome.

See http://voxcommando.com/mediawiki/index.php?title=Plugin_Vera

There are also video tutorials on editing/creating your own commands. (See "Editing Commands" in the wiki for links to the videos and more info.)

Here is one example Vera command that you could dissect to get a sense of things. Note that in our house, device ID 51 is my bedroom fan. Scene 1 is a Vera scene that gradually turns off all the lights in the house as we get ready for bed.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="433" name="Bedtime" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Vera.Scene</cmdType>
    <cmdString>1</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Vera.Get.Temperature</cmdType>
    <cmdString>55</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="True">
    <ifType>(A)&lt;(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;21</ifParams>
    <then>
      <action>
        <cmdType>TTS.SpeakSync</cmdType>
        <cmdString>It's pretty warm in here, so I'm turning on the bedroom fan.</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Vera.SetState</cmdType>
        <cmdString>51&amp;&amp;1</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <cmdString>It's only {LastResult} degrees, so I won't turn on the bedroom fan.</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Good night Acer, Sweet dreams, Time for bed</phrase>
</command>

You can select and copy the above code and paste it directly into your command tree.
« Last Edit: October 22, 2013, 12:33:33 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2009
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Vera and Building Voice Commands
« Reply #2 on: October 22, 2013, 12:57:18 PM »
You can actually generate "maps" that associate device IDs and scenes with friendly names to make it easier to build commands. This is done in the plugin settings (one map for devices, another for scenes).

To learn how to use maps, see the Introduction to Maps video tutorial:
&index=6

The command I provided above was created before the map feature was added and so it doesn't use the maps. It's not necessary to use them, but it does make things easier once you know how, particularly if you have a lot of devices or scenes.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: Vera and Building Voice Commands
« Reply #3 on: October 22, 2013, 01:27:57 PM »
Thank you very much for this! First time going through so a couple of observations from my newbie eyes:

Perhaps the "Edit" menu bar could be named something different? When I first went and clicked on it, I didn't really know what I was Editing. But the old adage RTFM is probably in place here and I'm guilty  :o

I created my Vera group and added a Kitchen Lights On and Kitchen Lights Off action and expected the command name to be the text it was looking for. Checked out one of the tutorials and slowly started sinking in and found where to enter the Phrases.

I have to say this is very cool! My PC running VoxCommando is in a closet and I plan to get a bluetooth speaker so I can have audio nearby.
« Last Edit: October 22, 2013, 01:40:43 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Vera and Building Voice Commands
« Reply #4 on: October 22, 2013, 01:41:41 PM »
Once you have generated your payloadXML file you can use this command to turn devices on and off.  Select everything in the code box below and then paste it into your command tree in VoxCommando.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="VERALITE" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="36" name="Turn {1} On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Vera.SetState</cmdType>
      <cmdString>{1}&amp;&amp;1</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera\devices.xml</payloadFromXML>
    <phrase>On</phrase>
  </command>
  <command id="53" name="Turn {1} Off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Vera.SetState</cmdType>
      <cmdString>{1}&amp;&amp;0</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Turn</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera\devices.xml</payloadFromXML>
    <phrase>Off</phrase>
  </command>
</commandGroup>

macrho

  • $upporter
  • Contributor
  • *****
  • Posts: 75
  • Karma: 0
    • View Profile
Re: Vera and Building Voice Commands
« Reply #5 on: October 22, 2013, 01:47:51 PM »
That's AWESOME! I now need to go and name my devices with cleaner names
Thanks much

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Vera and Building Voice Commands
« Reply #6 on: October 22, 2013, 02:22:12 PM »
Note that you can rename the devices in the payloadXML file.  You don't necessarily have to rename them on Vera, except for your own sake, to keep things straight.

You can put multiple names in the phrase column of the payloadXML file by separating them with commas in order to allow multiple "alias" names for a device.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Vera and Building Voice Commands
« Reply #7 on: October 22, 2013, 04:18:22 PM »
Here's an update of the Vera plugin.

One new thing it does is create multiple payloadXML files for different types of devices (e.g. dimmable lights) and for scenes.

Just replace the file in your .\plugins\Vera folder with the attached file.
« Last Edit: October 22, 2013, 05:11:37 PM by jitterjames »