Announcement

Collapse
No announcement yet.

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

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

    Clarification on Plugin Commands from script and feedback

    I posted this question earlier (Post #658),

    I have a Denon 3808ci that I am accessing via IP control. Thru these threads, I used a simple script ( below) from this thread to get the Denon Responses from my commands requesting status ( power status, input status, volume etc) successfully, and then posts that response to the log in HS3. Perfect that worked!!


    Public Sub Main(Param() As Object)
    hs.WriteLog("drhsIpPlugin", Param(2).ToString)
    End Sub

    However, I am still trying to gain some clarification on the scripting with this plugin in terms of the commands/syntax.

    I am assuming I can via the plugin commands add the required lines to take that same response and send it to a global Variable ( String I assume). With the goal in mind to then be able to use that data to show device status on a virtual device or be able to recall that string via HStouch, etc.. I am not connecting the dots from the HS3 help and the syntax used . Any suggestions or relevant posts I may have missed? Again Great Plugin..

    Comment


      Hi, David

      Originally posted by drule View Post
      Not sure how those corrupted commands came to be in your ini file but I would manually delete them for now and restart the plugin.

      I've had a quick look at the yeelight documentation and I think you are doing everything right. Does the disconnect occur on a regular basis? If so, I'm wondering if the yeelight is timing out the persistent connection. If we can determine how long it is before the timeout, we might be able to craft some sort of keep-alive routine.

      -David
      the disconnection occurs randomly, there are no rules.
      I know when I have more return of the ribbon led
      Every hour the ribbon sends its status

      janv.-03 09:08:11 Pass-thru There are 477 bytes of binary data.
      janv.-03 09:08:11 Pass-thru NOTIFY * HTTP/1.1 Host: 239.255.255.250:1982 Cache-Control: max-age=3600 Location: yeelight://192.168.xx.33:55443 NTS: ssdp:alive Server: POSIX, UPnP/1.0 YGLC/1 id: 0x000000000xxxxxxxx model: stripe fw_ver: 40 support: get_prop set_default set_power toggle set_bright start_cf stop_cf set_scene cron_add cron_get cron_del set_ct_abx set_rgb set_hsv set_adjust set_music set_name power: off bright: 32 color_mode: 1 ct: 4000 rgb: 16750848 hue: 0 sat: 100 name:
      janv.-03 09:08:11 Pass-thru 192.168.xx.33:1982
      janv.-03 09:08:11 Pass-thru Yeelight Discover
      I have a connection for this:

      [Connections]
      Yeelight Discover=Host,UDP,,1982,,Passthru.vb,0,239.255.255.250,<N/A>

      Happy NewYear

      Jean-Francois

      Comment


        Originally posted by KeyMix View Post
        I posted this question earlier (Post #658),

        I have a Denon 3808ci that I am accessing via IP control. Thru these threads, I used a simple script ( below) from this thread to get the Denon Responses from my commands requesting status ( power status, input status, volume etc) successfully, and then posts that response to the log in HS3. Perfect that worked!!

        Public Sub Main(Param() As Object)
        hs.WriteLog("drhsIpPlugin", Param(2).ToString)
        End Sub

        However, I am still trying to gain some clarification on the scripting with this plugin in terms of the commands/syntax.

        I am assuming I can via the plugin commands add the required lines to take that same response and send it to a global Variable ( String I assume). With the goal in mind to then be able to use that data to show device status on a virtual device or be able to recall that string via HStouch, etc.. I am not connecting the dots from the HS3 help and the syntax used . Any suggestions or relevant posts I may have missed? Again Great Plugin..
        Once you have the string you can use it to set a variable or the status of a virtual device. For example:
        Code:
        Public Sub Main(Param() As Object)
            Dim MyStatus As String = Param(2).ToString
            hs.SetDeviceStringByName("[I]VirtualDevice[/I]", MyStatus, True)
            hs.SaveVar("[I]MyVar[/I]", MyStatus)
          End Sub
        -David

        Comment


          Originally posted by jfla View Post
          Hi, David



          the disconnection occurs randomly, there are no rules.
          I know when I have more return of the ribbon led
          Every hour the ribbon sends its status



          I have a connection for this:

          [Connections]
          Yeelight Discover=Host,UDP,,1982,,Passthru.vb,0,239.255.255.250,<N/A>

          Happy NewYear

          Jean-Francois
          If I'm understanding this correctly, you have two connections. One is a persistent tcp client connected to 192.168.xx.33:55443 and is used to send commands to the Yeelight and the other is a UDP host that listens on port 1982 for multicast broadcasts containing the Yeelight's status.

          The tcp client is periodically timing out. I strongly suspect that the Yeelight is closing the connection rather than plugin but we would need to use Wireshark or similar to be certain. The differences between a persistent and non-persistent client are that a persistent connection is opened when the plugin initializes and remains open. If it is closed by the other end, the plug should detect this and reopen it. Data can be received at any time.

          A non-persistent tcp connection is only opened when data needs to be sent. After all the data has been sent, the connection will remain open for the number of milliseconds defined in "Tcp Client Response Timeout" on the plugin's config page (default 500ms). Any data received in this window, i.e., responses to the command just sent, will be processed. Then the connection will close meaning any additional traffic won't be received.

          In the case of the Yeelight, does the tcp client need to be persistent? Can you make it non-persistent and still get the same functionality you require?

          -David

          Comment


            Originally posted by drule View Post
            In the case of the Yeelight, does the tcp client need to be persistent? Can you make it non-persistent and still get the same functionality you require?

            -David
            I just read the Yeelight API doc some more. It looks like the udp broadcast is sent periodically but not necessarily when a change of status occurs. "Yeelight smart LED will refresh its state by sending the advertisement message at a fixed interval." I don't see anything to say what that fixed interval is, or if it can be adjusted.

            Towards the end of the document, it talks about notification messages. "Whenever there is a state change of smart LED, it will send a notification message to all connected 3rd party devices. This is to make sure all 3rd party devices will get the latest state of the smart LED in time without having to poll the status from time to time."

            This implies to me that you should be using a persistent tcp client and that the smart LED doesn't close it.

            The document also says for troubleshooting, you can telnet directly to a smart LED on port 55443. I think it would be helpful to try this and see if this connection gets dropped randomly too.

            -David

            Comment


              Originally posted by drule View Post
              Once you have the string you can use it to set a variable or the status of a virtual device. For example:
              Code:
              Public Sub Main(Param() As Object)
                  Dim MyStatus As String = Param(2).ToString
                  hs.SetDeviceStringByName("[I]VirtualDevice[/I]", MyStatus, True)
                  hs.SaveVar("[I]MyVar[/I]", MyStatus)
                End Sub
              -David
              That WORKED!!!! Thanks I think I was trying to make the vb script be overcomplicated. I was able to take this, create the Global Variable as a test, Virtual Device and it shows ALL the text responses. Now onto Parsing the data!!!.. THANKS A TON. Great Support.

              Comment


                Discovered this plug-in a few months back and I think it's great. However after creating all sorts of events and scripts to control my Pioneer Elite SC-79 receiver I have discovered a big problem.

                I believe that it is related to the Persist option on the plugin. After it has connected in persist mode for a while, the receiver can no longer send an HDMI signal to my proj. At first I resolved this by unplugging and re-plugging in the receiver (pwr toggle did not work). I have now discovered that just disconnecting the ethernet cable and then a pwr toggle, also resolves the problem. As well, switching off the Persist option seems to solve the problem, but of course I can now no longer receive any feedback from the receiver, yet I can send it commands. It seems like the persist option eventually overwhelms something in the receiver that prevents it from proper HDMI handshaking.

                Any thoughts, solution, workarounds?

                Thanks

                Andrew

                Comment


                  Originally posted by anevard View Post
                  Discovered this plug-in a few months back and I think it's great. However after creating all sorts of events and scripts to control my Pioneer Elite SC-79 receiver I have discovered a big problem.

                  I believe that it is related to the Persist option on the plugin. After it has connected in persist mode for a while, the receiver can no longer send an HDMI signal to my proj. At first I resolved this by unplugging and re-plugging in the receiver (pwr toggle did not work). I have now discovered that just disconnecting the ethernet cable and then a pwr toggle, also resolves the problem. As well, switching off the Persist option seems to solve the problem, but of course I can now no longer receive any feedback from the receiver, yet I can send it commands. It seems like the persist option eventually overwhelms something in the receiver that prevents it from proper HDMI handshaking.

                  Any thoughts, solution, workarounds?

                  Thanks

                  Andrew
                  The plugin doesn't do anything special with persistent connections, it just doesn't actively close them. A non-persistent connection will open when there is data to be sent, send data, wait for time specified in tcp timeout and then close. A persistent connection will open at startup and sit there doing nothing until either there is data to send, or data is received.

                  I wonder if your Pioneer's tcp server is the issue? Is there a firmware update for the receiver available?

                  -David

                  Comment


                    Hi David,

                    Thanks for the reply. The receiver is 4 years old and had it's final update years back.

                    It has only exhibited this behaviour when I started working with the LAN interface. It only locks up after it has been in standby mode and the plugin is connected. All commands to it work perfectly while it is running, but once it is off and then on again a while later, no HDMI sync to the projector. It does see the sources properly though.

                    BTW with persist checked but Connection Disabled, it doesn't experience any problems. Of course it doesn't react to any commands either.

                    The log message is: drhsIpPlugIn No TcpClients for SC-79

                    It's strange, I am not sure what to try next.

                    Andrew

                    Comment


                      Anyone using this for a Monoprice 10761 6X6 Amp/controller?

                      Title.

                      Comment


                        I would like to extend a large thanks for the .ini file. Since I am about to migrate from a Zee S2 to a (virtual) Ubuntu Server HS3, I also needed to move all ip communication for my Epson projector, Marantz receiver, GC100-12 and a few other items like SqueezeServer control - all implemented with this superb Plug-in. Since everything is in the ini file, this part of the migration was about 1 minute of work.... Very Handy, and very very easy!

                        Big Thanks!

                        Comment


                          Originally posted by larhedse View Post
                          I also needed to move all ip communication for my Epson projector, Marantz receiver, - all implemented with this superb Plug-in. S

                          Big Thanks!
                          Good evening,

                          I also have an EPSON TW-7300 videoprojector

                          can you share your ini.file to control the videoprojector and marantz receiver?

                          Thank you

                          Jean-Francois.

                          Comment


                            Originally posted by jfla View Post
                            can you share your ini.file to control the videoprojector and marantz receiver?
                            Code:
                            [Commands]
                            -30dB=C Escaped,MV50\r
                            -35dB=C Escaped,MV45\r
                            -40dB=C Escaped,MV40\r
                            -45dB=C Escaped,MV35\r
                            -50dB=C Escaped,MV30\r
                            -55dB=C Escaped,MV25\r
                            MUTE=C Escaped,MV10\r
                            Vol -=C Escaped,MVDOWN\r
                            Vol +=C Escaped,MVUP\r
                            Radio=C Escaped,SITUNER\r
                            ComHem=C Escaped,SISAT/CBL\r
                            Movie=C Escaped,SIDVD\r
                            BamseCast - Audio=C Escaped,SIBD\r
                            BamseCast - Video=C Escaped,SIBD\r
                            Internet Radio=C Escaped,SIIRADIO\r
                            Disc - DVD/BR=C Escaped,SISAT/CBL\r
                            Disc - CD=C Escaped,SISAT/CBL\r
                            Power ON=C Escaped,ZMON\r
                            Power OFF=C Escaped,ZMOFF\r
                            Internet Radio Preset Station 1=C Escaped,NSB00\r
                            Internet Radio Preset Station 2=C Escaped,NSB01\r
                            Internet Radio Preset Station 3=C Escaped,NSB02\r
                            Internet Radio Preset Station 4=C Escaped,NSB03\r
                            Internet Radio Preset Station 5=C Escaped,NSB04\r
                            Internet Radio Preset Station 6=C Escaped,NSB05\r
                            Internet Radio Preset Station 7=C Escaped,NSB06\r
                            Internet Radio Preset Station 8=C Escaped,NSB07\r
                            Dynamic EQ ON=C Escaped,PSDYNEQ ON\r
                            Dynamic EQ OFF=C Escaped,PSDYNEQ OFF\r
                            Loudness ON=C Escaped,PSLOM ON\r
                            Loudness OFF=C Escaped,PSLOM OFF\r
                            Projector ON=C Escaped,sendir,4:2,1,38000,1,1,343,170,22,62,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,62,22,20,22,62,22,20,22,62,22,20,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,20,22,20,22,62,22,62,22,62,22,62,22,62,22,20,22,62,22,62,22,20,22,3800\r
                            Projector OFF=C Escaped,sendir,4:2,1,38000,1,1,343,169,22,62,22,62,22,20,22,20,22,20,22,20,22,20,22,62,22,62,22,20,22,62,22,20,22,62,22,20,22,62,22,20,22,62,22,20,22,20,22,20,22,62,22,20,22,20,22,62,22,20,22,62,22,62,22,62,22,20,22,62,22,62,22,20,22,3800\r

                            Comment


                              Install Directory

                              I can't find the installation directory on HS3 Raspberry pi image where the hs3.exe file is. I am using winscp to copy the files over but can't find anything for homeseer. I un-hide files in winscp but no-where to be found using search or just browsing directories. Anyone that can point me in the right place I would appreciate it.
                              Also does the serial feature of this plugin work on the raspberry pi?

                              Thanks,

                              Mark

                              (Edit) I found the directory using pwd in the linux command box in the web gui. /usr/local/HomeSeer

                              I enabled the plugin after a reboot but the serial tab is missing and I can see my ftdi usb to serial is installed. I am going to assume that this plugin's serial feature only works on a windows pc. If I am wrong please let me know.

                              Thanks
                              Last edited by marksmanaz; February 17, 2018, 07:04 PM. Reason: Found partial answer

                              Comment


                                Originally posted by marksmanaz View Post
                                I can't find the installation directory on HS3 Raspberry pi image where the hs3.exe file is. I am using winscp to copy the files over but can't find anything for homeseer. I un-hide files in winscp but no-where to be found using search or just browsing directories. Anyone that can point me in the right place I would appreciate it.
                                Also does the serial feature of this plugin work on the raspberry pi?

                                Thanks,

                                Mark

                                (Edit) I found the directory using pwd in the linux command box in the web gui. /usr/local/HomeSeer

                                I enabled the plugin after a reboot but the serial tab is missing and I can see my ftdi usb to serial is installed. I am going to assume that this plugin's serial feature only works on a windows pc. If I am wrong please let me know.

                                Thanks
                                You are correct, the direct serial features only work on Windows. This is a limitation with the underlying Mono framework. However, you can use Ser2Net to workaround this. I have several serial devices connected to the plugin running on an RPi using this method.

                                -David

                                Comment

                                Working...
                                X