Announcement

Collapse
No announcement yet.

Best way to find out which zone triggered an alarm?

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

    Best way to find out which zone triggered an alarm?

    Need some advice.
    I'm using the DSC plugin 3.0.0.34 on HS3
    It works fine with the Maxys system installed.

    I had written a script for an earlier version of the plugin to do the following:
    when an alarm is triggered, I want to send an email showing:

    which zone triggered the alarm
    current status of all zones.

    Checking the current status of all zones is usually not enough to determine what triggered the alarm because by the time the script runs, the door/window/motion has usually been restored. So my script was parsing the log for that info.

    However, with 3.0.0.34 the log format changed quite a bit and doesn't display the zone number in clear as it used to. I see this
    Processing response: Zone Alarm-{0x3E}6010042B

    What is the best method to do what I need? Is there a way to do this without parsing the log?
    Is there a DSC plug-in documentation that would be helpful for scripting?
    Thanks.

    #2
    I am sure there is an easier way than what I am about to tell you, but this is the way I do it.
    I have created devices that I call Ghost Followers that match up with all of my alarm zones. I then have events that use the logic... if the alarm is armed for at least a couple minutes and zone 1 is on then turn on zone 1 ghost follower. Create an event for each zone. When the alarm is disarmed I reset the Ghost Followers. Works for me, but it requires at least one extra device per zone, one event per zone, and one event to reset the Ghost Followers. I am sure there is a better way.

    Comment


      #3
      Same thing for me, probably not the most elegant way, but i only have 8 zones.

      so i have an event to trigger per zone:
      "If the response code received is Zone Alarm(601) for Zone: 8, then...

      I realize this is not ideal for a large number of zones.

      I'd be interested in any solution you find.

      Comment


        #4
        Thanks for the replies.
        I have 16 zones but I ended up doing what you did : creating one event per zone. I had not realized you could create an event on a zone alarm, I thought it was just for the whole partition. A bit tedious but it works. I just call the same script with the zone number as the parameter.
        I'm sure there is another way to find out which zone was in alarm.
        I'm wondering if this is what a 'restoral' code is for?

        Comment


          #5
          Did anyone find out how to do this in a single event?

          Comment


            #6
            When I was using a DSC panel I used a script to iterate through the zones to see which was in alarm last and then you can set a global variable to the value of that zone.

            Then use an event to send a notification that uses the replacement string for that global variable $GLOBALvar:var:


            Sent from my iPad using Tapatalk HD
            Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

            Comment


              #7
              When I was using a DSC panel I used a script to iterate through the zones to see which was in alarm last and then you can set a global variable to the value of that zone.
              You wouldn't happen to have a copy of that script would you? The problem is I can't find the available DSC scripting methods anywhere.

              Comment


                #8
                Solved! ...somewhat.

                I got it to email using the Global Variables (Thanks beerygaz!). Only issue now is that when a zone is opened, the event runs continuously. What's causing that?

                Code:
                Sub Main(parms As Object)
                	Dim zone1, zone2, zone3, zone4, zone5 as Integer
                		
                	zone1 = hs.DeviceValueByName("Front Door")
                	zone2 = hs.DeviceValueByName("Back Slide Door")
                	zone3 = hs.DeviceValueByName("Master Slide Door")
                	zone4 = hs.DeviceValueByName("Kids Window")
                	zone5 = hs.DeviceValueByName("Guest Window")
                	
                	If zone1 = 609 then
                		hs.SaveVar("zoneopened","Front Door")
                	End If
                	
                	If zone2 = 609 then
                		hs.SaveVar("zoneopened","Back Slide Door")
                	End If
                	
                	If zone3 = 609 then
                		hs.SaveVar("zoneopened","Master Slide Door")
                	End If
                	
                	If zone4 = 609 then
                		hs.SaveVar("zoneopened","Kids Window")
                	End If
                	
                	' Guest Window
                	'If zone5 = 609 then
                	'	hs.SaveVar("zoneopened","Guest Window")
                	'End If
                		
                	hs.SendEmail("user@domain.com","hs@domain.com","","","Zone Opened!", "The $$GLOBALVAR:zoneopened: was just opened!","")
                
                End Sub
                Attached Files

                Comment


                  #9
                  I don't I'm afraid, I trashed my Hs2 setup a while back. However it was pretty straightforward. You don't need the DSC calls either.

                  Set up an event to run the script when a partition is in alarm. Put the following in the script (pseudo code):

                  Create a global variable called ZONE
                  Zonerefs() = list of device references for all zone devices
                  For each zoneref in Zonerefs
                  If HS.devicestatus(zoneref) = "in alarm" then
                  Set global variable ZONE to HS.devicename(zoneref)
                  End if
                  Next

                  Then make the next action in the event send a notification (email or SMS) with the replacement value of the global variable.

                  I'm traveling right now, but if you want me to write the VB to do this, I can knock it up for you later in the week.

                  Sent from my iPad using Tapatalk HD
                  Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

                  Comment


                    #10
                    Aha, didn't see your second post. You came to a similar solution.

                    Check what've fictions you use for your event. You want to trigger when a partition or the panel changes and becomes "in alarm". That way it should only trigger once.


                    Sent from my iPad using Tapatalk HD
                    Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

                    Comment


                      #11
                      Got it. I was just testing with a zone opened instead of alarm. I'll try your version of the script as it seems much shorter, albeit may have the same result. Thanks again.

                      Comment


                        #12
                        Got it working with your version! Is there any way to prevent the event from repeating without require the partition to armed?

                        Code:
                        Sub Main(parms As Object)
                        	
                        	Dim zonerefs() As Integer = {13,14,15,16,17}
                        	
                        	For each zoneref As Integer in zonerefs
                        	If hs.devicevalue(zoneref) = "609" then
                        		hs.SaveVar("zoneopened",hs.devicename(zoneref))
                        		hs.SendEmail("user@domain.com","hs@domain.com","","","Zone Opened!", "The $$GLOBALVAR:zoneopened: was just opened!","")
                        	End if
                        	Next
                        	 
                        End Sub

                        Comment


                          #13
                          So it seems that the reason the event it kept triggering, is that I have a motion sensor in the middle of the house that also throws '609' when there's motion. So I guess what I have to do is to get it to see the device value by name (e.g 'Zone Opened'. Beerygaz, how would I accomplish this? If I change it to the name, the script errors out stating 'Conversion from string "Zone Opened" to type 'Double' is not valid.'

                          Comment


                            #14
                            Can you post the code you're using thus far so I can have a look, it would help troubleshoot.
                            Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

                            Comment


                              #15
                              The same as above...

                              Code:
                              Sub Main(parms As Object)
                              	
                              	Dim zonerefs() As Integer = {13,14,15,16,17}
                              	
                              	For each zoneref As Integer in zonerefs
                              	If hs.devicevalue(zoneref) = "609" then
                              		hs.SaveVar("zoneopened",hs.devicename(zoneref))
                              		hs.SendEmail("user@domain.com","hs@domain.com","","","Zone Opened!", "The $$GLOBALVAR:zoneopened: was just opened!","")
                              	End if
                              	Next
                              	 
                              End Sub

                              Comment

                              Working...
                              X