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

    #16
    All ok!

    Hi Stipus,

    Thats got it. Both ends now 0.3.2.2, No missiing ICsharp* issues, and msgbox and deviceaction scripts working fine. Great Job!

    cheers,

    Phil

    Comment


      #17
      Here is the Remote Mini Control HomeSeer Script



      - You can choose a X10 House Code, then you get X10 device status for all devices.
      - If you click any of the small icons, the status for the device is changed (X10 command is really sent).
      - The device status is updated every 10 seconds.

      If you run this on a remote computer, you must make sure the images exist in HomeSeer 2/html/Images/HomeSeer (You can copy the images there from your main HS Server, if they are not present)

      - disabled.gif
      - on.gif
      - off.gif
      - dim.gif

      Notes:
      - You can run this script on the HomeSeer server, if you run the HsScript client on the server
      - You can launch this script from a HomeSeer event (choose Exec Remote Script event action)
      - You can launch this script from another HomeSeer script using the plugin API
      - You can launch this script from the remote computer, using the HsScript.exe command line:

      --> HsScript remote_mini_control.vb

      [Edit] Attachement removed, as this script is installed with the plugin
      Last edited by stipus; September 9, 2007, 11:30 AM.
      --
      stipus

      Comment


        #18
        Attachement in post #1 updated to V0.4.2.2

        Change log since V0.3.2.2

        - HsScript.exe and hspi_script.dll do not need the GenuineChannels.dll and the ICSharpCode.SharpZipLib.dll anymore.
        You can remove these dlls from your HS directory (rename to .old first, just in case another program needs these dlls).

        - The remote_mini_control.vb sample script has been included in the ZIP.
        --
        stipus

        Comment


          #19
          I just finished implementing .cs scripts (C-Sharp).

          This will be available in the next version.
          --
          stipus

          Comment


            #20
            Attachement in post #1 updated to V0.5.2.2

            Change log since V0.4.2.2

            - The Script Client now supports C-Sharp scripts (.cs extension).
            - Added sample C-Sharp script remote_writelog.cs
            - Added sample C-Sharp script remote_marquee.cs

            The remote_marquee.cs sample script shows a large scrolling message on the target computer. Click on the message to close it.

            HSSCRIPT remote_marquee.cs Hello from HomeSeer



            I think this script can be really usefull to popup messages on any remote computer from HomeSeer.

            You can popup a scrolling message on a remote computer from any HomeSeer event:
            - Choose the Exec Remote Script Event action
            - Type the computer name (Remote Script Client name) in the target text box
            - Type the script name remote_marquee.cs in the Script text box.
            - Type the text to be shown in the parameter text box.
            - Apply changes and test your event !
            Last edited by stipus; September 2, 2007, 03:52 AM.
            --
            stipus

            Comment


              #21
              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.
              --
              stipus

              Comment


                #22
                Hi Stipus,

                Thanks for 0.5.2.2 all is working well. I have an event using the marquee which displays last caller ID info via the marquee script.

                One Idea I have the TheMax74 SMS connector working here, and thought maybe we could make a send/rx script remote for interactive SMS on remote machines.

                cheers,

                Phil

                Comment


                  #23
                  One Idea I have the TheMax74 SMS connector working here, and thought maybe we could make a send/rx script remote for interactive SMS on remote machines.
                  I think it's possible. If you can describe what's need to be done, I can try to work on it.
                  --
                  stipus

                  Comment


                    #24
                    Here is another usefull script: Send Post-It to remote computers from HomeSeer.

                    The post-it auto-sizes to the content you type as the script parameter.



                    Here is the remote_postit.cs script:

                    Code:
                    #IMPORT System.Windows.Forms,System.Windows.Forms.dll
                    #IMPORT System.Drawing,System.Drawing.dll
                    void Main( object param )
                    {
                        PostItForm postItForm = new PostItForm( param.ToString() );
                        Application.Run( postItForm );
                    }
                    public class PostItForm : System.Windows.Forms.Form
                    {
                        private Label postItLabel;
                        public PostItForm( string textString )
                        {
                          postItLabel = new Label();
                          postItLabel.Dock = DockStyle.Fill;
                          postItLabel.Font = new System.Drawing.Font("Verdana", 16F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
                          postItLabel.ForeColor = System.Drawing.Color.Navy;
                          postItLabel.BackColor = System.Drawing.Color.FromArgb( 255, 255, 128 );
                          postItLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                          postItLabel.Text = textString;
                          System.Drawing.Graphics graphics = postItLabel.CreateGraphics();
                          System.Drawing.SizeF size = graphics.MeasureString(textString, postItLabel.Font);
                          int width = Convert.ToInt32( size.Width ) + 10;
                          int height = Convert.ToInt32( size.Height ) + 30;
                          while( width > 2 * height )
                          {
                            width = width / 2;
                            height = height * 2;
                          }
                          this.Width = width;
                          this.Height = height;
                          this.Text = "HomeSeer Post-It";
                          this.MaximizeBox = false;
                          this.MinimizeBox = true;
                          this.TopMost = true;
                          this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
                          this.Controls.Add( postItLabel );
                        }
                    }
                    As usual, you can popup a post-it message on a remote computer from any HomeSeer event:
                    - Choose the Exec Remote Script Event action
                    - Type the computer name (Remote Script Client name) in the target text box
                    - Type the script name remote_postit.cs in the Script text box.
                    - Type the text to be shown in the parameter text box.
                    - Apply changes and test your event !
                    --
                    stipus

                    Comment


                      #25
                      Stipus,
                      In a word, WOW! This has sooo much potential. All the examples you have given are awesome. I have a couple uses that immediately pop into my head.

                      * Would it be possible to send a message to a remote computer, say 'Time for bed' and when the user clicked the OK, send a reply to the main system. Maybe set a device string to reflect that the message was received. That way there is no, "but I didn't see it"! lol

                      * I have some touchscreens around the house. This looks to be a great way to send alerts to the different rooms. Could set up some kind of system that different triggers to send alerts to a device, trigger the script to send out a system wide message. Messages could be with different priorities too based on user input, 1=emergency, 2=critical, 3=nuisance ... that type of thing.

                      Can't wait to see more examples from you and others!
                      Bryan
                      Software/Hardware: Win10 Pro, HS 3 Pro, HS Touch, Echo, Edgeport/4, Z-Net w/88 Devices, Insteon PLM w/19 Devices, Nest, GC-100-6, W800RF32A, WS-2080 Weather Station (KMADRACU10)
                      Plug-in/Scripts: Alexa API, BLBackup, BLGData, BLLED, BLLock, BLRF, BLTVGuide, Blue Iris, BLUPS, Current Cost 3P, DirectTV, FitbitSeer, Insteon, Nest, Pushover 3P, Random, Restart, Tasker, UltraGCIR3, UltraWeatherWU, Z-Wave

                      Comment


                        #26
                        In a word, WOW! This has sooo much potential. All the examples you have given are awesome.
                        Thanks ! This plugin doesn't really do anything alone... It's all about potential through all the remote scripts we could build and run on remote computers and also on the main HS server...

                        * Would it be possible to send a message to a remote computer, say 'Time for bed' and when the user clicked the OK, send a reply to the main system. Maybe set a device string to reflect that the message was received. That way there is no, "but I didn't see it"! lol
                        Sure... you could just add a few lines of code to the marquee script to do this. If you want me to do it, please be a little more specific (which HS device you want to use as the ack device...)

                        * I have some touchscreens around the house. This looks to be a great way to send alerts to the different rooms. Could set up some kind of system that different triggers to send alerts to a device, trigger the script to send out a system wide message. Messages could be with different priorities too based on user input, 1=emergency, 2=critical, 3=nuisance ... that type of thing.
                        I think you could easily use HomeSeer triggers to do all this. Add a "Exec Remote Script" device action for each remote computer for system wide alert messages. This makes me think I could add a system wide feature to the plugin... for example if you type STAR (*) as the remote computer name... (I think this may be available in a next plugin version...)
                        --
                        stipus

                        Comment


                          #27
                          SMS send remote script

                          Here is my first remote script based heavilly on Stipus remote_devicecontrol.

                          The script should work with either skype plugin (tested) or themax74 depricated .NET SMS Plugin (tested).

                          remote_sendsms.vb Instructions:

                          1. Copy code as script remote_sendsms.vb to homeseer 2/scripts directory on client machine.
                          2. Edit 2 sections in script marked ****** to (a) set favourite destination SMS skype names or SMS numbers and (b) uncomment skype or SMS plugin line for the desired SMS method.
                          3. Copy hspi_skype.dll and/or hspi_SMS.dll from HS server to the client homeseer 2 directory.
                          4. Use this direct script command in a HS server trigger to pop-up SMS screen on client (substitute your own client name for Notebook):
                          &hs.plugin("Script Connector").ExecScript "Notebook", "remote_sendsms.vb","dummy"
                          5. You can also easily create a windows shortcut to run the SMS script from your remote computer.
                          Right click on your desktop, choose New - Shortcut
                          Then type the following as the shortcut target, and apply.
                          "C:\Program Files\HomeSeer 2\HsScript.exe" remote_sendsms.vb
                          (thanks to Stipus - this is the best way to start the SMS script)

                          Note: with the SMS plugin, it takes some time (30 secs) to respond back to the client and may timeout on the client. It will send the SMS though. I Don't know how to set the timeout on the script channel to the client yet.

                          cheers,

                          Phil

                          Code:
                          #IMPORT System.Windows.Forms,System.Windows.Forms.dll
                          #IMPORT System.Drawing,System.Drawing.dll
                          
                          Sub Main()
                              Dim MainForm as new Form1()
                              Application.Run(MainForm)
                          End Sub
                          
                          
                          Public Class Form1
                              Inherits System.Windows.Forms.Form
                          
                              Public Sub New()
                          
                                  Me.Label1 = New System.Windows.Forms.Label
                                  Me.Button1 = New System.Windows.Forms.Button
                                  Me.TextBox1 = New System.Windows.Forms.TextBox
                                  Me.ComboBox1 = New System.Windows.Forms.ComboBox
                                  Me.Label2 = New System.Windows.Forms.Label
                                  Me.SuspendLayout()
                                  '
                                  'Label1
                                  '
                                  Me.Label1.AutoSize = True
                                  Me.Label1.Location = New System.Drawing.Point(31, 18)
                                  Me.Label1.Name = "Label1"
                                  Me.Label1.Size = New System.Drawing.Size(142, 13)
                                  Me.Label1.TabIndex = 0
                                  Me.Label1.Text = "Enter Phone Number : "
                                  '
                                  'Button1
                                  '
                                  Me.Button1.Location = New System.Drawing.Point(80, 103)
                                  Me.Button1.Name = "Button1"
                                  Me.Button1.Size = New System.Drawing.Size(167, 23)
                                  Me.Button1.TabIndex = 1
                                  Me.Button1.Text = "Send SMS Now"
                                  Me.Button1.UseVisualStyleBackColor = True
                                  '
                                  'TextBox1
                                  '
                                  Me.TextBox1.Location = New System.Drawing.Point(191, 56)
                                  Me.TextBox1.Name = "TextBox1"
                                  Me.TextBox1.Size = New System.Drawing.Size(121, 20)
                                  Me.TextBox1.TabIndex = 2
                                  '
                                  'ComboBox1
                                  '
                                  ' ******
                                  ' ****** Replace "My Number 1" ..5  with your favourite outgoing SMS numbers to appear in the pulldown list.
                                  ' ******
                          
                                  Me.ComboBox1.FormattingEnabled = True
                                  Me.ComboBox1.Items.AddRange(New Object() {"My Number 1", "My Number 2", "My Number 3", "My Number 4", "My Number 5"})
                                  Me.ComboBox1.Location = New System.Drawing.Point(191, 13)
                                  Me.ComboBox1.Name = "ComboBox1"
                                  Me.ComboBox1.Size = New System.Drawing.Size(121, 21)
                                  Me.ComboBox1.TabIndex = 3
                                  '
                                  'Label2
                                  '
                                  Me.Label2.AutoSize = True
                                  Me.Label2.Location = New System.Drawing.Point(31, 59)
                                  Me.Label2.Name = "Label2"
                                  Me.Label2.Size = New System.Drawing.Size(136, 13)
                                  Me.Label2.TabIndex = 4
                                  Me.Label2.Text = "Type SMS String to send :"
                                  '
                                  'Form1
                                  '
                                  Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
                                  Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
                                  Me.ClientSize = New System.Drawing.Size(338, 157)
                                  Me.Controls.Add(Me.Label2)
                                  Me.Controls.Add(Me.ComboBox1)
                                  Me.Controls.Add(Me.TextBox1)
                                  Me.Controls.Add(Me.Button1)
                                  Me.Controls.Add(Me.Label1)
                                  Me.MaximizeBox = False
                                  Me.Name = "Form1"
                                  Me.Text = "HomeSeer Send SMS"
                                  Me.ResumeLayout(False)
                                  Me.PerformLayout()
                          
                              End Sub
                              Friend WithEvents Label1 As System.Windows.Forms.Label
                              Friend WithEvents Button1 As System.Windows.Forms.Button
                              Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
                              Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
                              Friend WithEvents Label2 As System.Windows.Forms.Label
                          
                          
                              Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
                              End Sub
                          
                              ' ******
                              ' ****** Uncomment the plugin you are using.. either .NET Skype (hspi_skype.dll) or .NET SMS plugin (hspi_sms.dll)
                              ' ****** When using the SMS plugin, specify your SMS plugin hardware device name here (eg T68USB for me)
                              ' ******
                          
                              Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
                                  'hs.Plugin("Skype Connector").SendSms( ComboBox1.Text, TextBox1.Text )
                                  'hs.plugin("SMS Plugin").SendSMS( ComboBox1.Text, TextBox1.Text, "T68USB")
                              End Sub
                          
                          End Class
                          Attached Files
                          Last edited by stipus; September 9, 2007, 11:32 AM.

                          Comment


                            #28
                            First user contribution ! Great

                            I just tested with the Skype plugin, and it works...

                            However it didn't ... I had to change the SendMessage() method you have been using with the SendSms() method. (I just edited your post and changed this in the code). The SendMessage() Skype plugin method sends a Skype Instant Message, not a SMS.

                            Thanks again for your contribution,
                            --
                            stipus

                            Comment


                              #29
                              4. Use this direct script command in a HS server trigger to pop-up SMS screen on client (substitute your own client name for Notebook):

                              &hs.plugin("Script Connector").ExecScript "Notebook", "remote_sendsms.vb","dummy"
                              You can also easily create a windows shortcut to run the SMS script from your remote computer.

                              Right click on your desktop, choose New - Shortcut
                              Then type the following as the shortcut target, and apply.

                              "C:\Program Files\HomeSeer 2\HsScript.exe" remote_sendsms.vb
                              --
                              stipus

                              Comment


                                #30
                                I just started to work on a remote thermostat control script.



                                What do you think ?
                                --
                                stipus

                                Comment

                                Working...
                                X