www.homeseer.com  
 

Go Back   HomeSeer Message Board > Lighting & Primary Technology Plug-ins > Insteon General Discussion > Insteon PLM Plug-in by Mark Sandler

Insteon PLM Plug-in by Mark Sandler Discussions related to Mark Sandler's 3rd parth plug-in for controlling Insteon devices via Smarthome's PLM interfaces (the 2412 & 2413 series controllers)

Reply
 
Thread Tools Display Modes
  #1  
Old October 9th, 2012, 08:55 PM
Ferrari100 Ferrari100 is offline
Seer
 
Join Date: Nov 2011
Location: New York
Posts: 6
Default Insteon scripting

Where can I find some insteon scripting commands. I am looking for basic stuff. Turn on a light switch, turn on to 50%. I searched all over and could find anything. Any help would be great. Thanks
Reply With Quote
  #2  
Old October 9th, 2012, 09:16 PM
mnsandler's Avatar
mnsandler mnsandler is offline
Insteon Overlord
 
Join Date: Apr 2005
Location: Virginia
Posts: 6,955
Default

here is the protocol for transmitting an insteon cmd via script. this should cover just any thing you want to do.

Public Sub TransmitInsteonCommand(ByVal HC As String, ByVal DC As String, ByVal InsteonCmd1 As Byte, ByVal InsteonCmd2 As Byte)

you can find the insteon cmd set here:
http://www.insteon.net/pdf/INSTEON_C..._20070925a.pdf
www.madreporite.com/insteon/commands.htm

there are new script functions for setting and getting device op flags and settings. see the latest plugin release notes.

hope this helps
__________________
Mark

