www.homeseer.com  
 

Go Back   HomeSeer Message Board > Developer Support > Scripts & Plug-Ins:Development and Libraries > Script & Plug-In Development

Script & Plug-In Development Discuss scripting for HomeSeer and general VBScript assistance. Use this forum to post incomplete scripts, script snippets or code samples.

Reply
 
Thread Tools Display Modes
  #1  
Old November 6th, 2008, 05:27 PM
herbus herbus is offline
Seer
 
Join Date: Sep 2005
Location: The Netherlands
Posts: 72
Default Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME)

Hi,

I have written a simple Jscript:

// JScript test
if (hs.ison ("A1"))
hs.execx10 ("A1","off",0)
else
hs.execx10 ("A1","on",0)

The good news: It works! But: every time it runs I get the message:

6-11-2008 22:11:58 - Info - Event Trigger "Test script ATS"
6-11-2008 22:11:58 - Info - Running script in background: test.js
6-11-2008 22:11:58 - Debug TI103 - SendX10: A1 Cmd: 2 Dim: 0 Data1/2: 0/0
6-11-2008 22:11:58 - Error - Running script, script run or compile error in file: test.js0: in line 0 More info: Onbekende naam. (Uitzondering van HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))

What's going wrong? Thanks for your help.

Herbus, The Netherlands
HS 2.2.066
ACT TI203, DooNetwork

Last edited by herbus; November 6th, 2008 at 05:38 PM.
Reply With Quote
  #2  
Old November 6th, 2008, 05:58 PM
rmasonjr's Avatar
rmasonjr rmasonjr is offline
OverSeer
 
Join Date: May 2001
Location: Brookhaven, MS USA
Posts: 3,798
Default

I think you need an 'End If' after the last line...
__________________
GearHouse Club Member
Half HS2, Half HS3, Half not good with fractions
Reply With Quote
  #3  
Old November 8th, 2008, 06:02 AM
herbus herbus is offline
Seer
 
Join Date: Sep 2005
Location: The Netherlands
Posts: 72
Default

Thanks, I have tried your suggestion.
Unfortunately it doesn't work.

8-11-2008 11:48:50 - Error - Running script, script run or compile error in file: test.js5009:'endif' is niet gedefinieerd in line 11 More info: 'endif' is niet gedefinieerd
Sorry it's in Dutch. Translated it says: Endif isn't defined. Tried End if also. Here the message is:

8-11-2008 11:49:36 - Error - Running script, script run or compile error in file: test.js1004:';' wordt verwacht in line 11 More info: ';' wordt verwacht

Checked the microsoft msdn at http://msdn.microsoft.com/en-us/libr...hk(VS.85).aspx
Endif or end if isn't described here. Seems that if/else doesn't need an endif.

Any suggestions?
Reply With Quote
  #4  
Old November 8th, 2008, 06:34 AM
stipus stipus is offline
OverSeer
 
Join Date: Aug 2003
Location: FRANCE
Posts: 4,260
Default

If you want to write your HomeSeer scripts using the c syntax, I suggest you try the script connector plugin.

It supports both VB and c# scripts.
__________________
--
stipus
Running HS 2.2.0.66 with CM11a - PLCBUS 1141 - RFXCOM RF interface - Digimax 210 & RFX Temp Sensor, ACRF Plugin - Touchpad
Instant Messaging Connector - Direct Input Connector - Bluetooth Connector - SIP Voice over IP Connector - Skype Connector - Script Connector - PLCBUS Connector
Reply With Quote
  #5  
Old November 8th, 2008, 06:41 AM
herbus herbus is offline
Seer
 
Join Date: Sep 2005
Location: The Netherlands
Posts: 72
Default

Does it support Jscript?
Unfortunately I have to use Jscript. I'm preparing a script to communicate with the communication engine that's connected to my alarm panel.
Reply With Quote
  #6  
Old November 8th, 2008, 06:44 AM
stipus stipus is offline
OverSeer
 
Join Date: Aug 2003
Location: FRANCE
Posts: 4,260
Default

No sorry, it doesn't support J-Script. Only VB and c#

