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 3.0.0.534
    Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway
    Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | Ultra1Wire3 | RFXCOM | NetCAM | MyQ | BLRadar | BLDenon | Jon00 Charting
    Platform: HP h8-1360t, Windows Server 2012 R2, i7-3.4GHz, 16GB memory

    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 3.0.0.534
        Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway
        Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | Ultra1Wire3 | RFXCOM | NetCAM | MyQ | BLRadar | BLDenon | Jon00 Charting
        Platform: HP h8-1360t, Windows Server 2012 R2, i7-3.4GHz, 16GB memory

        Comment

        Working...
        X