Announcement

Collapse
No announcement yet.

Public Function/Procedure Calls

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

    Public Function/Procedure Calls

    Mark, does your plugin support any user accessible calls. Any documentation?

    Specifically, since HS3 did away with PollDevice, I am looking for an alternative for polling X10 devices.

    Thanks.

    #2
    see the following for a sample
    http://board.homeseer.com/showthread.php?t=154291#7

    With hs3 you can call just about any plugin routine. here is the protocol for polldevice

    Public Function PollDevice(ByVal dvref As Integer) As IPlugInAPI.PollResultInfo
    Mark

    HS3 Pro 4.2.19.5
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
    Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

    Comment


      #3
      Cool, thank you!

      Comment


        #4
        Hi Mark, thanks for your help. I am using this routine to poll devices and it works well on all Insteon devices. I am having a timeout issue with my my rain8 x10 polling. I increased the "WaitTimeout" parameter in the Insteon.ini, but it doesn't seem to have an effect. Any advice?

        Thanks,
        -ron

        Sub Main(Parm As Object)

        Dim ri As IPlugInAPI.PollResultInfo
        ri = hs.PluginFunction("Insteon", "", "PollDevice", New Object() {devref})
        hs.writelog("polling result", ri.Result.tostring)
        hs.writelog("polling value", ri.Value.tostring)

        End Sub

        Comment


          #5
          are you at least seeing a status response from the x10 device in the hs log? you may need to enable detailed logging.
          Mark

          HS3 Pro 4.2.19.5
          Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
          Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
          Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

          Comment


            #6
            Mark, I ran the following tests with two devices (Test Device 1, Test Device 2) with debug on. Test Device 1 is a 2-way (set to support status), Test Device 2 is 1-way (but also set to support status for compare).

            Simple turn "on" test, Log for 2-way Test Device 1 (seems like it received status):

            Jan-18 10:33:45 AM X10 INFO Callback: Dev= N5, HC= N, Cmd= 13, 0/0
            Jan-18 10:33:45 AM X10 INFO Callback: Dev= N5, HC= N, Cmd= 2, 0/0
            Jan-18 10:33:35 AM Insteon Processing Received X10 Command: N Status=On
            Jan-18 10:33:35 AM Insteon PLM_ProcessInBuffer received STX 0x52 (Raw X10 Rec):8D 80
            Jan-18 10:33:35 AM Insteon Processing Received X10 Address: N5
            Jan-18 10:33:35 AM Insteon PLM_ProcessInBuffer received STX 0x52 (Raw X10 Rec):81 00
            Jan-18 10:33:34 AM Insteon ..Got PLM Response 02 63 82 80 06
            Jan-18 10:33:34 AM Insteon Sending command 02 63 82 80 to PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
            Jan-18 10:33:33 AM Insteon ..Got PLM Response 02 63 81 00 06
            Jan-18 10:33:33 AM Insteon Sending command 02 63 81 00 to PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
            Jan-18 10:33:33 AM Insteon Immediate Send X10 Command: N5 Cmd:2 Pcnt:100 Data1: 0 Data2:0
            Jan-18 10:33:33 AM Insteon CAPIControl: Label=On, Value=100, ControlType=Button
            Jan-18 10:33:33 AM Device Control Device: Test Test Device 1 to On (100) by/from: CAPI Control Handler

            Simple turn "on" test, Log for 1-way Test Device 2:

            Jan-18 10:49:52 AM X10 INFO Callback: Dev= K1, HC= K, Cmd= 2, 0/0
            Jan-18 10:49:45 AM Insteon ..Got PLM Response 02 63 32 80 06
            Jan-18 10:49:45 AM Insteon Sending command 02 63 32 80 to PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
            Jan-18 10:49:45 AM Insteon ..Got PLM Response 02 63 36 00 06
            Jan-18 10:49:45 AM Insteon Sending command 02 63 36 00 to PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
            Jan-18 10:49:45 AM Insteon Immediate Send X10 Command: K1 Cmd:2 Pcnt:100 Data1: 0 Data2:0
            Jan-18 10:49:45 AM Insteon CAPIControl: Label=On, Value=100, ControlType=Button
            Jan-18 10:49:45 AM Device Control Device: Test Test Device 2 to On (100) by/from: CAPI Control Handler

            Polling from the HS3 device web page:
            Polling...
            1 @ Polling: Test Test Device 1 (Status isPlugin Reports Timeout Before Result)
            0 @ Polling: Test Test Device 2 (Status isPlugin Reports Timeout Before Result)
            Done

            Results of my script for Test Device 1:
            Jan-18 10:54:41 AM X10 INFO Callback: Dev= N5, HC= N, Cmd= 13, 0/0
            Jan-18 10:54:41 AM X10 INFO Callback: Dev= N5, HC= N, Cmd= 15, 0/0
            Jan-18 10:54:33 AM polling value 0
            Jan-18 10:54:33 AM polling result Timeout_OK

            (note, X10 is responding after the PollDevice results)

            Results of my script for Test Device 2:
            Jan-18 10:56:59 AM X10 INFO Callback: Dev= K1, HC= K, Cmd= 15, 0/0
            Jan-18 10:56:52 AM polling value 0
            Jan-18 10:56:52 AM polling result Timeout_OK

            Results of my script on an Insteon device (it works fine):

            Jan-18 11:00:37 AM polling value 100
            Jan-18 11:00:37 AM polling result OK
            Jan-18 11:00:37 AM Insteon Setting status and value for device 05.40.E9:1. Old status:100 Old Value:100, New Status:2 New Value:100
            Jan-18 11:00:37 AM Insteon Received a Direct ACK from Downstairs Utility Room Light (05.40.E9)
            Jan-18 11:00:37 AM Insteon Received message from Downstairs Utility Room Light (05.40.E9) taking hops: 1
            Jan-18 11:00:37 AM Insteon StandardDeviceClass ProcessStatus called with Level:255
            Jan-18 11:00:37 AM Insteon Database delta value of 3 for device 05.40.E9 is current. No changes since last database update.
            Jan-18 11:00:37 AM Insteon [CheckDeltas] Database recently heard delta value for device 05.40.E9 is current.
            Jan-18 11:00:37 AM Insteon Received STX 0x50 (Raw Insteon Rec):05 40 E9 0D FC FA 21 03 FF
            Jan-18 11:00:37 AM Insteon ..Got PLM Response 02 62 05 40 E9 05 19 00 06
            Jan-18 11:00:37 AM Insteon Sending command 02 62 05 40 E9 05 19 00 to PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
            Jan-18 11:00:37 AM Insteon Attempting to update the status for Downstairs Utility Room Light (05.40.E9)
            Jan-18 11:00:37 AM Insteon Requesting Insteon status (Polling) for device Downstairs Utility Room Light (05.40.E9)
            Jan-18 11:00:37 AM Event Running script in background: C:/HomeSeer HS3/scripts/test script.vb
            Jan-18 11:00:37 AM Event Event Trigger "Test Events New Event - 7"

            Mark, any help you can provide would be great!

            Thanks,
            -ron

            Comment


              #7
              Mike,
              i think i have the x10 wait timeout set for 2 secs instead of the user value from the config page.

              I can post a new version here for you to try but i have been making some changes that will may affect KPLs with fw 41+ that you have registered (the Off hs device will be deleted). Can you check your registered devices to see if this will be a problem.

              what do you think?
              Mark

              HS3 Pro 4.2.19.5
              Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
              Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
              Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

              Comment


                #8
                Hi Mark, yes please do post a version with a longer wait time.
                My production stuff runs on HS2, so no issue with taking a test update for HS3.

                Thanks,
                Ron

                Comment


                  #9
                  Here you go. Untested but the wait time should be equal to what you set on the config page.

                  please post a log snippet of the poll device from the hs dev mgmt page

                  This is beta. Registered KPLs will be affected; specifically the Off hs device will be deleted for fw 41+
                  Attached Files
                  Mark

                  HS3 Pro 4.2.19.5
                  Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                  Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                  Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                  Comment


                    #10
                    Thanks Mark. This is version: 3.0.5.13, as reported on the plugin page.

                    I can see an effect from increasing "WaitTimeout" on the amount of time it takes for the polling response. However, it still reports a timeout for Test Device 1, which is 2-way.

                    Polling...
                    1 @ Polling: Test Test Device 1 (Status isPlugin Reports Timeout Before Result)
                    0 @ Polling: Test Test Device 2 (Status isPlugin Reports Timeout Before Result)
                    Done

                    The HS3 log shows, when turning the device On:

                    Jan-18 10:12:21 PM X10 INFO Callback: Dev= N5, HC= N, Cmd= 13, 0/0
                    Jan-18 10:12:15 PM X10 INFO Callback: Dev= N5, HC= N, Cmd= 2, 0/0
                    Jan-18 10:12:10 PM Insteon Processing Received X10 Command: N Status=On
                    Jan-18 10:12:10 PM Insteon PLM_ProcessInBuffer received STX 0x52 (Raw X10 Rec):8D 80
                    Jan-18 10:12:09 PM Insteon Processing Received X10 Address: N5
                    Jan-18 10:12:09 PM Insteon PLM_ProcessInBuffer received STX 0x52 (Raw X10 Rec):81 00
                    Jan-18 10:12:08 PM Insteon ..Got PLM Response 02 63 82 80 06
                    Jan-18 10:12:08 PM Insteon Sending command 02 63 82 80 to PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
                    Jan-18 10:12:08 PM Insteon ..Got PLM Response 02 63 81 00 06
                    Jan-18 10:12:08 PM Insteon Sending command 02 63 81 00 to PLM, (Expecting 0 bytes extra back) Pre-Payload ACK:False, NAK is ok:False
                    Jan-18 10:12:08 PM Insteon Immediate Send X10 Command: N5 Cmd:2 Pcnt:100 Data1: 0 Data2:0
                    Jan-18 10:12:08 PM Insteon CAPIControl: Label=On, Value=100, ControlType=Button
                    Jan-18 10:12:08 PM Device Control Device: Test Test Device 1 to On (100) by/from: CAPI Control Handler

                    On line: Insteon Processing Received X10 Command: N Status=On
                    Should that be "N5 Status=On"?

                    Another tip might be that the status icon for the device disappears.

                    Thanks,
                    Ron

                    Comment


                      #11
                      Ok.i think i figured out the problem. Your device is responding with a different status (status=on or status=off) x10 cmd than i was expecting. so give this a try
                      Attached Files
                      Mark

                      HS3 Pro 4.2.19.5
                      Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                      Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                      Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                      Comment


                        #12
                        Mark, it works. Thank you for the outstanding support!

                        -Ron

                        Comment


                          #13
                          You're welcome. Glad its working.
                          Mark

                          HS3 Pro 4.2.19.5
                          Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway | Tuya Smart Plugs
                          Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 | Ultra1Wire3 | RFXCOM | HS MyQ | BLRadar | BLDenon | Tuya | Jon00 Charting | Jon00 Links
                          Platform: Windows Server 2022 Standard, i5-12600K/3.7GHz/10 core, 16GB RAM, 500GB SSD

                          Comment

                          Working...
                          X