Announcement

Collapse
No announcement yet.

HS2 alarm plug in and if-then script help needed

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

    HS2 alarm plug in and if-then script help needed

    Hi, I have been trying to figure out how to do this for several hours and need some help. I have the BLSecurity plug in which has been working great for many years!

    I'd like to pulse one of 4 server outputs based on the alarm status, in an if-then script. The output part works. Where I am getting stuck is how to use the SystemStatus with an if-then. I'd like to pulse output 1 if SystemStatus is 1 (i.e. ready) etc.

    Imports HSPI_VISTAALARM
    Sub Main(SystemStatus As Short)
    If SystemStatus = 1 Then
    hs.GetURLIE ("http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=1:/300\",False)
    ElseIf SystemStatus = 2 Then
    hs.GetURLIE ("http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=2:/300\",False)
    ElseIf SystemStatus = 3 Then
    hs.GetURLIE ("http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=3:/300\",False)
    ElseIf SystemStatus = 4 Then
    hs.GetURLIE ("http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=4:/300\",False)
    End If
    End Sub

    #2
    you need to use one of the hs.devicevalue() functions to actually get the value of the System Status device

    see the following help page:

    http://help.homeseer.com/help/HS3/st...ch=DeviceValue

    so something like

    if hs.devicevaluebyname("Vista Alarm System Status") then

    where "Vista Alarm" is the location
    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
      Thank you! This really made my day :-)

      Sub Main(SystemStatus)

      if hs.devicevaluebyname("Vista Alarm System Status") =1 then
      hs.GetURLIE "http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=1:/300\",False

      Elseif hs.devicevaluebyname("Vista Alarm System Status") =2 then
      hs.GetURLIE "http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=2:/300\",False

      Elseif hs.devicevaluebyname("Vista Alarm System Status") =3 then
      hs.GetURLIE "http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=3:/300\",False

      Elseif hs.devicevaluebyname("Vista Alarm System Status") =4 then
      hs.GetURLIE "http://root***@192.168.1.71/axis-cgi/io/output.cgi?action=4:/300\",False

      End If
      End Sub

      Comment


        #4
        you're welcome

        how about something simple like this




        Sub Main(SystemStatus)

        status = hs.devicevaluebyname("Vista Alarm System Status")

        if status >=1 or status <=4 then

        hs.GetURLIE "http://root***@192.168.1.71/axis-cgi/io/output.cgi?action="+Status.tostring+":/300\",False

        end if

        end Sub
        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