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 drule View Post

    This might be enough but I'm concerned that Homeseer event will get to the last data received/script action before your device has had the chance to respond. You might need to insert a wait action in-between the last send command and the send to script action.

    -David
    I just restarted the HS, everything was fine. I also removed the "Send Data To Script".

    Code:
    des-28 23.08.01	 	Pass-thru	Volume set to : -3.00 A
    des-28 23.08.01	 	Pass-thru	Connection to : ClearOne PSR1212
    des-28 23.08.01	 	drhsIpPlugIn	Sending 15 bytes to ClearOne PSR1212
    des-28 23.08.01	 	drhsIpPlugIn	Sending 4 bytes to ClearOne PSR1212
    des-28 23.08.01	 	Event	Event Trigger "Test Druletest"
    des-28 23.08.01	 	Event	Event Test Druletest triggered by the event page 'Run' button.
    This is the log now, after some editing of the script.

    Thanks a lot to pointing me in the right direction.

    Comment


      Originally posted by Xian View Post
      I just restarted the HS, everything was fine. I also removed the "Send Data To Script".

      Code:
      des-28 23.08.01	 	Pass-thru	Volume set to : -3.00 A
      des-28 23.08.01	 	Pass-thru	Connection to : ClearOne PSR1212
      des-28 23.08.01	 	drhsIpPlugIn	Sending 15 bytes to ClearOne PSR1212
      des-28 23.08.01	 	drhsIpPlugIn	Sending 4 bytes to ClearOne PSR1212
      des-28 23.08.01	 	Event	Event Trigger "Test Druletest"
      des-28 23.08.01	 	Event	Event Test Druletest triggered by the event page 'Run' button.
      This is the log now, after some editing of the script.

      Thanks a lot to pointing me in the right direction.
      Good news!

      Comment


        New questtion :

        How can I use hs.pluginfunction and callback ?

        Comment


          Hello,
          I have a small problem with the plugin. Version 0.30

          I have an Yeelight Wifi StripLed

          after a while, the connections are no longer active.

          I must resend the event.

          The yeelight stripLed is always on network

          My command:
          Power OFF : --> {"id": 2, "method": "set_power", "params": ["off", "smooth", 500]}\r\n
          Power ON : --> {"id":1,"method":"set_power","params":["on","smooth",500]}\r\n

          Set Scene type 4-7-8 --> {"id":1,"method":"set_scene","params":["cf",100,1,"4000,2,4000,30,7000,2,4000,10,8000,2,4000,1"]}\r\n

          Set Scene type Police: --> {"id":1,"method":"set_scene","params":["cf",0,0,"300,1,16711680,1,50,1,222,1,50,1,3355647,100,50,1, 222,1,50,1,16711680,100,50,1,222,1,50,1,3355647,100,50,1,222 ,1"]}\r\n

          My connection ( see screen shot)

          Yesterday, i have created some command, and Ini file is miscompleted.

          At startup, i have this log:

          My Ini File :

          [Settings]
          open=checked
          [Connections]
          Yeelight Discover=Host,UDP,,1982,,Passthru.vb,0,239.255.255.250,<N/A>
          AVR_3313=Client,TCP,192.168.xx.22,23,,AVR3313.vb,1,,<N/A>
          Yeelight-1=Client,TCP,192.168.xx.33,55443,,Passthru.vb,1,,<N/A>
          [Commands]
          PioAVR Pwr Off=C Escaped,PWSTANDBY\r
          PioAVR Pwr On=C Escaped,PWON\r
          PAPP T1=C Escaped,Reset
          Yeelight-1 Power ON=C Escaped,{"id":1,"method":"set_power","params":["on","smooth",500]}\r\n
          Yeelight-1 Power OFF=C Escaped,{"id": 2, "method": "set_power", "params": ["off", "smooth", 500]}\r\n
          Yeelight set_ct_abx=C Escaped,{"id":5,"method":"set_ct_abx","params":[1700, "smooth", 500]}\r\n
          Yeelight set_rgb=C Escaped,{"id":3,"method":"set_rgb","params":[65536, "smooth", 500]}\r\n
          Yeelight set_HUE=C Escaped,{"id":4,"method":"set_hsv","params":[1, 100, "smooth", 500]}\r\n
          Test PWR TW7300=C Escaped,45 53 43 2F 56 50 2E 6E 65 74 10 03 0d
          New command-cd91=
          Yeelight Start_Cf=
          New command-53ce=
          Yeelight Stop_Cf=C Escaped,{"id": 2, "method": "stop_cf", "params": []}\r\n
          Yeelight Mode Bougie=C Escaped,{"id":3,"method":"start_cf","params":[ 0,0,800,2,2700,50,800,2,2700,30,1600,2,2700,80,800,2,2700,60 ,1200,2,2700,90,2400,2,2700,50,1200,2,2700,80,800,2,2700,60, 400,2,2700,70"]}\r\n
          New command-a16b=
          Test Flow=C Escaped,{"id":1,"method":"start_cf","params":[ 0,1,"300,1,16711680,50,4000,7,0,0,300,1,16776960,50,7000,7,0 ,0,300,1,16711935,50, 8000,7,0,0"]}\r\n
          New command-732b=
          Yeelight Set_scene Police=C Escaped,{"id":1,"method":"set_scene","params":["cf",0,0,"300,1,16711680,1,50,1,222,1,50,1,3355647,100,50,1, 222,1,50,1,16711680,100,50,1,222,1,50,1,3355647,100,50,1,222 ,1"]}\r\n
          New command-3c6f=
          Yeelight 4-7-8 mode=C Escaped,{"id":1,"method":"set_scene","params":["cf",100,1,"4000,2,4000,30,7000,2,4000,10,8000,2,4000,1"]}\r\n
          Jean-Francois
          Attached Files

          Comment


            Originally posted by jfla View Post
            Hello,
            I have a small problem with the plugin. Version 0.30

            I have an Yeelight Wifi StripLed

            after a while, the connections are no longer active.



            I must resend the event.

            The yeelight stripLed is always on network

            My command:
            Power OFF : --> {"id": 2, "method": "set_power", "params": ["off", "smooth", 500]}\r\n
            Power ON : --> {"id":1,"method":"set_power","params":["on","smooth",500]}\r\n

            Set Scene type 4-7-8 --> {"id":1,"method":"set_scene","params":["cf",100,1,"4000,2,4000,30,7000,2,4000,10,8000,2,4000,1"]}\r\n

            Set Scene type Police: --> {"id":1,"method":"set_scene","params":["cf",0,0,"300,1,16711680,1,50,1,222,1,50,1,3355647,100,50,1, 222,1,50,1,16711680,100,50,1,222,1,50,1,3355647,100,50,1,222 ,1"]}\r\n

            My connection ( see screen shot)

            Yesterday, i have created some command, and Ini file is miscompleted.

            At startup, i have this log:



            My Ini File :



            Jean-Francois
            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

            Comment


              Originally posted by Xian View Post
              New questtion :

              How can I use hs.pluginfunction and callback ?
              Is this what you are looking for?
              Code:
              hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_Command", New Object(){"Test Connection", "Test Command"})
              hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_Data", New Object(){"Test Connection", "Hello\sworld\r\n", "C Escaped"})
              
              “Ext_Send_Command” will send the predefined command, eg “Test Command”, to the connection “Test Connection”.
              “Ext_Send_Data” will send a string, eg "Hello\sworld\r\n", parsed as either “URL-Encoded, Raw Test, Binary or C Escaped”, to the connection “Test Connection”.

              Comment


                Solved...
                Maybe... but how can I implement that in the callback script ?
                Last edited by Xian; December 30, 2017, 02:14 PM.

                Comment


                  Originally posted by Xian View Post
                  Maybe... but how can I implement that in the callback script ?
                  I'm not sure I understand what you are trying to do. Can you give me some more detail?

                  Comment


                    On last question, I suddenly realise that is the connection which have the callback script, not the code :
                    Code:
                    hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_Command", New Object(){"Test Connection", "Test Command"})
                    hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_Data", New Object(){"Test Connection", "Hello\sworld\r\n", "C Escaped"})
                    
                    “Ext_Send_Command” will send the predefined command, eg “Test Command”, to the connection “Test Connection”.
                    “Ext_Send_Data” will send a string, eg "Hello\sworld\r\n", parsed as either “URL-Encoded, Raw Test, Binary or C Escaped”, to the connection “Test Connection”.
                    How can I connect to a IR port on a GC-12, or Itach IP2IR, for sending IR to a Matrix. I also see that some are getting feedback from IR. Howto ?

                    Comment


                      Originally posted by Xian View Post
                      On last question, I suddenly realise that is the connection which have the callback script, not the code :
                      Code:
                      hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_Command", New Object(){"Test Connection", "Test Command"})
                      hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_Data", New Object(){"Test Connection", "Hello\sworld\r\n", "C Escaped"})
                      
                      “Ext_Send_Command” will send the predefined command, eg “Test Command”, to the connection “Test Connection”.
                      “Ext_Send_Data” will send a string, eg "Hello\sworld\r\n", parsed as either “URL-Encoded, Raw Test, Binary or C Escaped”, to the connection “Test Connection”.
                      How can I connect to a IR port on a GC-12, or Itach IP2IR, for sending IR to a Matrix. I also see that some are getting feedback from IR. Howto ?
                      You can send IR codes to a GC-12 or iTach from an Event. In the plugin config, configure your global cache device as a TCP client and in the IR commands tab, enter IR codes in Pronto Hex format. When you create an event, you can choose which IR LED to send the code to.

                      Click image for larger version

Name:	Screen Shot 2018-01-01 at 1.24.30 PM.jpg
Views:	1
Size:	21.7 KB
ID:	1194591

                      Event:

                      Click image for larger version

Name:	Screen Shot 2018-01-01 at 1.22.46 PM.jpg
Views:	1
Size:	31.2 KB
ID:	1194590

                      The plugin can receive IR commands from a GC-IRE or GC-IRL

                      Click image for larger version

Name:	Screen Shot 2018-01-01 at 1.20.47 PM.jpg
Views:	1
Size:	20.4 KB
ID:	1194589

                      -David

                      Comment


                        So not possible to send IR Command via scripting ?

                        Comment


                          Originally posted by Xian View Post
                          So not possible to send IR Command via scripting ?
                          You can send Global Cache sendir strings via scripting but not direct IR commands. So if you had connections and commands like:

                          Click image for larger version

Name:	Screen Shot 2018-01-01 at 1.43.22 PM.jpg
Views:	1
Size:	18.6 KB
ID:	1194593
                          Click image for larger version

Name:	Screen Shot 2018-01-01 at 1.39.42 PM.jpg
Views:	1
Size:	10.6 KB
ID:	1194592

                          You could send it from a script:

                          Code:
                          hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_Command", New Object(){"GC-100-18R", "DirecTV - 0 (IR)"})
                          This works in the current version. I will add a new function "Ext_Send_IR_Command" for direct IR scripting, to a future version of the plugin.

                          -David

                          Comment


                            Thanks


                            Sent from my iPhone using Tapatalk

                            Comment


                              v31 sent to cheeryfool for uploading. Only change is the inclusion of a new external scripting command "Ext_Send_IR_Command". The syntax is:

                              Code:
                              'hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_IR_Command", New Object(){[I]Connection[/I], [I]Type[/I], [I]IR Code[/I], [I]LED[/I], [I]Repeat Count[/I]})
                              ' for example:
                              
                              hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_IR_Command", New Object(){"GC-100-12", "Global cache", "DTV_1_Select", "4:1", "2"})

                              Comment


                                Originally posted by drule View Post
                                v31 sent to cheeryfool for uploading. Only change is the inclusion of a new external scripting command "Ext_Send_IR_Command". The syntax is:

                                Code:
                                'hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_IR_Command", New Object(){[I]Connection[/I], [I]Type[/I], [I]IR Code[/I], [I]LED[/I], [I]Repeat Count[/I]})
                                ' for example:
                                
                                hs.PluginFunction("drhsIpPlugin", "", "Ext_Send_IR_Command", New Object(){"GC-100-12", "Global cache", "DTV_1_Select", "4:1", "2"})
                                v31 uploaded
                                cheeryfool

                                Comment

                                Working...
                                X