Author Topic: Using only payloads variables for vocabulary  (Read 3105 times)

0 Members and 3 Guests are viewing this topic.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Using only payloads variables for vocabulary
« on: February 24, 2014, 09:50:36 PM »
I created a action to raise and lower my blinds using Vera.

Basically, it failed using this logic:
Payload 1 = Phrase of Location of Window -> Vera Device ID
Payload 2 = Phrase Convert Raise, Lower, Stop -> Vera Blind Action of Up, Down, Stop
I had the location of windows as "Downstairs Bedroom Window" or "Dining Room Window" making the expression:
(Raise or Lower) + (Dining Room Window or Downstairs Bedroom Window)

To make it work, I had to find a common static phrase, in my case window.  I also removed the location in the payload XML to only have the location be "Dining Room" (no "Window" at the end)
Payload 1 = Phrase of Location of Window -> Vera Device ID
Payload 2 = Phrase Convert Raise, Lower, Stop -> Vera Blind Action of Up, Down, Stop
Phrase = Window

(Raise or Lower) + (Dining Room or Downstairs Bedroom) + Window (static phrase)

While I got it working using a static phrase in the middle, I was wondering if there was a way to only use payload variables only for the vocabulary logic.

Thanks!
« Last Edit: February 24, 2014, 09:55:09 PM by AgileHumor »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using only payloads variables for vocabulary
« Reply #1 on: February 24, 2014, 11:03:52 PM »
Yes. You need a phrase in every voice command.  The phrase is used to determine which command to execute when your speech is recognized.  The phrases are linked to the command id in the internal storagy thingamajigs of the speech engine object when all the grammars are defined. -- Not to get too techromogical on you.  ^-^  
Anyway we need this ID so we can go and find the definition of the actions and other command properties in order to execute it.

If you really want to say your command a certain way without having to use the word "window" then you can create two or three commands (one for each action) or you can use logic blocks etc. to analyze {LastSpoken}.  If it were me I would probably just create 3 commands.

The one time I would avoid breaking up a command like this is when you have really large payloadXML files with many items in them (e.g. songs, artists etc) because then you are creating more work for the engine and wasting resources by using this payloadXML over and over again.  In theory one should be able to create this group of items only once and then reference it but the Windows Engine can't seem to handle that the way it is supposed to. :'(

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using only payloads variables for vocabulary
« Reply #2 on: June 22, 2015, 11:39:01 AM »
The latest version 2.1.5.0 now allows you to use only payloads in a command (USE WITH EXTREME CAUTION):

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2.1.5.0

http://voxcommando.com/home/downloads/