Sign in to follow this  
Followers 0
JohnWPB

AutoIt communications with COM to another program

3 posts in this topic

#1 ·  Posted (edited)

Hello all you AI guru's! I am having a problem passing info to a home automation program called Home Seer. I have read through the help files, and just can not seem to get the syntax correct. I know it has to be something simple, but it seems to be a problem with passing multiple commands on a single line, in the way the quotes or parentheses are formatted.

First I opened communication with Home Seer with the following line:

$hs = ObjCreate("homeseer.application")

I then can get the status of a device, and the msg box show that correctly with the following lines:

$MyDevice = $hs.devicestatus("A3")
if $MyDevice = 3 then $MyStatus = "Off"
if $MyDevice = 2 then $MyStatus = "On"
if $MyDevice = 4 then $MyStatus = "Dimmed"
MsgBox(0, "Status", $MyStatus)

so far all is working to communicate with Home Seer to get the status of a device.

The following line I am trying with AI is not working (The ExecX10 is a command Home Seer recognizes to execute a command, as you can see below that the VBscript using the same command, and it works perfectly):

if $MyDevice = 3 then hs.execX10 "A3", "On" , 50

The following line, in VBscript works perfectly:

if MyDevice = 3 then hs.execX10 "A3", "On" , 50

I have tried all sorts of variations with placing quotes and parentheses with no luck.

Any help with the proper syntax is greatly appreciated, as I know it is something simple with the syntax that I am doing wrong here.

Edited by JohnWPB

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

if $MyDevice = 3 then $hs.execX10 "A3", "On" , 50

- or -

if $MyDevice = 3 then $hs.execX10 ("A3", "On" , 50)

Edited by weaponx

Share this post


Link to post
Share on other sites

if $MyDevice = 3 then $hs.execX10 "A3", "On" , 50

- or -

if $MyDevice = 3 then $hs.execX10 ("A3", "On" , 50)

Thank you so much! I knew it was just some sort of syntax problem! The 2nd example above worked perfectly!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0