But usualy you can do everything that J-script does using c#. I'm not sure about your specific application though.
__________________
--
stipus
Running HS 2.2.0.66 with CM11a - PLCBUS 1141 - RFXCOM RF interface - Digimax 210 & RFX Temp Sensor, ACRF Plugin - Touchpad
Instant Messaging Connector - Direct Input Connector - Bluetooth Connector - SIP Voice over IP Connector - Skype Connector - Script Connector - PLCBUS Connector
Reply With Quote
  #7  
Old November 8th, 2008, 07:00 AM
herbus herbus is offline
Seer
 
Join Date: Sep 2005
Location: The Netherlands
Posts: 72
Default

Ok, thanks.

It should be possible to get a simple 4 lines Jscript work without errors!
Help is very welcome to solve this problem.
Reply With Quote
  #8  
Old November 8th, 2008, 07:08 AM
stipus stipus is offline
OverSeer
 
Join Date: Aug 2003
Location: FRANCE
Posts: 4,260
Default

The c syntax uses ; at the end of all statements.

Did you try:

// JScript test
if (hs.ison ("A1"))
hs.execx10 ("A1","off",0);
else
hs.execx10 ("A1","on",0);
__________________
--
stipus
Running HS 2.2.0.66 with CM11a - PLCBUS 1141 - RFXCOM RF interface - Digimax 210 & RFX Temp Sensor, ACRF Plugin - Touchpad
Instant Messaging Connector - Direct Input Connector - Bluetooth Connector - SIP Voice over IP Connector - Skype Connector - Script Connector - PLCBUS Connector
Reply With Quote
  #9  
Old November 8th, 2008, 07:11 AM
stipus stipus is offline
OverSeer
 
Join Date: Aug 2003
Location: FRANCE
Posts: 4,260
Default

Also, I'm not sure if J# is case sensitive, and if it supports optional arguments.

I would write:

// JScript test
if (hs.IsOn ("A1"))
hs.ExecX10 ("A1","off",0,0,false);
else
hs.ExecX10 ("A1","on",0,0,false);
__________________
--
stipus
Running HS 2.2.0.66 with CM11a - PLCBUS 1141 - RFXCOM RF interface - Digimax 210 & RFX Temp Sensor, ACRF Plugin - Touchpad
Instant Messaging Connector - Direct Input Connector - Bluetooth Connector - SIP Voice over IP Connector - Skype Connector - Script Connector - PLCBUS Connector
Reply With Quote
  #10  
Old November 8th, 2008, 11:22 AM
herbus herbus is offline
Seer
 
Join Date: Sep 2005
Location: The Netherlands
Posts: 72
Default

I've tried both. A1 is turned on and off just like my script.
But.........same error message appears.
Reply With Quote
  #11  
Old November 8th, 2008, 12:03 PM
stipus stipus is offline
OverSeer
 
Join Date: Aug 2003
Location: FRANCE
Posts: 4,260
Default

I love challenges... I never tried j-scripts before, but the following works fine with HS2.2.0.135

testjs.js
Code:
function Main( param )
{
  // JScript test
  if (hs.IsOn ("A1"))
    hs.ExecX10 ("A1","off",0,0,false);
  else
    hs.ExecX10 ("A1","on",0,0,false); 
}
I got the idea to add the Main function by looking at your error code... DISP_E_UNKNOWNNAME is the COM error when a property or method is not found within an object. Also the fact that it was working fine... your code was executing as global code, and then HS tried to call Main() and it was not found.
__________________
--
stipus
Running HS 2.2.0.66 with CM11a - PLCBUS 1141 - RFXCOM RF interface - Digimax 210 & RFX Temp Sensor, ACRF Plugin - Touchpad
Instant Messaging Connector - Direct Input Connector - Bluetooth Connector - SIP Voice over IP Connector - Skype Connector - Script Connector - PLCBUS Connector

Last edited by stipus; November 8th, 2008 at 12:15 PM.
Reply With Quote
  #12  
Old November 9th, 2008, 08:04 AM
herbus herbus is offline
Seer
 
Join Date: Sep 2005
Location: The Netherlands
Posts: 72
Default

Your great! Thanks Stipus this solved the problem.
I'm very happy and a little dissapointed that I didn't found it myself
Thanks!
Reply With Quote
Reply

Bookmarks

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 04:47 PM.

Untitled Document
NEW!
New Products


Copyright HomeSeer Technologies, LLC