Announcement

Collapse
No announcement yet.

Remote Script Requests and Help

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

    #31
    It's FindWindow( windowClass, windowTitle )

    --> To find a window with a specific title, use FindWindow( null, "window title" )

    The title must be what you see in the window title bar, with exact spelling including dashes ans spaces.

    eg with www.google.com: the window title I get is "Google - Microsoft Internet Explorer"
    --
    stipus

    Comment


      #32
      What happened?

      Several nights ago all of my remote scripts stopped working... I am just now getting the time to debug them.

      The only thing weird I can see is a line in the REMOTE clients log window...

      8:49:15 AM Can't access the Script Connector:Can not connect to the remote host "gtcp://192.168.0.12:8737". System error message: No connection could be made because the target machine actively refused it.

      I saw 4 of these and then a connect message.

      Some of my scripts just do nothing...no error msg, just nothing.

      A new script I was working on it says "Does not exist" and the file name is so simple that misspelling is impossible.

      I have rebooted everyone... the server log shows everyone connecting... but the scripts don't run....

      What happened....

      ps...I think there was a microsoft update in the same time frame...

      Bob (unconnected)

      Comment


        #33
        8:49:15 AM Can't access the Script Connector:Can not connect to the remote host "gtcp://192.168.0.12:8737". System error message: No connection could be made because the target machine actively refused it.
        This means HomeSeer does not accept the connection. I have this this error message on the client only when HomeSeer was down or in the process of restarting.

        Some of my scripts just do nothing...no error msg, just nothing. A new script I was working on it says "Does not exist" and the file name is so simple that misspelling is impossible.
        I'm really puzzled about this
        Can you tell me a litle more about your setup (OS version, HS version, Script plugin version). Are you certain all remote clients have the same version as the plugin you are using ?
        --
        stipus

        Comment


          #34
          What is going on....

          After rebooting, and rebooting, now my existing scripts are running again...

          I am still getting weird error msgs from new scripts...

          either they won't compile (can't find them)
          the give invalid path errors...
          or just do nothing...

          I am trying to get the "Client list" script running to debug some other strangeness on script....

          maybe I am missing something....

          to get a client list, I need the script on a remote system, and then invoke it from anywhere?

          Comment


            #35
            to get a client list, I need the script on a remote system, and then invoke it from anywhere?
            You can invoke only on the remote computers where the scripts are available, or you can invoke from an HomeSeer Server event, but again only on the target computers where the scripts exist.
            --
            stipus

            Comment


              #36
              Found SOME of the problem...

              Ok, this is a weird one, at least to me...

              I am not that familiar with C#, but...

              Here is what finally ran....

              void Main( object param )
              {
              int i = 1;
              foreach( String clientString in sh.ClientList )
              {
              hs.WriteLog( "ScriptClient" + i.ToString(), clientString );
              i++;
              }
              }

              Here is what DIDN'T run

              void Main( object param )
              {
              int i = 1;
              foreach( String clientString in sh.ClientList )
              {
              hs.WriteLog( "ScriptClient" + i.ToString(), clientString );
              i++;
              }
              }

              The Difference is a LEADING SPACE at the begining of each line...

              I thought compilers ignored spaces? Especially when I used to indent for clarity...

              Am I missing something else ?

              Comment


                #37
                I'm going to double-check this. The compiler *should* ignore all white spaces.

                All my scripts are indented, but I think I never indented the first void Main( object param ) ... I'm going to check what's happening.
                --
                stipus

                Comment


                  #38
                  remote script request

                  Several of my machines around the house turn the monitor off for power savings.

                  WOuld it be possible to have a remote script turn the monitor back on?

                  That way.. when you walk in a room.. the monitor would turn on (if off) the person in the room would be able to see at a glance if there was any notes left on the machine.

                  I can probalby do this with some of the utilities on the net.. but i like the remote script approach.

                  Andrew
                  Regards,

                  Andrew B.

                  Comment


                    #39
                    Sure it should be easy.

                    I'll post a test script soon.
                    --
                    stipus

                    Comment


                      #40
                      Here is the remote_monitor.cs script:

                      Code:
                      #USING System.Runtime.InteropServices
                      
                      [DllImport("user32.dll")]
                      public static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
                      
                      void Main( object param )
                      {
                       IntPtr HWND_BROADCAST = new IntPtr(0xffff);
                       uint WM_SYSCOMMAND = 0x0112; 
                       int SC_MONITORPOWER = 0xF170; 
                      
                       // WAIT TO LET DESKTOP SETTLE 
                       System.Threading.Thread.Sleep( 500 );
                      
                       switch( param.ToString().ToUpper() )
                       {
                        case "ON":
                         SendMessage( HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, -1 );
                         break;
                        case "OFF":
                         SendMessage( HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2 );
                         break;
                        case "LOW":
                         SendMessage( HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 1 );
                         break;
                        default:
                         SendMessage( HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2 );
                         break;
                       }
                      }
                      Without any parameter, this script will turn off your monitor.
                      You can also use the following parameters:
                      - ON
                      - OFF
                      - LOW (low energy mode... no difference with OFF on my test computer, but as it's a laptop, this might be normal)

                      Of course you can change the default behavior .Switch the monitor ON by replacing 2 with -1 in the default case. (In fact I misread your initial post, this is why the default is off).
                      --
                      stipus

                      Comment


                        #41
                        Thank you Stipus.. exactly what i was looking for.. I'll try it tonight.

                        The idea is:

                        On motion in room:
                        Turn on monitor for displaying Screensaver (either pictures... or the HS status SSaver that i made)...

                        When no motion in room... let windows turn the monitor back off.. (or have h.s. turn it off)


                        Also:
                        When my "Alarm clock" timer goes off in morning... turn monitor on and scroll (using another remote script) the Daily Weather Forecast, word of the day, and verse of the day... and any other valuable information..

                        Also:
                        When "Bedtime" timer is triggered... have a ie page pushed with the important "House status" items listed for 10 minutes...

                        None of these would be worth nearly as much if the monitor was just "off" because of the power savings... but i don't want to leave my monitors on 24/7..

                        Thanks

                        Excited about the possibilities of the Remote script connector.

                        Andrew
                        Regards,

                        Andrew B.

                        Comment


                          #42
                          Excited about the possibilities of the Remote script connector.
                          Possibilities are theoricaly endless. You could rewrite Microsoft Word in a script, or a full multiplayer 3D graphic game ... if you're a good coder
                          --
                          stipus

                          Comment


                            #43
                            Script Connector Licence

                            I've just purchased a license for this plugin but I'm getting an error when I try to register "Invalid licence". (I've already opened a Help Desk ticket).
                            Real courage is not securing your Wi-Fi network.

                            Comment


                              #44
                              Thank you for your purshase.

                              However, third party plugin authors do not have any control on the license system.

                              I hope HST will solve your problem soon. Please keep me informed.
                              --
                              stipus

                              Comment


                                #45
                                Already solved. Thanks for the reply though.
                                Real courage is not securing your Wi-Fi network.

                                Comment

                                Working...
                                X