Announcement

Collapse
No announcement yet.

IP and Serial Plugin

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

  • #16
    This is what I see when I attempt to download the plugin. thanks for the reply. Do you mind sharing you irule setup, like components anything special you are doing etc. I have a Onkyo txsr800 series(controlled by an Itach IP2SL with feedback), Popcorn Hour A300 (controlled by TCP/IP), Panasonic AE4000-u (IP2SL). i can only control by lights by the status page in homeseer. I started out thinking I could setup HStouch to be primary interface but I am game to anything, as long as I can get it to work reliably.


    Comment


    • #17
      I've the same problem. Just found your plugin want to download it but the same error as above.

      Comment


      • #18
        Not sure what happened there but fixed now. The download is working again. Just about to run to the airport for a flight, I will share some of my iRule setup later.

        Cheers
        -David

        Comment


        • #19
          Thank you VERY MUCH

          Another question, is it possible to use a wildcard in the received command?
          I've a RFID reader that sends a serial command with the TAG id. the beginning and end is always the same.
          Last edited by martijnr17; December 11th, 2012, 07:09 AM.

          Comment


          • #20
            hen in the plugin's config page, add a connection defined as a TCP host, listening on port 6969. After that you should be able to create an event with a trigger type of "DR IP/Serial Received Trigger" and a Raw-Text string of 'test1'.
            This confuses me a little bit. When I go to this config area of the plugin do I put the ip of the homeseer server?

            In irule I add an http gateway I put the ip of my homeseer server with port 6969. I am wondering which of the other options I should choose?
            get
            post
            put

            Thanks
            Last edited by hunter69; December 11th, 2012, 03:35 PM.

            Comment


            • #21
              Hi

              Originally posted by hunter69 View Post
              This confuses me a little bit. When I go to this config area of the plugin do I put the ip of the homeseer server?
              The Configuration tab is only for serial port setup and other misc. items. In the Connections tab you set up inbound and outbound connections. In the address field in there you can put either the Serial Port number (as setup in the Config tab) or the IP address of the connection.
              If you are setting up an inbound connection (Host) from iRule use a Network Connection type rather than HTTP in iRule. If you wish to lock this down to a specific iRule device (e.g one iOS or Android device) then specify the static IP of that device here in the plugin. If you use DHCP and/or wish to use multiple devices you can configure this with 0.0.0.0/0 and it will accept connections from any IP address. Remember to set the same port that you defined in iRule. You may need to port forward to your HS machine in your router depending on your network configuration.

              When setting up outbound connections (Clients) you obviously have to be specific as to the address. Either a serial port of the HomeSeer PC that is connected to the device or a specific IP address and port of the destination device to be controlled (e.g. TV, AVR etc etc)

              Proxys can be used on Hosts to pass-thru commands directly to Clients.

              Connections will show up when creating HomeSeer events in the Triggers panel

              I will leave David to comment more on scripting as that's not something that I have tried as yet.

              Hope this helps
              cheeryfool

              Comment


              • #22
                Originally posted by hunter69 View Post

                In irule I add an http gateway I put the ip of my homeseer server with port 6969. I am wondering which of the other options I should choose?
                get
                post
                put

                Thanks
                Sorry, should have clarified this piece too. If you choose Network connection instead of HTTP gateway in iRule, then you only need 3 things:

                1. Attach the iRule device - one of the ones that you have created in the right panel of the iRule builder.
                2. The IP address and..
                3. The Port of your HS server

                Cheers
                James
                cheeryfool

                Comment


                • #23
                  If you use DHCP and/or wish to use multiple devices you can configure this with 0.0.0.0/0 and it will accept connections from any IP address.
                  This fixed the issue. Thank you! Now I can do some basic control of my lighting with Irule.

                  I can't wait to hear about making sliders work in irule using this plugin.

                  On another note I am very interested to hear what other applications people are using this for.
                  Last edited by hunter69; December 12th, 2012, 12:38 PM.

                  Comment


                  • #24
                    One cool design feature that David has built in to this Plugin is the ability to support multiple users controlling different or similar equipment from the same iRule "Handset" and differentiate the users (and therefore the actions) in HomeSeer by using different connections for each physical device (iPhone, iPod etc)

                    E.G. If husband and wife each have their own DVRs, or two kids each have their own TVs in their bedrooms, you can build one layout (one "Handset" in iRule terminology) in iRule and HomeSeer can detect which ipad/iphone/ipod etc the connection is coming from.

                    To set this up you need to specify distinct connections in the Plugin for each device and a corresponding Gateway in iRule with different ports. Setting the devices to work on static IPs when on WiFi or using address reservation in your router should ensure that these connections can be differentiated in HomeSeer reliably.

                    From there you can run different events or scripts in HomeSeer based on the connection, even though the data received from iRule is otherwise identical.

                    Not only is this clever and time saving (at least on the iRule side) it can also save buying additional handsets in iRule.
                    cheeryfool

                    Comment


                    • #25
                      Cheeryfool,

                      So it sounds as though you are an irule user also. Do you also use hstouch? Being so new to homeseer, I am not sure which way to go. I know with this plugin alone I could certainly control alot of things using irule and homeseer. I don't know how long you have been using homeseer but for now (my limited experience)I see a very real combination.

                      Comment


                      • #26
                        Originally posted by drule View Post
                        Hi Ivanhoek,

                        Thanks for your input. I've been giving this problem some thought. Right now, the plugin has no serial buffering to speak of. All I currently do is to set the ReceivedBytesThreadhold of the serial port to the value specified on the config page.

                        What I'm proposing to do is to introduce a buffer, say 1024 bytes long, read serial data into that buffer and only flush it when there's a match with a defined event trigger. To prevent the buffer filling with incorrect or stale data (for instance if you were to have a device sending data to the serial port for which there is no trigger defined, or there is a trigger but it is misdefined) I'll add a timer to flush the buffer if there have been no matches within a specified period of time.

                        Does this sound like it might work for you?

                        Regards
                        -David
                        David,

                        That sounds like it could work. I really appreciate the effort you've put into this. I'll try this as soon as I get back home, since I'll have to re-connect the receiver via serial. Is the proposed fix merged with the latest mainline or is it a special build?

                        Thanks!!

                        Comment


                        • #27
                          Originally posted by hunter69 View Post
                          Cheeryfool,

                          So it sounds as though you are an irule user also. Do you also use hstouch? Being so new to homeseer, I am not sure which way to go. I know with this plugin alone I could certainly control alot of things using irule and homeseer. I don't know how long you have been using homeseer but for now (my limited experience)I see a very real combination.
                          Yes, I use iRule more and more. I also use HS Touch in its default setup (includes all your events and devices) but I don't find it very intuitive from a custom design perspective. However there are pros and cons of both. HS Touch probably has a richer feature set right now, but I find iRule to be much easier to use for the type of design that I need and they are delivering frequent feature updates. iRule, David's Serial/IP Plugin and the standard HS functionality are providing me the best solution for my current needs.
                          cheeryfool

                          Comment


                          • #28
                            So how does a person make drule's plugin work with hstouch. I see where you can add devices but I am very new to homeseer. I appreciate anyone who can point me in the right direction

                            If I can figure out how to send a command via this plugin from a button in hstouch, I will be good to go.

                            For my setup, lets say i want to setup a button (in HStouch) to turn on my avr. It is controlled via rs232. I have a IP2SL controlling it. The IP2SL ip address is 192.168.2.6.

                            Thanks for any help provided

                            Comment


                            • #29
                              Originally posted by hunter69 View Post
                              So how does a person make drule's plugin work with hstouch. I see where you can add devices but I am very new to homeseer. I appreciate anyone who can point me in the right direction

                              If I can figure out how to send a command via this plugin from a button in hstouch, I will be good to go.

                              For my setup, lets say i want to setup a button (in HStouch) to turn on my avr. It is controlled via rs232. I have a IP2SL controlling it. The IP2SL ip address is 192.168.2.6.

                              Thanks for any help provided
                              I hadn't tried this until last night as I have been using iRule for all the custom stuff and just using the out of the box HSTouch screens for the occasional control of something that I haven't added to iRule yet.

                              However, I was able to make it work quite simply.

                              1. Set up a connection in the Plugin Connection for your AVR - if you haven't done this already. Since you are using an IP2SL, this would be a TCP Client type connection. E.g. Name: "YourAVR", [TCP], [Client], Address: 192.168.2.6, Port:4999. Use whatever port on the IP2SL is configured for the incoming connection in place of the "4999"

                              2. Create a VB script, per David's instructions on post 58 and save this in the HS scripts directory with a .vb file extension.

                              A crude version would look like this, where "YourAVR" is the connection name and "AVR Power On" is the command setup in the commands tab with the real power on command for your AVR.

                              Public Sub Main(ByVal Params As Object)
                              Dim IPP As Object = hs.Plugin("DR IP/Serial PlugIn")
                              IPP.Send("AVR Power On", "YourAVR")
                              End Sub

                              The limiation of this crude version is that the command is described in the script, rather than receiving the IPP.Send Parameters from HS Touch, but we can figure that out too

                              3. Now, in HSTouch, create a button, or select an existing one. Click in to the first row of the Element Properties - "Actions When Pressed" and open up the Action Editor dialog box by pressing the "..." Choose "HomeSeer: Run a HomeSeer Script". Press OK and then in row 2 "Script" browse to the script that you saved. It should default to the Main procedure of the script. Leave the Optional Parameters blank for now - this is where you would describe "AVR Power On" and "Your AVR" with a more flexible version of the script

                              4. After OKing through the screens and then saving the project and reloading on your portable device, you should now be able to action whatever control on your AVR that you entered in the script.

                              Let me know how that goes, and apologies in advance if you already know some of the steps above.
                              cheeryfool

                              Comment


                              • #30
                                Originally posted by ivanhoek View Post
                                David,

                                That sounds like it could work. I really appreciate the effort you've put into this. I'll try this as soon as I get back home, since I'll have to re-connect the receiver via serial. Is the proposed fix merged with the latest mainline or is it a special build?

                                Thanks!!
                                Just got back home and tried the code. It works! The logs look a little weird, but the events DO trigger properly now. See below for a sample (Connection is serial, I just didn't change the name to remove IP):

                                12/16/2012 6:27:38 PM Event Event Trigger "Yamaha GetInput"
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn YAMAHA RXA3000 IP - elapsed time=23473ms
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn YAMAHA RXA3000 IP - received serial data from: COM4, length: 1, containing: @
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=17, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=16, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=12, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=1
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn YAMAHA RXA3000 IP - elapsed time=12ms
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn YAMAHA RXA3000 IP - received serial data from: COM4, length: 2, containing: @M
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=17, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=16, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=12, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=2
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn YAMAHA RXA3000 IP - elapsed time=0ms
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn YAMAHA RXA3000 IP - received serial data from: COM4, length: 15, containing: @MAIN:INP=AV5
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=13
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=13
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=17, Data.Length=13
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=16, Data.Length=13
                                12/16/2012 6:27:38 PM Event Event Trigger "ROKU"
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=13
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=13
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=12, Data.Length=13
                                12/16/2012 6:27:38 PM DR IP/Serial PlugIn CompareArray.Length=13, Data.Length=13
                                12/16/2012 6:27:38 PM Device Control Device: Second Theater Theater Dimmer (Q1) OFF
                                12/16/2012 6:27:38 PM Device Control Device: Second Theater Theater TV Backlight (Q4) ON

                                THANKS!

                                PS. I thought the buffer would flush once, but it seems the log writer still writes the input as it's received regardless of the buffer flush status. No biggie, just makes for a little weirdness on the log.

                                Comment

                                Working...
                                X