Announcement

Collapse
No announcement yet.

Script to Arm Panel

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

    Script to Arm Panel

    I feel real silly posting this because this seems like it should be simple, but when I try to use the sample script to arm my panel:

    Imports HSPI_VISTAALARM

    Sub main()
    Dim VA As HSPI
    VA = hs.Plugin("Vista Alarm")
    VA.ArmAway()
    End Sub


    I get a error that "expected end of statement in line 4". I'm missing something real simple, I'm sure...running version 1.2.5 of the plugin if it makes a difference. What am I doing wrong.

    #2
    You can't "dim X as" in a vb script try
    dim VA
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Thanks for your help.

      When I try that I get "type mismatch: Imports".

      Comment


        #4
        I don't think for a plugin you need to import, in fact you might be able to get away with a single line in the script (slightly bad coding as I think you are meant to check if the plugin exists firsts, worst case you just get an error). Imports I understand are for bringing in DLL's that are outside of the normal HS base (that you reference in the settings.ini file).

        Sub main()
        hs.Plugin("Vista Alarm").ArmAway()
        End Sub

        Comment


          #5
          That doesn't seem to work either.

          Comment


            #6
            is there an error in the HS log file?

            Comment


              #7
              It says "Parameter Count mismatch"

              Comment


                #8
                Originally posted by doublek View Post
                I feel real silly posting this because this seems like it should be simple, but when I try to use the sample script to arm my panel:

                Imports HSPI_VISTAALARM

                Sub main()
                Dim VA As HSPI
                VA = hs.Plugin("Vista Alarm")
                VA.ArmAway()
                End Sub


                I get a error that "expected end of statement in line 4". I'm missing something real simple, I'm sure...running version 1.2.5 of the plugin if it makes a difference. What am I doing wrong.
                the original script a vb.net.

                you must name the script file with a .vb extension, for example myscript.vb

                then you can exec it with the following call

                hs.runex "myscript.vb", "main", ""

                this should work.

                but as Rupp suggested, a call like the following works as well
                hs.Plugin("Vista Alarm").chimemode
                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


                  #9
                  Went with Rupp's way...hs.Plugin("Vista Alarm").ArmAway did the trick.

                  Thanks for all your help.

                  Comment


                    #10
                    Ah, it's a .net script so you must use
                    Sub Main(parm as object)
                    and name it with a .vb extension
                    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                    Comment


                      #11
                      [code]

                      Comment


                        #12
                        Originally posted by Jay Dubz View Post
                        [code]
                        I think I would add a new triggered, called "Disarming Initiated" which would fire when you send the [code]+1 cmd. Otherwise I don't know how you would capture the event.

                        Or maybe we need a "Burgular Alarm cleared" trigger that would fire after the disarm commands are received.

                        do you think that either would help?

                        I don't know how we would do this in a script
                        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