Announcement

Collapse
No announcement yet.

IP / Serial Plugin for HS3 (by "drule") - Discussion Thread

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

    Originally posted by B50int View Post
    I have just restored my Windows VM to solve the problem with the old panel so cannot screen shot but I will explain further.

    When I set up a new persistent TCP connection, I can send commands to the device and I can see responses through parsing the data received with a vb script (from the connection settings script box). When I try to use the 'drhslpPlugin: Received Triggers', the event wont fire on the string match (its just raw text) even though the plugin knows something has arrived on the port. I know this since general 'message triggers' still work. Just not the specific string matching trigger.

    What is odd is that I have working string triggers on other devices and ports. If I amend any one of those, all string matching triggers on that device fail. The only way to repair them would seem to be a VM restore!

    So all the old triggers are working again after restore, but I am stagnated and cannot make amendments to existing triggers or add new triggers without breaking the old triggers. Further, I cannot set up functioning new devices to trigger.

    I don't know if it related but I don't seem to have debug info anymore either. Last time I paid that any attention was when I first started using the plugin. I have DebugLevel at 4 in the config file but there is nothing in the log.

    Jon
    Sounds like it could be a problem with the string's termination. I'm not sure why amending a single working trigger would break all the other triggers. What is the device? Can you point me at its command documentation?

    Comment


      They are Extron MLC104IP+ panels so I can program them to send (and respond to) almost anything via serial connection or as TCP hosts in verbose mode.

      I have done a bit more experimenting after the VM restore. This time I avoided shortcutting and stopped using the copy command in the connections before amending. Starting the whole setup from scratch it works.

      Full of confidence I started using the copy function again. This time on commands to control the panel and the copied commands could not be selected as valid commands from triggers...

      Thinking back, the trigger that broke the 'old' connections was also one I copied from a working trigger that I amended.

      So, looks Ok at the moment but if my current thinking is correct, it looks like the copy facility is introducing the problems I am experiencing?

      Jon

      Comment


        ... won't work as TCP host for me

        This plug-in won't work as TCP host for me. I'm testing using popular program "PacketSender" that acts as TCP client.
        I setup the plug-in to act as "host" at the same IP address where it resides (HS3 machine) and port number 8102. No, I didn't forget to click on "enable" button to enable it. So it is enabled.
        The TCP client can't connect at all. It is on the same LAN. Does anyone have it working as TCP host? Any ideas how to make it working? Thanks.
        Last edited by risquare; July 14, 2018, 07:36 PM.

        Comment


          So I thought I give my old Marantz SR7008 another go at feedback - or passthru as we might call it.


          Anyway, I send "NSA\r" to my Marantz, and in return I'll get a 9 line (chr(13) separated I guess) answer in return. This has worked before HomeSeer (Fibaro HC2) so I know what I am after - I just need to get to understand what is wrong... I think I did a test on this a year or two ago and ended up with failure - and I think I even got a version from drule that was to help me (.25 maybe). So Back on the horse then, start simple:


          Code:
          Sub Main(parm as object)
          
              Dim Params() As String = Split(parm.ToString, Chr(0))
              ' Param(0) is the name of the plugin's connector
              ' Param(1) is the ip address of the remote end
              ' Param(2) is the data received
              Dim SplitString() As String = Split(Params(2), Chr(13))
          
              hs.writelog("Marantz FeedBack: ", SplitString(1))
          
          End Sub

          This will of course fail, on the Split function (since if I remove them, the error goes away...) - and the error gives me nothing:
          Running script FeedBackMarantz.vb :Exception has been thrown by the target of an invocation.->Does entry point Main exist in script? at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7f004e5ab9e0 + 0x000ef> in :0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7f004e3e3cf0 + 0x0002a> in :0 at Scheduler.clsRunVBNetScript.ExecuteScript () <0x417f3540 + 0x00e12> in :0

          Now If I remove the Split function I thought I just write the "parm" to the log - nope not a good idea, I get the same error as above...


          Not used to VB Script, so what am I doing wrong here? All I need to do is send "NSA\r" and then read the next 9 lines that are returned from my Marantz receiver (it will contain status, what input, what is playing on internet radio and so on). Any ideas?

          Comment


            Will the plug-in support Serial on Linux? I used to use this plug-in on my windows vm of hs3, now I don't see the tab for serial connections on the linux version. I have other serial plug-ins that are working on my linux version like the monoprice amp, etc.

            Comment


              Unfortunately, Mono does not fully support all the serial functions offered by .NET, so the plugin does not directly work with serial ports when running on Linux. However, you can use ser2net to create a tcp interface to your serial device and the plugin with work just fine. I do exactly this for a number of serial devices.

              Comment


                I am trying to get information from my house alarm into HS. I have a Cytech Comfort II alarm. The alarm has an ethernet interface and 'broadcasts' information to that interface as events occur in the alarm. I have a list of the codes it broadcasts.
                I am hoping that I can use the IP / Serial interface to monitor those broadcasts and then run events accordingly.
                I have installed the plugin and set the alarm (fixed IP) as a Connection in the plugin config. It is currently set as a Host. I have opened the port in my Firewall.
                I have set an event with a drhsPlugIn: Received Triggers. The Connection is set as the alarm. I then have an acion I can monitor.
                The output from the alarm is in the format IP0A01 where IP = input (the input I wish to monitor) 0A = the hex number of the input I wish to monitor (Input10) and )1 is on, 00 is Off
                I have tried all the different Encoding types but am not having any success in triggerring my event when I open Input 10.
                Any suggestions?

                Comment


                  Big5 plug-in for HS3 does all of it and much more. It supports Serial, HTTP, MQTT, TCP and Messaging (Slack). https://shop.homeseer.com/products/b...lug-in-for-hs3

                  Comment


                    Originally posted by larhedse View Post
                    So I thought I give my old Marantz SR7008 another go at feedback - or passthru as we might call it.


                    Anyway, I send "NSA\r" to my Marantz, and in return I'll get a 9 line (chr(13) separated I guess) answer in return. This has worked before HomeSeer (Fibaro HC2) so I know what I am after - I just need to get to understand what is wrong... I think I did a test on this a year or two ago and ended up with failure - and I think I even got a version from drule that was to help me (.25 maybe). So Back on the horse then, start simple:


                    Code:
                    Sub Main(parm as object)
                    
                    Dim Params() As String = Split(parm.ToString, Chr(0))
                    ' Param(0) is the name of the plugin's connector
                    ' Param(1) is the ip address of the remote end
                    ' Param(2) is the data received
                    Dim SplitString() As String = Split(Params(2), Chr(13))
                    
                    hs.writelog("Marantz FeedBack: ", SplitString(1))
                    
                    End Sub

                    This will of course fail, on the Split function (since if I remove them, the error goes away...) - and the error gives me nothing:



                    Now If I remove the Split function I thought I just write the "parm" to the log - nope not a good idea, I get the same error as above...


                    Not used to VB Script, so what am I doing wrong here? All I need to do is send "NSA\r" and then read the next 9 lines that are returned from my Marantz receiver (it will contain status, what input, what is playing on internet radio and so on). Any ideas?
                    So, I'm just now starting to move to HS3 and had the same problem and error (more or less). I did find the solution and am posting it here in case anyone else's search brings them here.

                    Code:
                    Sub Main(parm() as object)
                    
                    ' Parm(0) is the name of the plugin's connector
                    ' Parm(1) is the ip address of the remote end
                    ' Parm(2) is the data received (as text)
                    ' Parm(3) is the raw data ?
                    Dim SplitString() As String = Split(Parm(2).ToString, Chr(13))
                    
                    hs.writelog("Marantz FeedBack: ", SplitString(1))
                    
                    End Sub
                    This should work. The issue is that the HS3 version passes an array.

                    Comment


                      Originally posted by joegr View Post

                      So, I'm just now starting to move to HS3 and had the same problem and error (more or less). I did find the solution and am posting it here in case anyone else's search brings them here.

                      Code:
                      Sub Main(parm() as object)
                      
                      ' Parm(0) is the name of the plugin's connector
                      ' Parm(1) is the ip address of the remote end
                      ' Parm(2) is the data received (as text)
                      ' Parm(3) is the raw data ?
                      Dim SplitString() As String = Split(Parm(2).ToString, Chr(13))
                      
                      hs.writelog("Marantz FeedBack: ", SplitString(1))
                      
                      End Sub
                      This should work. The issue is that the HS3 version passes an array.
                      Well I gave this a try direct - and well I get a lot of this error:
                      Sep-20 16:31:18 Error 3 Running script FeedBackMarantz.vb :Exception has been thrown by the target of an invocation.->Does entry point Main exist in script? at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) <0x7f5f031ab9e0 + 0x000ef> in :0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) <0x7f5f02fe3cf0 + 0x0002a> in :0 at Scheduler.clsRunVBNetScript.ExecuteScript () <0x41855000 + 0x00e12> in :0

                      Comment


                        Well I get it to work at some requests perfectly - however most of them lists between one and nine "Error 3" like the one I listed above... And I am running copy of your code.

                        Comment


                          I have just upgraded Mono (since I run on Linux) to 4.8.0 - no difference.

                          Comment


                            Hello guys, how are you doing tonight?

                            I have a quick question for you.

                            Is there a way to recover all of the previous configuration, commands, etc.... if the plugin was deleted via the plugins page in HS3 Pro?

                            Any help would be greatly appreciated.

                            Thanks

                            Comment


                              Well, a bit depending on your installation (Linux or Windows), you will be able to find a file named "drhsIpPlugIn.ini" that contains all information. Back up that and you should be fine. In my case, with Linux (Ubuntu) installation, this file is in:

                              /opt/HomeSeer/Config/drhsIpPlugIn.ini

                              But as I write this, it will depend on how it is installed, and what environment/operating system you use.

                              Comment


                                Originally posted by larhedse View Post
                                I have just upgraded Mono (since I run on Linux) to 4.8.0 - no difference.
                                Mono released version is 5.14..

                                Comment

                                Working...
                                X