Author Topic: Using VC with Insteon  (Read 9813 times)

0 Members and 2 Guests are viewing this topic.

aussie mate

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 2
    • View Profile
Using VC with Insteon
« on: March 01, 2014, 02:27:35 AM »
Not sure if this is the the right place for this - I couldn't find a section for Insteon or X10 or Home Automation

For those you want to use VC to control Insteon devices here are some tips on how to do it.
Here are some other posts on the forum that also give some help.
The best information comes from this site - http://www.leftovercode.info/smartlinc.html
 

Using the Insteon Hub which needs to be on the same network as the PC with VC.
you also will need to know what the port number to communicate with the Hub is.
if you are using Homeseer or Houselinc - you can find it listed in the setup areas - next to the IP address.

Once you have those - the rest is easy.

Using the scrape command in VC
 - you need to open LCB and select the Scrape command (don't select XML or User Agent).
Then you put the following into the "URL" box.
(dont forget to replace the "[your ip address:port#]" and "[deviceID]" with the ones you want)

For an ON command
http://[your ip address:port#]/3?0262[deviceID]0F11FF=I=3

For an OFF command
http://[your ip address:port#]/3?0262[deviceID]0F13FF=I=3

For an DIM command
 - change the FF before the 1st "=" to "40" for 25%, "7F" for 50%, "BF" for 75%, "FF" for 100%.
http://[your ip address:port#]/3?0262[deviceID]0F117F=I=3
The above will turn it on to 50%

Commands List
If you want to use the following - just change the 2 characters before the "FF=I=3"
Code   Command   Description
11   On            Turn device on, ramping up
12   Fast On   Turn device on immediately (no ramp)
13   Off            Turn device off, ramping down
14   Fast Off   Turn device off immediately (no ramp)
19   Status   Get the current status of the device (returns level)

Multiple Devices on or Off in the same command
 - this can be done but you need to separate the commands in the LCB by a pause of at least 500ms
Use the VC pause command.
It also appears to be limited to 2 separate devices at one time.

Events in Homeseer
One way to run events in HS is to use the x10 commands
just set up a virtual device and use that as a trigger for the event.
 

Hope this help - will post more as I learn..
« Last Edit: March 01, 2014, 03:16:09 AM by aussie mate »
Go Manly, NSW & the All Blacks

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Using VC with Insteon
« Reply #1 on: March 01, 2014, 08:19:02 AM »
Thanks for this post, much appreciated!

I will put a link to it on the Home Automation page of the wiki as well.
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)

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Using VC with Insteon
« Reply #2 on: April 08, 2014, 05:29:12 AM »
I have been working on this for the last three days till 4.00 am every day  :bonk

got controlling the lights and the scenes going on ... finalizing the getting status ... once all done will share the xml and the payload files
When Voice command gets tough, use hand gestures

aussie mate

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 2
    • View Profile
Re: Using VC with Insteon
« Reply #3 on: April 09, 2014, 09:48:49 AM »
Haddood - To be able to obtain the status of an Insteon device would be great - it is the one piece that is missing from my HA setup too.

 
Go Manly, NSW & the All Blacks

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using VC with Insteon
« Reply #4 on: April 09, 2014, 10:49:10 AM »
@aussie mate: Based on the documentation you posted above, you could check a device's status using a command similar to this one:

Note that you'll need to adjust the IP address (use in 2 scrape actions) and the device ID.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.2.0-->
<command id="716" name="lamplinc test get status" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="You must adjust the URL and the device ID to match your hardware.&#xD;&#xA;I am using the action Results.SetLastResult because I don't have an insteon to test with.  You can leave it so this action is skipped.">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://172.30.1.101/3?02620EA7220F19FF=I=3</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>500</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://172.30.1.101/buffstatus.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <params>
      <param>&lt;response&gt;&lt;BS&gt;02620EA7220F117F0602500EA72216A9442B117F&lt;/BS&gt;&lt;/response&gt;</param>
    </params>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>060250(......).*?(..)&lt;/BS&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>DeviceID: {Match.1.1} Level: {Match.1.2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1.2}&amp;&amp;00</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The device is off</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The device is on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>lamplinc test get status</phrase>
</command>

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Using VC with Insteon
« Reply #5 on: April 09, 2014, 11:50:44 PM »
here is my InsteOn group and related xml files...
I bet James or Kalle can improve the status command, as I did not get the string matching functions very well  :bonk

you might see a call for a function called feedback ... that is basically to call TTS with various options to give it a personality ... and I like programming or scripting with functions or subroutines concepts. much easier to debug and change



