Announcement

Collapse
No announcement yet.

X10 Plugin: using ExecX10() from a script

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #61
    Sub Main(ByVal Parms as String)

    Dim Code As String = "H4" ' Device Code
    Dim Cmd As String = "Extended" ' X10 Command
    Dim DimVal As String = "" ' For standard dims, in % dim (0-100)
    Dim ExtCmd As String = "31" ' Extended X10 Command byte, as a hex string ("00" - "FF"), both upper and lower case are accepted.
    Dim ExtData As String = "00" ' Extended X10 Data byte, as a hex string ("00" - "FF"), both upper and lower case are accepted.
    Dim sRet As String

    ' Create an object that references the X10 plugin
    Dim CM15aPlugin as HomeSeerAPI.PluginAccess = New HomeSeerAPI.PluginAccess(hs, "CM15A","")

    ' Call the ExecX10() function within the plugin
    Sret = CM15aPlugin.PluginFunction("ExecX10",{Code,Cmd,DimVal,ExtCmd ,ExtData})

    End Sub

    Comment


      #62
      Just posted a new version of the CM15a plugin (...debug2.zip) for you to try. All I did was add some additional logging to verify that extended commands and data are being sent properly. I also changed the log level of the 'error' messages for RF and extended commands not being supported from 'Error' to 'Debug' so you have control of whether they are displayed or not using the "Developer Mode" checkbox on the Manage Plugins page. You MUST restart the plugin every time you change the Developer Mode setting as the plugin only checks this when it starts.

      Please let me know what happens!
      Best regards,
      -Mark-

      If you're not out on the edge, you're taking up too much room!
      Interested in 3D maps? Check out my company site: Solid Terrain Modeling

      Comment


        #63
        Hi Mark, same script; with debug enabled:
        Jan-21 8:48:29 PM CM15A DEBUG Error in PluginProc: Exception has been thrown by the target of an invocation.
        Jan-21 8:48:29 PM Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/X10 EXTcommands TEST.vb
        Jan-21 8:48:29 PM Event Event Trigger "ZZZ TEST ZONE X10 Extended commands"
        Jan-21 8:48:29 PM Event Event ZZZ TEST ZONE X10 Extended commands triggered by the event page 'Run' button.

        Comment


          #64
          I suspect one of these 2 strings to be incorrect as they are not present in the command line call

          Dim Cmd As String = "Extended" ' X10 Command
          Dim DimVal As String = "" ' For standard dims, in % dim (0-100)

          not the actual scripting but the contents: "Extended" and ""

          Comment


            #65
            Sorry about that, an inadvertent typo just prior to publishing. Please try v3.0.0.12 Debug3 and post your log entries.
            Best regards,
            -Mark-

            If you're not out on the edge, you're taking up too much room!
            Interested in 3D maps? Check out my company site: Solid Terrain Modeling

            Comment


              #66
              Here it is:

              Jan-23 2:22:30 PM CM15A DEBUG Error in PluginProc: Exception has been thrown by the target of an invocation.
              Jan-23 2:22:30 PM Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/X10 EXTcommands TEST.vb
              Jan-23 2:22:30 PM Event Event Trigger "ZZZ TEST ZONE X10 Extended commands"


              Sub Main(ByVal Parms as String)

              Dim Code As String = "H4" ' Device Code
              Dim Cmd As String = "Extended" ' X10 Command
              Dim DimVal As String = "" ' For standard dims, in % dim (0-100)
              Dim ExtCmd As String = "31" ' Extended X10 Command byte, as a hex string ("00" - "FF"), both upper and lower case are accepted.
              Dim ExtData As String = "00" ' Extended X10 Data byte, as a hex string ("00" - "FF"), both upper and lower case are accepted.
              Dim sRet As String

              ' Create an object that references the X10 plugin
              Dim CM15aPlugin as HomeSeerAPI.PluginAccess = New HomeSeerAPI.PluginAccess(hs, "CM15A","")

              ' Call the ExecX10() function within the plugin
              Sret = CM15aPlugin.PluginFunction("ExecX10",{Code,Cmd,DimVal,ExtCmd ,ExtData})

              End Sub

              Comment


                #67
                When you replaced the .exe did you shut down HS, copy the new exe over the old one, then restart HS? I ask because I've tested the file I uploaded on 2 installs of HS and cannot get either of them to produce this error.
                Best regards,
                -Mark-

                If you're not out on the edge, you're taking up too much room!
                Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                Comment


                  #68
                  Yes. just tried again, same result.

                  Comment


                    #69
                    Ok, thanks for confirming. Not sure what the issue is so I've posted Debug4 with additional error logging. Please give it a try and let me know what happens!
                    Best regards,
                    -Mark-

                    If you're not out on the edge, you're taking up too much room!
                    Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                    Comment


                      #70
                      Jan-31 6:13:33 PM CM15A ERROR Error in PluginFunction(), ERL: 150. Msg: Exception has been thrown by the target of an invocation.
                      Jan-31 6:13:31 PM Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/X10 EXTcommands TEST.vb
                      Jan-31 6:13:31 PM Event Event Trigger "ZZZ TEST ZONE X10 Extended commands"
                      Jan-31 6:13:31 PM Event Event ZZZ TEST ZONE X10 Extended commands triggered by the event page 'Run' button.

                      Comment


                        #71
                        Could you try running this again with Developer Mode turned on (then restarting the plugin)? There are some debug messages that should be logged before this line but I don't see them in your log. Those should help provide a clue about what's happening.

                        Thanks!
                        Best regards,
                        -Mark-

                        If you're not out on the edge, you're taking up too much room!
                        Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                        Comment


                          #72
                          Feb-07 3:46:21 PM CM15A ERROR Error in PluginFunction(), ERL: 150. Msg: Exception has been thrown by the target of an invocation.
                          Feb-07 3:46:21 PM CM15A DEBUG PluginFunction(): called with Function='ExecX10' and params='H4, Extended, , 31, ff'
                          Feb-07 3:46:21 PM Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/X10 EXTcommands TEST.vb
                          Feb-07 3:46:21 PM Event Event Trigger "ZZZ TEST ZONE X10 Extended commands"
                          Feb-07 3:46:21 PM Event Event ZZZ TEST ZONE X10 Extended commands triggered by the event page 'Run' button.

                          Comment


                            #73
                            Thank you for testing this again! I have resolved this error and posted what I believe should be the final working version to the beta page (HSPI_CM15A_3_0_0_12.zip). Please let me know happens.
                            Best regards,
                            -Mark-

                            If you're not out on the edge, you're taking up too much room!
                            Interested in 3D maps? Check out my company site: Solid Terrain Modeling

                            Comment


                              #74
                              Hi Mark,

                              Works now =)
                              should definitely help other X10 users.
                              Feb-18 2:32:09 PM CM15A DEBUG X10 data received that is not supported by this version of the CM15a plugin. RxType: recvplc, P2: h4, P3: ExtCode, P4: 49 (0x31), P5: 0 (0x00), P6: , P7: . No action taken.
                              Feb-18 2:32:09 PM CM15A DEBUG Command sent to AHScript 'sendplc H4 extcode 31 00'
                              Feb-18 2:32:09 PM CM15A DEBUG PluginFunction(): called with Function='ExecX10' and params='H4, Extended, , 31, 00'
                              Feb-18 2:32:08 PM Event Running script in background: C:/Program Files (x86)/HomeSeer HS3/scripts/X10 EXTcommands TEST.vb
                              Feb-18 2:32:08 PM Event Event Trigger "ZZZ TEST ZONE X10 Extended commands"
                              Feb-18 2:32:08 PM Event Event ZZZ TEST ZONE X10 Extended commands triggered by the event page 'Run' button.
                              Great work. thanks again!

                              Comment


                                #75
                                Hi guys, I'm having difficulty figuring out how to execute an "ExecX10" command in a script in HS4. I'm using the X10 plugin and it works fine in Events. Devices have been added through the X10 plug-in. I'm running a CM11A on Windows 10 Pro.

                                I've read through this thread and am confused. Does the X10 plugin provide the link such that I can utilize the ExecX10 command or do I need to additional scripting. Most of the scripts that I'm trying to adapt are HS 1.7 VB scripts.

                                I would appreciate any guidance. Thanks

                                Comment

                                Working...
                                X