Announcement

Collapse
No announcement yet.

List of all Zone Faults

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

    #31
    I have been playing with this.

    Looks like an upgrade fixed my line spacing problem

    I have everything working so far except the button hiding.

    Can you explain in a little bit more detail how this works. I understand the concept of the hidden show and hide buttons, but how are these buttons triggered etc.

    Comment


      #32
      To add some more information even your alarmscreen.xml doesn't hide and show the buttons properly without anything renamed even in the windows client.

      I am wondering if I am missing something.

      Do I have to call the script (alarmfaultcontrol) from the button that i use when I launch the screen?

      Edit:
      I should mention that I commented out the additional <br> that you added which may have hosed things.
      Code:
      Status = Status & ZoneName & " " & ZoneDescription & "<br>"' & " " & "<br>"
      Last edited by skarragallagher; June 2, 2013, 01:03 AM. Reason: additional information

      Comment


        #33
        So here is some feedback.

        I have been using this script and it seems to for the most part function with the exception of the following.

        The button hiding is still somewhat of a problem. If the script is detecting how many lines are being used then I can see that being an issue since I commented out the extra <br>. However I have to do this since I am using a horizontally oriented setup and I need that vertical space.

        Also I have several IR devices in the house that constantly are triggering the script which is causing a noticeable lag with other functions. I am wondering if there is a way (within the 3 events) to exclude certain zones without having to create 3 events for each zone (I have 24 zones).

        That's all I got for now.

        Again, thanks for the great script.

        Comment


          #34
          The button hiding is still somewhat of a problem. If the script is detecting how many lines are being used then I can see that being an issue since I commented out the extra <br>. However I have to do this since I am using a horizontally oriented setup and I need that vertical space.
          The secret here is that it counts the number of zones and hides or un-hides (as well as enables) the number of buttons that are in the array. It looks at the number of text lines not including the line feeds. You will need to size them accordingly. Also the script needs run when the screen is first opened to align it. I took out the extra <br> and halved the button height and it look ok (crowded but ok).

          Also I have several IR devices in the house that constantly are triggering the script which is causing a noticeable lag with other functions. I am wondering if there is a way (within the 3 events) to exclude certain zones without having to create 3 events for each zone (I have 24 zones).
          Yep I see that could be an issue for sure, instead of using the anytime a zone is faulted/bypassed/normal you could set up an event that only reacted to the zones you care about. I'll look at the trigger scrip to see if I can bail it out earlier, but I not sure it would help ..... stand by.

          Chris

          Comment


            #35
            Thanks for the reply.

            So then the extra line space is not the issue. It seems that I can never get the correct amount of buttons to show or be hidden. Not sure what the issue is.

            I am using the android client so there may be an issue the button press not release as I have had issues in the past.

            I am wondering if I could use the action on button release for both the show and the hide... that may be the issue there

            Comment


              #36
              Hi,

              I have been racking my brain trying to get these buttons to work.

              Essentially I can't even get the examples you posted in the zip to show and hide the buttons properly. Perhaps they aren't the latest versions

              Aside from the two following changes:
              PHP Code:
                      Dim DeviceNumber As Integer 15
                      Dim DeviceNumber1 
              As Integer 15 
              Which I changed DeviceNumber1 to 16. But I don't think that is the problem.

              and comenting out the client action 35

              PHP Code:
              'HstPlugin.ClientAction(35, "", Button, "") 
              My android client doesn't work well with actions on releases, only presses. Please note that I do have the actions set on the buttons properly (all of them on button press)

              Even though I have recreated these screens entirely even the xml file doesn't work properly. most of the time it just hides everything except the first button no matter how many zones are presently faulted (this happens in the window client and the android client with both my recreated screens and your screen). Note: I do run the script once from the button I use to call on the screen.

              Maybe you could review the script I am working with. perhaps there something obviously wrong

              PHP Code:
                   Enum AlarmZoneCode As Short
                      Undefined 
              0
                      Normal 
              1
                      BatteryLow 
              2
                      Bypassed 
              3
                      Fault 
              4
                      InCheck 
              5
                  End Enum
                  
              Public Sub Main(ByVal parms As Object)
                      
              Dim HstPlugin As Object
                      HstPlugin 
              hs.Plugin("HSTouch Server")
                      If 
              HstPlugin Is Nothing Then
                          hs
              .WriteLog("Error""No HSTouch Plugin Detected")
                          Exit 
              Sub
                      End 
              If
                      
              'Try
                      Dim Status As String = ""
                      Dim Screen As String = "ZoneFaultList"
                '
              Dim Screen As String "AlarmScreen"
                      
              Dim Hide As String "HideButton"
                      
              Dim Show As String "ShowButton"
                      
              Dim Lines As Integer 0
                      Dim Button 
              As String ""
                      
              Dim HouseCode "V"
                      
              Dim DeviceNumber As Integer 15
                      Dim DeviceNumber1 
              As Integer 16
                      Dim DeviceName 
              As String "Alarm Status"
                      
              Dim HSType As String "Alarm"
                      
              Dim Room As String "Virtual"
                      
              Dim ZoneList As String "]2,]3,]4,]5,]6,]7,]8,]9,]10,]11,]14,]16,]19,]20,]21,]22,]24,]26,]27,]28,]29,]30"
                      
              Dim ZoneNameList As String "Living Room Window (L),Living Room Window (R),Play Room Window,Anayas Room Window,Kitchen Window,Office Window (R),Office Window (L),Master Bathroom Shower Window,Dining Room Window,Front Door,Back Door,Office Bathroom Window,Stairway Window,Master Bedroom Right Window,Master Bedroom Left Window,Master Bedroom Center Window,Kid's Wing Door,Workout Room Left Window,Workout Room Right Window,Driveway Gate,Garage Door,Stairway IR"
                      
              Dim DeviceNum As String ""
                      
              Dim ZoneStatus As Integer 0
                      Dim ZoneDescription 
              As String ""
                      
              Dim ZoneName As String ""
                      
              Dim strDeviceList() As String Split(ZoneList",")
                      
              Dim strZomeNameList() As String Split(ZoneNameList",")
                      
              Dim LoopCounter As Integer
                      Dim FaultedList 
              As String ""
                      
              If hs.DeviceExistsRef(HouseCode DeviceNumber) = -1 Then
                          Dim dv 
              hs.NewDeviceEx(DeviceName)
                          
              dv.dc DeviceNumber
                          dv
              .hc HouseCode
                          dv
              .misc "&h10"
                          
              dv.location Room
                          dv
              .location2 HSType
                          hs
              .SetDeviceStatus(HouseCode DeviceNumber0)
                          
              hs.SetDeviceString(HouseCode DeviceNumber"")
                          
              hs.WriteLog("Info " DeviceName"Created Device " HouseCode DeviceNumber)
                      
              End If
                      
              DeviceName "Faulted Zones"
                      
              If hs.DeviceExistsRef(HouseCode DeviceNumber1) = -1 Then
                          Dim dv 
              hs.NewDeviceEx(DeviceName)
                          
              dv.dc DeviceNumber1
                          dv
              .hc HouseCode
                          dv
              .misc "&h10"
                          
              dv.location Room
                          dv
              .location2 HSType
                          hs
              .SetDeviceStatus(HouseCode DeviceNumber10)
                          
              hs.SetDeviceString(HouseCode DeviceNumber1"")
                          
              hs.WriteLog("Info " DeviceName"Created Device " HouseCode DeviceNumber1)
                      
              End If
                      For 
              LoopCounter LBound(strDeviceListTo UBound(strDeviceList)
                          
              DeviceNum strDeviceList(LoopCounter)
                          
              ZoneName strZomeNameList(LoopCounter)
                          
              ZoneStatus hs.DeviceValue(DeviceNum)
                          
              Select Case ZoneStatus
                              
              Case AlarmZoneCode.Undefined
                                  ZoneDescription 
              "is Undefined"
                              
              Case AlarmZoneCode.Bypassed
                                  ZoneDescription 
              "is Bypassed"
                                  
              Status Status ZoneName " " ZoneDescription "<br>" " " "<br>"
                                  
              If Len(FaultedList) > 0 Then
                                      FaultedList 
              FaultedList "," strDeviceList(LoopCounter)
                                  Else
                                      
              FaultedList strDeviceList(LoopCounter)
                                  
              End If
                                  
              Lines Lines 1
                              
              Case AlarmZoneCode.Fault
                                  ZoneDescription 
              "is Open"
                                  
              Status Status ZoneName " " ZoneDescription "<br>" " " "<br>"
                                  
              If Len(FaultedList) > 0 Then
                                      FaultedList 
              FaultedList "," strDeviceList(LoopCounter)
                                  Else
                                      
              FaultedList strDeviceList(LoopCounter)
                                      
              Lines Lines 1
                                  End 
              If
                              Case Else
                                  
              ZoneDescription "Zone Error"
                          
              End Select
                      Next
                      
              If Status "" Then
                          Status 
              "Systen Ready to Arm"
                      
              End If
                      
              hs.SetDeviceString(HouseCode DeviceNumberStatusTrue)
                      
              hs.SetDeviceString(HouseCode DeviceNumber1FaultedListTrue)
                      For 
              LoopCounter 1 To UBound(strDeviceList) + 1
                          
              If LoopCounter Lines 1 Then
                              Button 
              Screen ":" Show LoopCounter
                          
              Else
                              
              Button Screen ":" Hide LoopCounter
                          End 
              If
                          
              HstPlugin.ClientAction(30""Button"")
                          
              'HstPlugin.ClientAction(35, "", Button, "")
                      Next
                      '
              Catch ex As Exception
                      
              '    hs.WriteLog("Error", "Error encountered on line " & Erl.ToString() & " of AlarmStatus.vb (" & ex.Message & ")")
                      '
              End Try
                  
              End Sub 

              Comment


                #37
                Sure will. Will be this week-end as I am covered up tonight and tomorrow.

                Check in Sunday.

                Chris

                Comment


                  #38
                  Originally posted by dcdelong View Post
                  Sure will. Will be this week-end as I am covered up tonight and tomorrow.

                  Check in Sunday.

                  Chris
                  Much appreciated!

                  Comment

                  Working...
                  X