When Voice command gets tough, use hand gestures

aussie mate

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 2
    • View Profile
Re: Using VC with Insteon
« Reply #6 on: April 10, 2014, 05:16:54 AM »
thanks jitterjames for the script.
I have downloaded it but I not  still need to verify it to confirm it works correctly.

Go Manly, NSW & the All Blacks

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using VC with Insteon
« Reply #7 on: April 10, 2014, 08:13:22 AM »
"downloaded it"?  What do you mean?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using VC with Insteon
« Reply #8 on: April 10, 2014, 09:05:56 AM »
here is my InsteOn group and related xml files...
I bet James or Kalle can improve the status command, as I did not get the string matching functions very well  :bonk

you might see a call for a function called feedback ... that is basically to call TTS with various options to give it a personality ... and I like programming or scripting with functions or subroutines concepts. much easier to debug and change

Very nice!  I wish I had an insteon device to test it with...

Yes, your feedback command looks like it could be simplified somewhat.  If you look at the code I posted above I think it will help you.  It shows how you can isolate the device ID and its status value in a single regex action:
http://voxcommando.com/forum/index.php?topic=1423.msg13047#msg13047

You might also like to know about the action VC.StopMacro.  This would allow you to report an error and quit instead of having to store all those status variables.  Your choice of course, you might still want to do it the same way!

aussie mate

  • Jr. Member
  • **
  • Posts: 27
  • Karma: 2
    • View Profile
Re: Using VC with Insteon
« Reply #9 on: April 10, 2014, 07:18:07 PM »
"downloaded it"?  What do you mean?
ok - to be correct - I copied and pasted it.
 BTW - I had to update my version of VC to be able to copy it into VC.
Go Manly, NSW & the All Blacks

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using VC with Insteon
« Reply #10 on: April 10, 2014, 07:28:08 PM »
BTW - I had to update my version of VC to be able to copy it into VC.
Yes, that is correct.

Any xml produced by version 2 requires that Version 1 be updated to 1.1.9.1 or later to ensure "forwards compatibility" because we have been updating the xml structure of commands.

http://voxcommando.com/mediawiki/index.php?title=Version_2:_Features#Other_Changes

http://voxcommando.com/forum/index.php?topic=721.msg12795#msg12795

Specifically the way that action parameters are stored has changed.

Also to use {Match1.1} you need to have version 2 because this is a new feature not implemented in version 1.

In general it is a good idea to use the latest version since things can change pretty fast around here!

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Using VC with Insteon
« Reply #11 on: April 11, 2014, 12:39:32 PM »
oops I forgot to mention I did it with V1.9  :bonk
When Voice command gets tough, use hand gestures

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Using VC with Insteon
« Reply #12 on: January 09, 2015, 01:22:15 AM »
does the code work for you?

when i tried the get status and replaced with my ip address and device ID, it keeps saying 00 (off).

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using VC with Insteon
« Reply #13 on: January 09, 2015, 09:02:30 AM »
It may simply be that your insteon controller thinks the light is off.

You should look at the VoxCommando history window to see if the action is actually returning a result and that the 00 is not a {LastResult} that is left over from a previous action.

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Using VC with Insteon
« Reply #14 on: January 09, 2015, 10:59:57 AM »
this is the action result,

action result: <response><BS>026228F0CC0F19FF06025028F0CC1ECC622F0000000000000000000000000000000000000000000000000000000000000000</BS></response>

dont know why so many 0's, the brightness should be 7F

does it automatically save last action result after each action or i have to tell it to save?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using VC with Insteon
« Reply #15 on: January 09, 2015, 11:13:50 AM »
any action that modifies {LastResult} will do so automatically, but if an action fails then it will not update the {LastResult}.  Some actions do not modify {LastResult}, in this case they may still show some kind of info in the history window.

{LastResult} will remain between actions and commands until it is changed.

What kind of Insteon controller do you have, and what is the command xml that you are using?

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Using VC with Insteon
« Reply #16 on: January 09, 2015, 11:46:36 AM »
I have the insteon hub.

I have 1 command to turn the light on then immediately I use the test get status command and thats the result.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.2.7-->
<command id="399" name="Game On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="92" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch.OpenBat</cmdType>
    <params>
      <param>c:\users\soda\documents\gameon.bat</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://xxx.xxx.xxx.xxx:25105/3?026228F0CC0F117F=I=3</param>
      <param>id</param>
      <param>password</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>bon all hoi game fon dun, tung all hoi game fon dun</phrase>
