Author Topic: Sample Vera HA Logic Threads  (Read 6460 times)

0 Members and 1 Guest are viewing this topic.

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Sample Vera HA Logic Threads
« on: February 24, 2014, 10:16:17 PM »
Samples:
* Dim 'Downstairs Hallway Light' to '15' percent (Sample Video #1)
* Turn 'Living Room Lamp' 'On'  (Sample Video #1)
* Run Scene 'Goodnight'
* 'Raise' 'Dining Room' Window  (Sample Video #2)
* Turn 'On' 'Downstairs Hallway Light'

X = Device
Y = Action/Level

Note - Most Star Trek wave files downloaded from here: http://www.stdimension.org/MediaLib/technologye.htm

Dim X to Y (i.e Dim 'Downstairs Hallway Light' to '15' percent) - Based off youtube demo by Jitterjames
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="115" name="Dim X to Y" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Vera.Dim</cmdType>
    <cmdString>{1}&amp;&amp;{2}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PlayWav</cmdType>
    <cmdString>{Path.PFx86}\VOX\Wav\tricscan1.wav&amp;&amp;false</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Dim, Adjust Light</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera\dimmable.xml</payloadFromXML>
  <phrase>to</phrase>
  <payloadRange>0,100</payloadRange>
  <phrase optional="true">percent</phrase>
</command>

Turn X Y   (i.e Turn 'Downstairs Hallway Light' 'On')
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="88" name="Turn X Y" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Vera.SetState</cmdType>
    <cmdString>{1}&amp;&amp;{2}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PlayWav</cmdType>
    <cmdString>{Path.PFx86}\VOX\Wav\tricscan1.wav&amp;&amp;false</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Turn, Switch</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera\switches.xml</payloadFromXML>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\OnOff.xml</payloadFromXML>
</command>

Run Scene X (i.e. Run Scene 'Goodnight')
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="98" name="Run Scene X" 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>Sound.PlayWav</cmdType>
    <cmdString>{Path.PFx86}\VOX\Wav\tricscan1.wav&amp;&amp;false</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Run Scene, Automate, Execute Scene</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera\scenes.xml</payloadFromXML>
</command>

Y X Window - (i.e. 'Raise' 'Dining Room' Window)
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="140" name="Raise or Lower X Window Blind" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Vera.Raw</cmdType>
    <cmdString>data_request?id=action&amp;output_format=xml&amp;DeviceNum={2}&amp;serviceId=urn:upnp-org:serviceId:WindowCovering1&amp;action={1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PlayWav</cmdType>
    <cmdString>C:\Program Files (x86)\VOX\wav\beam1a.wav&amp;&amp;false</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Vera.Raw</cmdType>
    <cmdString>data_request?id=action&amp;output_format=xml&amp;DeviceNum={2}&amp;serviceId=urn:upnp-org:serviceId:WindowCovering1&amp;action={1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\RaiseLower.xml</payloadFromXML>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera\blinds.xml</payloadFromXML>
  <phrase>Window</phrase>
  <phrase optional="true">Blinds</phrase>
</command>
« Last Edit: February 27, 2014, 02:45:58 AM by AgileHumor »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sample Vera HA Logic Threads
« Reply #1 on: February 24, 2014, 10:25:50 PM »
Thanks.  I think it might help others if you also attach
- raiselower.xml
- OnOff.xml

I don't remember if OnOff.xml is standard.

I guess blinds.xml is just a subset of your devices.xml?

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: Sample Vera HA Logic Threads
« Reply #2 on: February 25, 2014, 12:41:05 AM »
Good idea James!

OnandOff.xml
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--A VoxCommando Payload file-->
<PayloadsRoot>
    <payload>
        <value>0</value>
        <phrase>Off</phrase>
    </payload>
    <payload>
        <value>1</value>
        <phrase>On</phrase>
    </payload>
</PayloadsRoot>

RaiseLower.xml
Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<!--A VoxCommando Payload file-->
<PayloadsRoot>
    <payload>
        <value>Up</value>
        <phrase>Raise</phrase>
    </payload>
    <payload>
        <value>Down</value>
        <phrase>Lower</phrase>
    </payload>
    <payload>
        <value>Stop</value>
        <phrase>Stop</phrase>
    </payload>
</PayloadsRoot>


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sample Vera HA Logic Threads
« Reply #3 on: February 25, 2014, 08:52:33 AM »
It is good practice to paste command or group xml into code blocks on the forum (as you have done) because it makes it very easy to copy and paste them to between the VC command editor and the forum, but with external files such as payloadXML files it is easier (for everyone) to attach files to your post.  If a user wants to use your code now they will need to create a blank document, paste the xml into it, and then save the file, taking care to get the filename right.  You probably also had to do extra steps to put it into code blocks when posting it.

In case you were not aware, you can attach files to posts on a SMF forum by clicking on "Additional Options" which is below and to the left of the text entry box.
« Last Edit: February 25, 2014, 10:04:01 AM by jitterjames »

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: Sample Vera HA Logic Threads
« Reply #4 on: February 25, 2014, 02:37:54 PM »
Will do :)

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: Sample Vera HA Logic Threads
« Reply #5 on: February 26, 2014, 01:23:21 AM »
Turn Y X   (i.e Turn 'On' 'Downstairs Hallway Light')
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="100" name="Turn Y X" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Vera.SetState</cmdType>
    <cmdString>{2}&amp;&amp;{1}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Sound.PlayWav</cmdType>
    <cmdString>C:\Program Files (x86)\VOX\wav\processing2.wav&amp;&amp;false</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Turn, Switch</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\OnOff.xml</payloadFromXML>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">Vera\switches.xml</payloadFromXML>
</command>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sample Vera HA Logic Threads
« Reply #6 on: February 26, 2014, 09:05:41 AM »
Thanks.

One thing I recommend that you do is to name your commands using {1} and {2} instead of X and Y.  It won't change how the command is triggered, or how it works, but it changes how they are displayed when listing alternate commands.  The way you have named the command, VC will show in alternates as Turn X Y, but if you changed the name to use {}, it would display as Turn [Kitchen Light] [On]
« Last Edit: February 26, 2014, 09:27:00 AM by jitterjames »

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: Sample Vera HA Logic Threads
« Reply #7 on: February 27, 2014, 02:49:36 AM »
I added some sample videos at the top.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Sample Vera HA Logic Threads
« Reply #8 on: February 27, 2014, 04:39:27 AM »
If you use a amulet remote, you need not the prefix "computer". You can use the "AmuletUSB.exe" - it generate events in VC when you tilt the amulet.

here is a video to show you the effect: www.youtube.com/watch?v=Hw065b9b-d0

nonetheless you can use the phrase computer for the StarTrek effect.

You will find this programm by downloading the "VoxCommando Extras" from the download page: http://www.voxcommando.com/downloads.asp
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sample Vera HA Logic Threads
« Reply #9 on: February 27, 2014, 08:14:32 AM »
If you listen carefully, you can hear the communicator sound when the amulet turns on. I think Agile just likes to say computer.   ;)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sample Vera HA Logic Threads
« Reply #10 on: February 27, 2014, 08:26:23 AM »
Great videos too!

:clap ::wiggle

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Sample Vera HA Logic Threads
« Reply #11 on: February 27, 2014, 09:31:15 AM »
Yep, I forget to say - really great stuff :clap
***********  get excited and make things  **********

AgileHumor

  • Contributor
  • ***
  • Posts: 62
  • Karma: 3
    • View Profile
Re: Sample Vera HA Logic Threads
« Reply #12 on: February 27, 2014, 11:58:08 AM »
Since most folks aren't used to speaking to a computer...I thought I'd model it off the Enterprise.

And yes, it is the communicator sound when the Amulet goes vertical.  I'm planning to purchase an open air mic, so practicing prefix "computer" to stay consistent.

Sadly, I still need to edit the videos as the last commands in each didn't fire correctly.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Sample Vera HA Logic Threads
« Reply #13 on: February 27, 2014, 12:05:41 PM »
Some times ON and OFF sound similar enough to the computer that they are not 100% reliable.  I found that adding the alias Onn to on and Awf to off can help a bit.

You can always come up with other phrasings using words such as enable, disable, activate, brighten, shut off etc. if you find that you can't get on and off to work reliably enough.  Note that you can use aliases in payloadXML files for phrases by using a comma just as you can in regular phrases in your tree.