Announcement

Collapse
No announcement yet.

Accessing HS Object on Remote Computer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Accessing HS Object on Remote Computer

    I am running HS 2.4.0.6 on an Windows XP computer. Via a script I want to access device status on another machine running Vista(64 bit). I have an operating Speaker Client on the Vista machine.

    On the Vista machine, I have the script(HS.vbs) being run from a one line batch file that looks like:

    %windir%\SysWoW64\cscript.exe c:\users\bob\desktop\HS.vbs
    (SysWoW64 seems to be necessary to create the HS Object)

    The script HS.vbs:

    dim hsi
    Set hsi = CreateObject("HomeSeer2.application")
    hsi.SetHost ("EntCenter")
    rval = hsi.Connect("","")
    if rval <> "" then
    MsgBox(rval)
    End If
    hsi.speak("Connected")
    Set hs = hsi.GetHSRef '******ERROR HERE
    hs.speak("Hello World")
    Set hs=nothing

    The script runs and seems to connect and speaks "Connected". But I get an error that "the class does not support 'GetHSRef' ..."
    Does anyone understand what I am doing wrong?

    Thanks for looking,
    BobSpen

    #2
    I took your code exactly as is except changed the sethost to match my Homeseer box and it worked as designed. I got both the "Connected" and "Hello world" from the speaker.

    I did that with a remote computer running windows XP. So maybe the problem is with Vista? Sorry if it is something you already know.
    James

    Running HS 3 on Win10 .

    Comment


      #3
      What version is the speaker client on the remote machine?
      💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

      Comment


        #4
        James,
        Thanks for the confirmation--yes, I suspect Vista because I remember it running on XP before.

        Rupp,
        2.4.0.1

        Thanks,
        BobSpen

        Comment


          #5
          Rupp,
          Isn't 2.4.0.1 the latest Speaker Client release? Any ideas on what's happening here?
          Thanks,
          BobSpen

          Comment


            #6
            Sorry Bob just saw your post. There is one update to this version available on the HomeSeer downloads page but to be honest I'm not sure the speaker client changed from 2.4.0.1 and 2.4.0.6. I do not believe the speaker client version is your issue. It seems like it's more of a Vista security issue. Is UAC still running on the Vista server?
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              It could be a 64-bit issue. HS is not 64-bit friendly. In order to get my remote apps to work, I compile and build them targeted for 32-bit execution. I do this with vb.net, not sure how you do so via scripting.

              tenholde
              tenholde

              Comment


                #8
                Rupp,
                Problem is indifferent to UAC on or off. You asked about "server" but the problem is on the remote which has Vista(the server is XP). Do you have a "remote" Vista machine to try it on?

                Tenholde,
                I suspect you are right---- to get the CreateObject(HomeSeer2.Application) to execute I had to run the .vbs from "SysWoW64" which I understood would run it as a 32 bit script???

                Here's what the "SysWoW64" wiki says:
                The WoW64 subsystem is a lightweight compatibility layer that has similar interfaces on all 64-bit versions of Windows. Its primary purpose is to create a 32-bit environment that provides the interfaces required to allow 32-bit Windows applications to run unmodified in the 64-bit system. Technically, WOW64 is implemented using three dynamic-link libraries (DLLs): Wow64.dll, which is the core interface to the Windows NT kernel that translates between 32-bit and 64-bit calls, including pointer and call stack manipulations; Wow64win.dll, which provides the appropriate entry points for 32-bit applications; and Wow64cpu.dll, which takes care of switching the processor from 32-bit to 64-bit mode.

                32-bit applications that include kernel-mode device drivers, or that plug into the process space of components that are implemented purely as 64-bit processes (e.g. Windows services or Windows Explorer) cannot be executed on a 64-bit platform.

                I don't know if the above helps but maybe explains what's happening??????



                BobSpen
                Last edited by BobSpen; May 12, 2010, 05:16 PM.

                Comment


                  #9
                  Originally posted by tenholde View Post
                  It could be a 64-bit issue. HS is not 64-bit friendly. In order to get my remote apps to work, I compile and build them targeted for 32-bit execution. I do this with vb.net, not sure how you do so via scripting.

                  tenholde
                  Tenholde,
                  Do you have to run your Vista "32 bit" .NET scripts in the SysWoW64 directory with Cscript.exe?

                  BobSpen

                  Comment


                    #10
                    Originally posted by BobSpen View Post
                    Tenholde,
                    Do you have to run your Vista "32 bit" .NET scripts in the SysWoW64 directory with Cscript.exe?

                    BobSpen
                    .net scripts do not use cscript.exe, they run under the .net framework. I compile my .net scripts to use version 2.0 of the .net framework because that is the base for HomeSeer.

                    Actually, I am misleading you in that the .net scripts are not compiled by me, but by HomeSeer dynamically and use the .net 2.0 framework. I've written several .net programs that connect remotely to HomeSeer and it is these standalone .exe programs that I compile to use 32-bit code and .net framework 2.0.

                    tenholde
                    tenholde

                    Comment


                      #11
                      Rupp or Tenholde,
                      I'm still stuck here; could either or both of you give me some ideas on what to try. Could I convert my script(how?) to .net and if so how would I run it(from a .bat file?) and target it for 32 bit compilation?

                      Rupp, do you know if and when HS will bere-targeted to 64 bit?

                      Thanks again,
                      BobSpen

                      Comment


                        #12
                        One approach would be to build a .net executable program that connects to homeseer from a remote computer.

                        You can download the free MS Visual Studio Express (vb.net) to create your standalone program. You can also use the VS Express IDE and tenScripting to build and test .net scripts before copying them into your production HS environment.

                        I would be glad to help you get started. There is a learning curve, but once you get comfortable with this development environment, it will be much easier for you to extend and enhance your HomeSeer environment via .net scripting and standalone remote programs.

                        If you want to try running a remote .net program that connects to HomeSeer to make sure that your problem is not network or operating system related, you can download and run tenHsDesktop to see if you can successfully connect across your network.

                        tenholde
                        tenholde

                        Comment


                          #13
                          Tenholde,
                          That's a "tall" order. I'm not a proficient programmer(wouldn't even pretent to be a programmer but I do like to patch stuff together and get interesting solutions). I have done a bit if VBA for my own use using the 2007 Office Apps so I'm a bit familiar with VB script and can do those inside HomeSeer. Let me look at what you suggesting and see what it looks like.

                          In the mean time I did download tenHsDesktop and installed it. Pretty cool stuff, if only I could get it totally working: I'm at the point where it is seeing all my devices(can see it scan them and they are all listed in the "Options" pages) BUT it only displays (with correct icons) the two battery level devices on my two Z-wave motion sensors? Clue?

                          BobSpen

                          Comment


                            #14
                            On the GENERAL options tab, have you set the HomeSeer URL properly? Should be set to what you would enter into your browser to access the HomeSeer web server. tenHsDesktop needs this to access the HomeSeer icons. Something like:

                            http://192.168.1.25:80

                            Consists of the IP address of your homeseer computer and the port that is defined for the Homeseer web server. You should be able to enter the same into your web browser to display the HomeSeer Status Page.

                            Note also that the default Device Display parameters are to display a device only if it is ON or DIM (easily changeable by default, or a device at a time).
                            tenholde

                            Comment


                              #15
                              Originally posted by BobSpen View Post
                              Tenholde,
                              BUT it only displays (with correct icons) the two battery level devices on my two Z-wave motion sensors? Clue?

                              BobSpen
                              Pick a device that you can easily turn ON and OFF

                              Make sure the device is selected for monitoring (Options/Select Devices)

                              Turn it ON. It should now display.

                              Now define the criteria for when/how to display the device (Options/Device Display/Criteria). Select the Based on Status radio button. Enter: 0:17 in the Format 1 textbox. Click on Refresh Device Panel. Select the Display tab. Enter the following into the Format 1 textbox: My Device: %i0 %t Click on Refresh Device Panel.

                              Is the Device displayed now in the Display Panel?

                              tenholde
                              tenholde

                              Comment

                              Working...
                              X