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

0 Members and 1 Guest 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?