HS3 Pro 3.0.0.96
Hardware: Insteon PLM | HAI Omnistat2 | Vista Alarm 20P (soon) | 1-Wire Master Hub (soon)
Plugins: Insteon 3.0.5.0 (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | BLRadar
Platform: Windows 2003 Server, 3.4Ghz, 3GB memory
Reply With Quote
  #3  
Old October 10th, 2012, 08:54 AM
Ferrari100 Ferrari100 is offline
Seer
 
Join Date: Nov 2011
Location: New York
Posts: 6
Default Almost got it

Can you post a quick example to turn on a light to 50%? Would it be something like:

hs.plugin("Insteon").setdevicevalue "Insteon ID", "Value", "50%"


Or am I way off.

Thanks.
Reply With Quote
  #4  
Old October 10th, 2012, 09:15 AM
mnsandler's Avatar
mnsandler mnsandler is offline
Insteon Overlord
 
Join Date: Apr 2005
Location: Virginia
Posts: 6,955
Default

if you just want to use standard hs functions/methods, you could do the following

hs.setdevicevalue A1, 50

where a1 is the devicecode for the insteon hs device, and 50 is the On level

all the hs script commands are documented in the hs help so i won't go into them here.

the script cmds avail via the plugin are the following:

hs.plugin("Insteon").TransmitInsteonCommand
hs.plugin("Insteon").setdevicesetting
hs.plugin("Insteon").getdevicesetting
hs.plugin("Insteon").setdeviceopflag
hs.plugin("Insteon").getdeviceopflag

these are for transmitting special insteon cmds to the device or more direct control of the device settings (typically changed via the plugin UI)

holpe this helps
__________________
Mark

HS3 Pro 3.0.0.96
Hardware: Insteon PLM | HAI Omnistat2 | Vista Alarm 20P (soon) | 1-Wire Master Hub (soon)
Plugins: Insteon 3.0.5.0 (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | BLRadar
Platform: Windows 2003 Server, 3.4Ghz, 3GB memory
Reply With Quote
  #5  
Old October 10th, 2012, 09:13 PM
Ferrari100 Ferrari100 is offline
Seer
 
Join Date: Nov 2011
Location: New York
Posts: 6
Default All Good

Thank you, I think I got it now.
Reply With Quote
  #6  
Old November 23rd, 2012, 11:30 PM
Bill Grant Bill Grant is offline
Seer
 
Join Date: Oct 2012
Location: Vancouver Island, BC Canada
Posts: 15
Default

I need some help getting this script to execute from other stations on my LAN. I keep getting the "cannot create object" error if i try to run it from any computer other than the HS2 host.
Code:
dim hs
set hsi = createobject ("HomeSeer2.application")
hsi.SetHost "192.168.5.3"
rval = hsi.Connect("default","default")
if rval <> "" then
msgbox rval
end if
Set hs = hsi.GetHSRef
if hs.ison("\2") then hs.execx10 "\2","off",0 else hs.execx10 "\2","on",0
Thanks for your assistance.
Reply With Quote
  #7  
Old November 23rd, 2012, 11:53 PM
pbibm's Avatar
pbibm pbibm is offline
Super Seer
 
Join Date: Dec 2004
Location: Dearborn, Mi
Posts: 1,510
Default

HI Bill,

the object references you are making in your script are frin the homeseer executable running on your server. They will typically only run on the computer running Homeseer and plugins.


You can look at something like this to see if that will work for you
__________________
Paul

Reply With Quote
  #8  
Old November 24th, 2012, 03:07 PM
Bill Grant Bill Grant is offline
Seer
 
Join Date: Oct 2012
Location: Vancouver Island, BC Canada
Posts: 15
Default

Thanks for the tip. Still no go. If I run the script from from a batch file referencing the script on the local machine, I get the "Microsoft VBScript runtime error: ActiveX
component can't create object: 'HomeSeer2.application'" error.

If I run the script from from a batch file referencing the script on the remote (HS2) machine, I get "CScript Error: Execution of the Windows Script Host failed. (Not enough storage
is available to complete this operation. )"

The script runs fine on the HS2 (XP) machine, either from a batch file or directly.

This has to be doable... it seems so simple.
Reply With Quote
  #9  
Old January 19th, 2013, 11:57 AM
norman100 norman100 is offline
Seer
 
Join Date: Nov 2002
Location: kettering,Oh,USA
Posts: 11
Default Insteon Scripting

Could someone give me an example using the transmitinsteoncommand below? I somewhat understand the insteon hex commands from the insteon developers guide, but I would like to see what exactly goes in the HC and DC.

TransmitInsteonCommand(ByVal HC As String, ByVal DC As String, ByVal InsteonCmd1 As Byte, ByVal InsteonCmd2 As Byte)

What I am trying to accomplish is sending a lock command to a keypadlinc. I successfully locked all of my dimmers using the built-in insteon action - send device command, but the keypads will not. It appears that the lock function (20 00) only works using a direct command which is what is sent to the dimmers, but for keypadlincs the send device command uses a group message (02 62 00 00 07 CF 20 00).

Although, it is possible that the keypads won't lock even with a direct command.
PS. using insteon plugin 1.7.3.1

Steve
Reply With Quote
  #10  
Old January 19th, 2013, 01:15 PM
mnsandler's Avatar
mnsandler mnsandler is offline
Insteon Overlord
 
Join Date: Apr 2005
Location: Virginia
Posts: 6,955
Default

the hc/dc is the housecode/unitcode found on the hs status page. usually a character like / _ and then the unit code is a number

there is also an insteon action that might make this easier
__________________
Mark

HS3 Pro 3.0.0.96
Hardware: Insteon PLM | HAI Omnistat2 | Vista Alarm 20P (soon) | 1-Wire Master Hub (soon)
Plugins: Insteon 3.0.5.0 (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | BLRadar
Platform: Windows 2003 Server, 3.4Ghz, 3GB memory
Reply With Quote
  #11  
Old January 19th, 2013, 02:33 PM
norman100 norman100 is offline
Seer
 
Join Date: Nov 2002
Location: kettering,Oh,USA
Posts: 11
Default

Ok, the HC is the hex code from the status page and the DC is the device category? or the message flags and/or to - from addresses? I assume that since the HC is given then you don't need the addresses.

Sorry if I am missing something here, but I did try the Insteon action of "send device comand" as mentioned earlier. It will not send a direct command to a keypadlinc, instead it will send a group message. If I use a built in command to change the backlight it will send a direct command. I believe I also need to send a direct command to change the lock opcode.

Steve
Reply With Quote
  #12  
Old January 19th, 2013, 03:03 PM
mnsandler's Avatar
mnsandler mnsandler is offline
Insteon Overlord
 
Join Date: Apr 2005
Location: Virginia
Posts: 6,955
Default

steve can you post a screen shot of the hs status page showing the main on/off device of the kpl
__________________
Mark

HS3 Pro 3.0.0.96
Hardware: Insteon PLM | HAI Omnistat2 | Vista Alarm 20P (soon) | 1-Wire Master Hub (soon)
Plugins: Insteon 3.0.5.0 (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | BLRadar
Platform: Windows 2003 Server, 3.4Ghz, 3GB memory
Reply With Quote
  #13  
Old January 19th, 2013, 07:38 PM
norman100 norman100 is offline
Seer
 
Join Date: Nov 2002
Location: kettering,Oh,USA
Posts: 11
Default

I would if I could, but apparently I do not have the
privileges to attach anything to my posts.
I don't have a "Manage Attachment" under additional options.
I only have: Miscellaneous Options, Thread Subscriptions and Rate Thread.

I created this account back in 2002 and this is the first time I have actually used it. My account profile list me a "Viewer".

Who do I contact to fix this?

Steve
Reply With Quote
  #14  
Old January 19th, 2013, 11:00 PM
mnsandler's Avatar
mnsandler mnsandler is offline
Insteon Overlord
 
Join Date: Apr 2005
Location: Virginia
Posts: 6,955
Default

Rupp should be able to assist with the posting attachment issue
__________________
Mark

HS3 Pro 3.0.0.96
Hardware: Insteon PLM | HAI Omnistat2 | Vista Alarm 20P (soon) | 1-Wire Master Hub (soon)
Plugins: Insteon 3.0.5.0 (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | BLRadar
Platform: Windows 2003 Server, 3.4Ghz, 3GB memory
Reply With Quote
  #15  
Old January 20th, 2013, 07:47 PM
Rupp's Avatar
Rupp Rupp is online now
OverSeer
 
Join Date: Jan 2001
Location: Huntsville, Al. USA
Posts: 35,523
Default

Quote:
Originally Posted by norman100 View Post
I would if I could, but apparently I do not have the
privileges to attach anything to my posts.
I don't have a "Manage Attachment" under additional options.
I only have: Miscellaneous Options, Thread Subscriptions and Rate Thread.

I created this account back in 2002 and this is the first time I have actually used it. My account profile list me a "Viewer".

Who do I contact to fix this?

Steve
You have to have 8 or 10 posts before you are allowed to post attachments. So post a few blank posts and the ability to attach will show up.
__________________
-Rupp
Reply With Quote
  #16  
Old January 20th, 2013, 09:58 PM
norman100 norman100 is offline
Seer
 
Join Date: Nov 2002
Location: kettering,Oh,USA
Posts: 11
Default

post 8
Reply With Quote
  #17  
Old January 20th, 2013, 09:59 PM
norman100 norman100 is offline
Seer
 
Join Date: Nov 2002
Location: kettering,Oh,USA
Posts: 11
Default

post 9
Reply With Quote
  #18  
Old January 20th, 2013, 09:59 PM
norman100 norman100 is offline
Seer
 
Join Date: Nov 2002
Location: kettering,Oh,USA
Posts: 11
Default

post 10
Reply With Quote
  #19  
Old January 20th, 2013, 10:02 PM
norman100 norman100 is offline
Seer
 
Join Date: Nov 2002
Location: kettering,Oh,USA
Posts: 11
Default

Nothing yet, will try later.
Thanks
Reply With Quote
  #20  
Old January 20th, 2013, 10:07 PM
Rupp's Avatar
Rupp Rupp is online now
OverSeer
 
Join Date: Jan 2001
Location: Huntsville, Al. USA
Posts: 35,523
Default

Try now.
__________________
-Rupp
Reply With Quote
Reply

Bookmarks

Tags
insteon, scripts

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 11:11 PM.

Untitled Document
NEW!
New Products


Copyright HomeSeer Technologies, LLC