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

    Remote Script Requests and Help

    If you have a good idea for a remote script, but your scripting skill is not good enough, or you want some help implementing some parts, please post your ideas or problems here.

    You may also request changes to the scripts installed with the plugin to suit a specific need.

    I may not be able to answer all requests, but if your idea is good and I think the resulting script would be usefull to many users, I'll do my best to work on it.
    Last edited by stipus; September 5, 2007, 03:13 AM.
    --
    stipus

    #2
    Request....

    Along the lines of the mini controller..however...multiple friendly names in a vertical list eg "Garage Light" with simple On/Off next to name with current status shown.

    This is to make the mini controller more WAF and kids friendly.

    Cheers,

    Darren

    Comment


      #3
      Oooh oooh new idea!!!

      I use CheaperRFID hardware. If I used my work machine as a "terminal" I can have the system know when I am at work. THEN have it send me reminder messages (the yellow sticky note) etc.!

      --Dan
      Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

      Comment


        #4
        Originally posted by drozwood90 View Post
        Oooh oooh new idea!!!

        I use CheaperRFID hardware. If I used my work machine as a "terminal" I can have the system know when I am at work. THEN have it send me reminder messages (the yellow sticky note) etc.!

        --Dan
        Yes I think you should be able to do this with a HomeSeer trigger.
        You may need a script that loops over your notes (maybe in a file), then send each note as a Post-it to the computer you've been detected working at.
        --
        stipus

        Comment


          #5
          Originally posted by darren-mc View Post
          Request....

          Along the lines of the mini controller..however...multiple friendly names in a vertical list eg "Garage Light" with simple On/Off next to name with current status shown.

          This is to make the mini controller more WAF and kids friendly.

          Cheers,

          Darren
          That's a good idea.
          Maybe a script that can be called with several device codes as parameter, and that would build the list from the Device Location + device name of each device.

          I'll try to work on this.
          --
          stipus

          Comment


            #6
            Yes I like idea of list...gives great flexibility.

            Comment


              #7
              Originally posted by stipus View Post
              Yes I think you should be able to do this with a HomeSeer trigger.
              You may need a script that loops over your notes (maybe in a file), then send each note as a Post-it to the computer you've been detected working at.

              What about working that into the Bluetooth connector? I always have my phone with me!

              Comment


                #8
                Originally posted by stipus View Post
                Yes I think you should be able to do this with a HomeSeer trigger.
                You may need a script that loops over your notes (maybe in a file), then send each note as a Post-it to the computer you've been detected working at.
                Wow, now I just need to figure out a script to share the com port from my work machine to my HS server at home, so the plugin logic can do it's thing with regards to the RF triggers from the RFID device!

                --Dan
                Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

                Comment


                  #9
                  Darren,

                  Have a look at this one... I think it's what you asked for:




                  Save this script as remote_lights.cs
                  Call it with the device codes as parameters as shown on the above picture.

                  [EDIT] attachement removed, as this script is installed with latest versions of the plugin.
                  Last edited by stipus; September 9, 2007, 12:57 PM.
                  --
                  stipus

                  Comment


                    #10
                    Originally posted by drozwood90 View Post
                    Wow, now I just need to figure out a script to share the com port from my work machine to my HS server at home, so the plugin logic can do it's thing with regards to the RF triggers from the RFID device!

                    --Dan
                    Tonight if I have enough time, I'll try to see how we can access the serial port on the remote host. It should be easy with the .NET com port API.
                    --
                    stipus

                    Comment


                      #11
                      Jesus Christ Stipus !!

                      Are you a man or a machine ??
                      I'm beginning to wonder !! :-D

                      Comment


                        #12
                        Originally posted by fran_joel View Post
                        Jesus Christ Stipus !!

                        Are you a man or a machine ??
                        I'm beginning to wonder !! :-D
                        I'm just a copy/paste master

                        Most new scripts use previous scripts code, with minor changes.
                        --
                        stipus

                        Comment


                          #13
                          Here is a sample script I have just tested to send RS232 ASCII commands from the HomeSeer server to my Arcam AVR300 receiver plugged to my laptop serial port. The script client is running on the laptop.

                          The ASCII string to be sent is the script parameter. The response is printed to the HomeSeer event log.

                          Save this script as remote_com1.cs
                          Code:
                          [SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] Main( [/SIZE][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][SIZE=2] param )
                          {
                            System.IO.Ports.SerialPort serialPort = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] System.IO.Ports.SerialPort("COM1", 38400, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);
                            serialPort.Encoding = System.Text.Encoding.ASCII;
                            serialPort.NewLine = new string( Convert.ToChar(0xd), 1 );
                            serialPort.Open();
                            serialPort.WriteLine( param.ToString() );
                          [/SIZE][SIZE=2][COLOR=#0000ff]  string[/COLOR][/SIZE][SIZE=2] responseString = serialPort.ReadLine();
                            serialPort.Close(); 
                            
                            hs.WriteLog( "Remote COM1", responseString );
                          }
                          [/SIZE]
                          If you need other settings for the COM port here are the possible values from the .NET API documentation:

                          Parity:
                          - Even
                          - Mark
                          - None
                          - Odd
                          - Space

                          StopBits:
                          - None
                          - One
                          - OnePointFive
                          - Two

                          The end of line with the Arcam Receiver is always the 0xd character.

                          If your device uses another one such as carriage return, you may use one of:

                          serialPort.NewLine = "\n\r";

                          or

                          serialPort.NewLine = "\n";

                          or

                          serialPort.NewLine = "\r";
                          --
                          stipus

                          Comment


                            #14
                            Originally posted by stipus View Post
                            I'm just a copy/paste master

                            Most new scripts use previous scripts code, with minor changes.
                            Ok let's settle for half god then ...
                            I got that from your designation in the french forum...lol!

                            Joel

                            Comment


                              #15
                              Originally posted by stipus View Post
                              Here is a sample script I have just tested to send RS232 ASCII commands from the HomeSeer server to my Arcam AVR300 receiver plugged to my laptop serial port. The script client is running on the laptop.

                              The ASCII string to be sent is the script parameter. The response is printed to the HomeSeer event log.

                              Save this script as remote_com1.cs
                              Code:
                              [SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][SIZE=2] Main( [/SIZE][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][SIZE=2] param )[/SIZE]
                              [SIZE=2]{[/SIZE]
                              [SIZE=2] System.IO.Ports.SerialPort serialPort = [/SIZE][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][SIZE=2] System.IO.Ports.SerialPort("COM1", 38400, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One);[/SIZE]
                              [SIZE=2] serialPort.Encoding = System.Text.Encoding.ASCII;[/SIZE]
                              [SIZE=2] serialPort.NewLine = new string( Convert.ToChar(0xd), 1 );[/SIZE]
                              [SIZE=2] serialPort.Open();[/SIZE]
                              [SIZE=2] serialPort.WriteLine( param.ToString() );[/SIZE]
                              [SIZE=2][COLOR=#0000ff] string[/COLOR][/SIZE][SIZE=2] responseString = serialPort.ReadLine();[/SIZE]
                              [SIZE=2] serialPort.Close(); [/SIZE]
                               
                              [SIZE=2] hs.WriteLog( "Remote COM1", responseString );[/SIZE]
                              [SIZE=2]}[/SIZE]

                              If you need other settings for the COM port here are the possible values from the .NET API documentation:

                              Parity:
                              - Even
                              - Mark
                              - None
                              - Odd
                              - Space

                              StopBits:
                              - None
                              - One
                              - OnePointFive
                              - Two

                              The end of line with the Arcam Receiver is always the 0xd character.

                              If your device uses another one such as carriage return, you may use one of:

                              serialPort.NewLine = "\n\r";

                              or

                              serialPort.NewLine = "\n";

                              or

                              serialPort.NewLine = "\r";
                              Stipus, thanks! I'll try to play with it some tomorrow!
                              Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

                              Comment

                              Working...
                              X