</command>

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.2.7-->
<command id="729" name="lamplinc test get status" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="You must adjust the URL and the device ID to match your hardware.&#xD;&#xA;I am using the action Results.SetLastResult because I don't have an insteon to test with.  You can leave it so this action is skipped.">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://xxx.xxx.xxx.xxx:25105/3?026228F0CC0F19FF=I=3</param>
      <param>id</param>
      <param>password</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>500</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://xxx.xxx.xxx.xxx:25105/buffstatus.xml</param>
      <param>id</param>
      <param>password</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <params>
      <param>&lt;response&gt;&lt;BS&gt;026228F0CC0F117F06025028F0CC16A9442B117F&lt;/BS&gt;&lt;/response&gt;</param>
    </params>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>060250(......).*?(..)&lt;/BS&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>DeviceID: {Match.1.1} Level: {Match.1.2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1.2}&amp;&amp;00</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The device is off</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The device is on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>lamplinc test get status</phrase>
</command>

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Using VC with Insteon
« Reply #17 on: January 09, 2015, 02:19:30 PM »
It might not work with the hub.

You can try a few things.

1 - Don't switch the light and then test it immediately.  Give it a couple minutes.

2 - in the VC.Pause action change the delay parameter from 500 to 1000.

Other than that I have no idea and we have no way of testing it to try to figure it out.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Using VC with Insteon
« Reply #18 on: January 09, 2015, 02:51:04 PM »
We just follow documentation posted online to guess these things. Without having the devices, there is no way for us to know.

If you have the devices, I recommend researching for Insteon Hub documentation online (official and unofficial) and trying out the various suggestions. The issue is not VC.

For example, in this forum thread, they are suggesting there may be an alternative URL for getting device status information:

Quote
4. There is a new URL where it's easier to get device status, instead of the buffstatus.xml
http://X.X.X.X:25105/sx.xml?ABABAB=1900
(Get status for device ABABAB)

http://forum.smarthome.com/topic.asp?TOPIC_ID=13762

Maybe that will work for you. Or you could post your issue to that forum to see if your fellow Insteon Hub users can give you the proper URL.
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)

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Using VC with Insteon
« Reply #19 on: January 09, 2015, 02:57:57 PM »
ha yea i just saw that online too.

the xml is a lil different.

action result: <?xml version="1.0" encoding="ISO-8859-1" ?>
<Xs>
<X D="28F0CC25007F"/>
</Xs>

the last 2 after 2500 is the level.

I changed the Results.RegEx to this

D="(......).*?(..)"/>

and seems like it works now.


Thank you very much guys

« Last Edit: January 09, 2015, 03:24:00 PM by Soda97 »

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Using VC with Insteon
« Reply #20 on: January 09, 2015, 03:33:25 PM »
<X\sD=".*?(\w\w)"/>

o that works too.

again thank you very much guys!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Using VC with Insteon
« Reply #21 on: January 09, 2015, 03:33:46 PM »
Great. Maybe you can post the xml for your working command. That will be useful for others who have an Insteon Hub. Thanks.
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)

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Using VC with Insteon
« Reply #22 on: January 09, 2015, 03:50:52 PM »
For Insteon Hub to get device status, input your IP address (XXX.XXX.XXX.XXX), device ID (ABABAB), your hub ID and password.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.2.7-->
<command id="729" name="Get Device status" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="You must adjust the URL and the device ID to match your hardware.">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://XXX.XXX.XXX.XXX:25105/sx.xml?ABABAB=1900</param>
      <param>ID</param>
      <param>PASSWORD</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&lt;X\sD="(......).*?(\w\w)"/&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>DeviceID: {Match.1.1} Level: {Match.1.2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1.2}&amp;&amp;00</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The device is off</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>The device is on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Get device status</phrase>
</command>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Using VC with Insteon
« Reply #23 on: January 09, 2015, 04:34:34 PM »
Awesome, thanks again.

If you have multiple devices and know their device IDs, you can create a payload XML table (example attached) and then use the following command to check the status of any of the devices.

http://voxcommando.com/mediawiki/index.php?title=Payloads#More_on_Payload_XML

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.3-->
<command id="729" name="Get status of {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="You must adjust the URL and the device ID to match your hardware.">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://XXX.XXX.XXX.XXX:25105/sx.xml?{1}=1900</param>
      <param>HUB ID</param>
      <param>PASSWORD</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>&lt;X\sD=".*?(\w\w)"/&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>Device: {PF.1} Level: {Match.1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1}&amp;&amp;00</ifParams>
    <then>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>{PF.1} is off</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>{PF.1} is on</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Get status of</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\insteon_devices.xml</payloadFromXML>
