Announcement

Collapse
No announcement yet.

NEW Script Connector Plugin V1.10.2.2

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #91
    Quick question..

    If i have a remote script with

    DevCodeStr = hs.GetINISetting("Devcodes","Device1","","C:\Temp\ARBSS.INI" )

    What computer will it look for and read from the file on.. the remote? or the HS machine.

    Likewise:

    If i have
    Dim Dtest As DirectoryInfo = New DirectoryInfo("c:\Temp")

    will it look for the directory on the Remote? or Homeseer machine?

    I'm hoping that at least one of the answers is "on the remote".. but if not.. I can work around.

    Thanks

    Andrew
    Regards,

    Andrew B.

    Comment


      #92
      Originally posted by ArbWare View Post
      Quick question..

      If i have a remote script with

      DevCodeStr = hs.GetINISetting("Devcodes","Device1","","C:\Temp\ARBSS.INI" )

      What computer will it look for and read from the file on.. the remote? or the HS machine.

      Likewise:

      If i have
      Dim Dtest As DirectoryInfo = New DirectoryInfo("c:\Temp")

      will it look for the directory on the Remote? or Homeseer machine?

      I'm hoping that at least one of the answers is "on the remote".. but if not.. I can work around.

      Thanks

      Andrew


      All the hs.xyz() methods access the HomeSeer server.

      But all the .Net API access the local machine running the script.
      -- >
      Dim Dtest As DirectoryInfo = New DirectoryInfo("c:\Temp") access the c:\temp directory on the remote computer running the script.
      --
      stipus

      Comment


        #93
        Thank you Stipus.....

        That gives me the best of both worlds.

        A great combination.
        Regards,

        Andrew B.

        Comment


          #94
          FYI: since installing 9.2.2 and restoring my original script I've had no more errors to date.
          Real courage is not securing your Wi-Fi network.

          Comment


            #95
            Until now that is.

            This simple VB script doesn' seem to want to work.

            Sub Main( param as Object )
            hs.launch ("shutdown","-s -t 180","")
            End Sub

            When the request is sent to a single computer, the following is logged by the plugin on that computer:
            3:37:48 PM Executing Sub Main in script: remote_ComputerShutdown.vb,
            however, nothing happens. I've tried calling CALC as well with no parameters. Again nothing.

            On the other hand:
            When I send the request to multiple computers using the wildcard, the following error is produced in Homeseer (the calling computer):
            <TABLE cellSpacing=2 cellPadding=0 width="100%" border=0><TBODY><TR><TD class=LOGDateTime1 noWrap align=left>9/23/2007 3:13:47 PM </TD><TD class=LOGType1 align=left colSpan=3>NERO </TD><TD class=LOGEntry1 align=left colSpan=8>Compile Error : Scripts\remote_ComputerShutdown.vb : Scripts\remote_ComputerShutdown.vb does not exist !</TD></TR></TBODY></TABLE>

            There are four machines on my network, only one containing my script. Only NERO returned the error.
            Real courage is not securing your Wi-Fi network.

            Comment


              #96
              I really don't understand what you are trying to achieve with this script.
              With hs.launch ("shutdown","-s -t 180","") you are trying to run shutdown on the main hs server.

              all functions hs.xyz() are run on the main hs server. Not on the remote computer.

              Here is a remote_shutdown.cs script

              Code:
              void Main( object param )
              {
                  System.Diagnostics.Process.Start("Shutdown", "/r /f");
              }
              --
              stipus

              Comment


                #97
                Did I mention this was my first foray into VB?

                Thanks.
                Real courage is not securing your Wi-Fi network.

                Comment


                  #98
                  You should have a look at the Remote Script Gallery post. There are many scripts in this post, including the remote_shutdown script.
                  --
                  stipus

                  Comment


                    #99
                    Doh!
                    I ought to have thought of that.

                    This script works of course. However, I still get the script does not exist error I mentioned earlier on only one of the remote computers. All three have the plugin istalled, one contains the script, leaving one more with no error where there should be one. While this isn't much of an issue in this case, it could be in future.
                    Real courage is not securing your Wi-Fi network.

                    Comment


                      I'll double-check this.
                      --
                      stipus

                      Comment


                        This script works of course. However, I still get the script does not exist error I mentioned earlier on only one of the remote computers. All three have the plugin istalled, one contains the script, leaving one more with no error where there should be one. While this isn't much of an issue in this case, it could be in future.
                        Couldn't find the reason for this (yet).

                        When you use * as the remote computer name, the plugin loops on all registered Script clients, and I see nothing that could break the loop.

                        It must be something else, but I don't currently see it.
                        --
                        stipus

                        Comment


                          I'll keep using * where possible then, and keep a close eye on the log. I'm wondering if perhaps the machine in question may have been rebooting at the time or something of that nature. I do notice, in UltraMon, machines temporarily dropping offline according to the plugin, when in fact they're alive and well. Could be a network issue here which Remote Script happened to fall victim to.
                          Real courage is not securing your Wi-Fi network.

                          Comment


                            The Script Connector plugin is now available from the HomeSeer store.

                            Price is $29.95
                            Plugin can be found in the "Utilities" plugin section.

                            Best regards,
                            --
                            stipus

                            Comment


                              Originally posted by stipus View Post
                              Please tell me if you have any good remote script idea ... I can try working on it...

                              I have been trying to script a remote HomeSeer event log, but unfortunately the RegisterEventCB() HomeSeer API doesn't work from a remote script. I don't really understand why... and I read on the board that many have also tried this API from a remote host, and got the same error message.
                              see http://www.tenholder.net/tendevicestatuschange
                              tenholde

                              Comment


                                I'm currently working on a new version of the Script Connector, that is going to include an installer file (.msi) to easily install the Script Client on remote computers.
                                --
                                stipus

                                Comment

                                Working...
                                X