Can I use the ActiveHome SDK in SSIS?

Started by reehus, March 17, 2011, 09:52:01 PM

Previous topic - Next topic

reehus

I am trying to make a reference to the ActiveHome in an SSIS script task.  I cannot add it as a reference until it is in the GAC, however I get an invalid format error when I try to add the ahscript.dll to it.  I tried to load the dll using the Scripts.Referencial reference but it failed to load with the error message about a missing assembly manifest.  Can I use this in an SSIS script task?  If not, what is the next best solution if I have to get values from a database to determine whether or not to turn on a light?  Any help would be GREATLY appreciated.  Thanks in advance...

reehus

Thank God I just found a way of doing this with DOS commands thanks to previous posts!!  That totally solves my problem and is WAY easier.

Thanks anyway!!

ahcmd sendplc a2 on/off that is all I needed - whoopie!!

-Bill- (of wgjohns.com)

-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

reehus

Okay, I need help again.  I used the DOS commands, but it sometimes throws an error and the debug window pops up.  I cannot have this happening because it is an automated environment and we cannot keep logging in to close the debug window (if we don't close it any commands sent do not work).

So now I am back to trying to figure out how to write the VB Script code within SSIS.

I have Microsoft Visual Studio 2005 which was installed with SQL Server - I suppose if I figure it out I can write it there?   Please help!

If anyone has any suggestions, I would REALLY appreciate it.

Thanks,
Reena

Noam

I have noticed the crashing with the AHCMD program, as well.
I've added it to the Bug List here:
http://forums.x10.com/index.php?topic=22373.0

I'll let the developers know about it, as well. (I had reported it to them back in January, but at the time I thought it might be limited to my system).

reehus

Hi Noam, thanks for your response.

I have tried using the vbscript (in the sample directory), it works great.  Now I need to find out how I can write a single .vbs script that turns the light on automatically without having to click on a button.

Would you be able to help me with this as I am new to standalone vbscript files.

Thanks so much!
Reena

Noam

Quote from: reehus on April 06, 2011, 11:40:26 AM
Hi Noam, thanks for your response.

I have tried using the vbscript (in the sample directory), it works great.  Now I need to find out how I can write a single .vbs script that turns the light on automatically without having to click on a button.

Would you be able to help me with this as I am new to standalone vbscript files.

Thanks so much!
Reena
Unfortunately, I'm not a programmer. I'm sure others here should be able to give you some advice on that, though.

reehus

Can't believe how simple it was!  Created two scripts, one called LightOn.vbs and one called LightOff.vbs.  Called these from an Execute Process Task in SSIS and it works like a charm.   :)%

Now hopefully this will work well and not give random errors like ahcmd.

Here is the code for LightOn.vbs.

' VBScript source code

Dim ActiveHomeObj

Sub Command

        Set ActiveHomeObj = CreateObject("X10.ActiveHome")

        ActiveHomeObj.SendAction "sendplc", "a4 on"

End Sub

Call Command

Noam

That's great!
I may use your code as an example to replace some of my batch files (well, CMD scripts).

reehus


reehus

Update.

If you are going to use VBScript (.vbs) then please add On Error Resume Next to the beginning of your code.

Also if you have Microsoft Visual Studio installed on your machine you must disable the Just in time bugger:

To enable/disable Just-In-Time debugging
1.   On the Tools menu, click Options.
2.   In the Options dialog box, select the Debugging folder.
3.   In the Debugging folder, select the Just-In-Time page.
4.   In the Enable Just-In-Time debugging of these types of code box, select or clear the relevant program types: Managed, Native, or Script.
To disable Just-In-Time debugging, once it has been enabled, you must be running with Administrator privileges. Enabling Just-In-Time debugging sets a registry key, and Administrator privileges are required to change that key.
5.   Click OK.

Good luck!