</command>
« Last Edit: January 09, 2015, 09:26:57 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)

Soda97

  • Contributor
  • ***
  • Posts: 69
  • Karma: 1
    • View Profile
Re: Using VC with Insteon
« Reply #24 on: January 09, 2015, 05:45:44 PM »
wow sweet! I was going to ask you how to do that but didnt want to confuse myself.  you made it a lot easier to follow.

much appreciated.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Using VC with Insteon
« Reply #25 on: January 10, 2015, 02:57:30 AM »
For example, in this forum thread, they are suggesting there may be an alternative URL for getting device status information:
http://forum.smarthome.com/topic.asp?TOPIC_ID=13762

sweet ... it makes life easier ... 

if needed to convert dim level to percentage one can use this (passing the dim level in hex as {Match.1.2}, and get the result in {LastResult})

PY.ExecString result = round(0x{Match.1.2}/2.55,0)

here is the old way of getting status, just for reference....

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.3-->
<command id="308" name="Get Status" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Send get status 19 is the command&#xD;&#xA;02620EA7220F117F   06                       0250                0EA722          16A944         2        B                    11             7F&#xD;&#xA;Last Command     + Response Flag + Return Flag + Target Device + SmartLinc + Ack + Hop Count + DB Delta + Level&#xD;&#xA;06 success &#xD;&#xA;15 failure&#xD;&#xA;">
  <action>
    <cmdType>VC.TriggerEvent</cmdType>
    <params>
      <param>InsteOn.Do</param>
      <param>3?0262{1}0F19FF=I=3</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.Pause</cmdType>
    <params>
      <param>1000</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>VC.TriggerEvent</cmdType>
    <params>
      <param>InsteOn.Do</param>
      <param>buffstatus.xml</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.Replace</cmdType>
    <params>
      <param>&lt;/BS&gt;&lt;/response&gt;</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <params>
      <param>(......................................................).*$</param>
      <param>$1</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;0262{1}0F19FF</ifParams>
    <then>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>&lt;response&gt;&lt;BS&gt;0262{1}0F19FF</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>0250</param>
          <param>,</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>Error</param>
          <param>Status Buffer include info by a different command</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;06,</ifParams>
    <then>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>06,</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>Error</param>
          <param>Status request failed</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;{1}</ifParams>
    <then>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>{1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>Status</param>
          <param>{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>Error</param>
          <param>Status Buffer include info for another device</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>PayloadXML.GetValue</cmdType>
    <params>
      <param>{Path.VC}\payloads\InsteOnDevices.xml</param>
      <param>Hub</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>Hub</param>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{Var.Status}&amp;&amp;{Var.Hub}</ifParams>
    <then>
      <action>
        <cmdType>Results.SetLastResult</cmdType>
        <params>
          <param>{Var.Status}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>{Var.Hub}2</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.RegExReplace</cmdType>
        <params>
          <param>.*(..)$</param>
          <param>$1</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>PY.ExecString</cmdType>
        <params>
          <param>result = round(0x{LastResult}/2.55,0)</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>Error</param>
          <param>Status Request by another machine</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{Var.Error}&amp;&amp;Status</ifParams>
    <then>
      <action>
        <cmdType>Results.SetLastResult</cmdType>
        <params>
          <param>{Var.Error}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>Status</param>
      <param>0</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>Hub</param>
      <param>0</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>Error</param>
      <param>0</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;0</ifParams>
    <then>
      <action>
        <cmdType>VC.TriggerEvent</cmdType>
        <params>
          <param>feedback</param>
          <param>it is off</param>
          <param>2</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>VC.TriggerEvent</cmdType>
        <params>
          <param>feedback</param>
          <param>it is on at {LastResult}</param>
          <param>2</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>InsteOn.Get Status</event>
  <phrase>Tell me, What is</phrase>
  <phrase optional="true">the</phrase>
  <phrase>Status</phrase>
  <phrase optional="true">of</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\InsteOnDevices.xml</payloadFromXML>
  <phrase optional="true">?</phrase>
</command>

<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.3-->
<command id="335" name="Insteon Do " enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://{M:Credentials.InsteOnHubIP}/{1}</param>
      <param>{M:Credentials.InsteOnHubID}</param>
      <param>{M:Credentials.InsteOnHubPassword}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>InsteOn.Do</event>
</command>
« Last Edit: January 10, 2015, 03:19:28 AM by Haddood »
When Voice command gets tough, use hand gestures