News:

HOT TIP! Exploring the commands packaged in VC's standard configurations is a great way to learn how to build your own. You can also clone a command as a starting point: just right-click and select "Clone" (or type Alt-C).

Main Menu

Using only payloads variables for vocabulary

Started by AgileHumor, February 24, 2014, 09:50:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AgileHumor

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!

jitterjames

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