Index: /trunk/D_VistaAlarmPanel1.json
===================================================================
--- /trunk/D_VistaAlarmPanel1.json	(revision 1)
+++ /trunk/D_VistaAlarmPanel1.json	(revision 3)
@@ -1,18 +1,28 @@
 {
-    "flashicon": "icons\/generic_sensor.swf",
+    "flashicon": "icons\/Door_Lock.swf",
     "imgIconBody": "",
     "imgIconDimmable": "",
     "imgIconTurnable": "",
-    "imgIconMin": "",
-    "imgIconMax": "",
+    "imgIconMin": "pics\/devices\/Door_UNLOCKED.png",
+    "imgIconMax": "pics\/devices\/Door_LOCKED.pn",
     "halloIconsDir": "pics\/hallo",
     "DisplayStatus": {
-        
+        "Style": "label",
+        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
+        "Variable": "ArmMode",
+        "MinValue": "Disarmed",
+        "MaxValue": "Armed"    
     },
     "doc_url":{
+	    "doc_language": 1,
+        "doc_manual": 1,
+        "doc_version": 1,
+        "doc_platform": 0,
+        "doc_page": "devices",
         "doc_forced_url":{
             "text":"http://code.mios.com/trac/mios_ademco-panels-plugin"
         }
     },
+	"ToggleButton": 1,
     "Tabs": [
         {
@@ -24,4 +34,56 @@
             "TabType": "flash",
             "Control": [
+			    {
+                    "ControlGroup": "1",
+                    "ControlHeader": "1",
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "device_settings_page",
+                        "text": "Partitions:"
+                    },
+                    "Display": {
+                        "Top": 0,
+                        "Left": 50,
+                        "Width": 50,
+                        "Height": 20
+                    }
+                },
+				{
+                    "ControlType": "variable",
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:VistaAlarmPanel1",
+                        "Variable": "ActivePartitions",
+                        "Top": 0,
+                        "Left": 100,
+                        "Width": 50,
+                        "Height": 20
+                    }
+                },
+				{
+                    "ControlGroup": "1",
+                    "ControlHeader": "1",
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "device_settings_page",
+                        "text": "Zones:"
+                    },
+                    "Display": {
+                        "Top": 20,
+                        "Left": 50,
+                        "Width": 50,
+                        "Height": 20
+                    }
+                },
+				{
+                    "ControlType": "variable",
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:VistaAlarmPanel1",
+                        "Variable": "ActiveZones",
+                        "Top": 20,
+                        "Left": 100,
+                        "Width": 50,
+                        "Height": 20
+                    }
+                },
 
             ]
Index: /trunk/D_VistaAlarmPartition2.json
===================================================================
--- /trunk/D_VistaAlarmPartition2.json	(revision 1)
+++ /trunk/D_VistaAlarmPartition2.json	(revision 3)
@@ -45,10 +45,10 @@
                     "Label": {
                         "lang_tag": "device_settings_page",
-                        "text": "Status"
+                        "text": "Status:"
                     },
                     "Display": {
                         "Top": 0,
                         "Left": 50,
-                        "Width": 200,
+                        "Width": 50,
                         "Height": 20
                     }
@@ -60,186 +60,12 @@
                     "Display": {
                         "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Variable": "DetailedArmMode",
-                        "Top": 20,
-                        "Left": 50,
-                        "Width": 200,
-                        "Height": 20
-                    }
-                },
-                {
-                    "ControlType": "label",
-                    "Label": {
-                        "lang_tag": "device_settings_page",
-                        "text": "One Touch Options"
-                    },
-                    "Display": {
-                        "Top": 60,
-                        "Left": 50,
-                        "Width": 200,
-                        "Height": 20
-                    }
-                },
-                {
-                    "ControlGroup": "1",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "Arm"
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
                         "Variable": "ArmMode",
-                        "Value": "Armed",
-                        "Top": 80,
-                        "Left": 50,
-                        "Width": 75,
-                        "Height": 20
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Action": "RequestQuickArmMode",
-                        "Parameters": [
-                            {
-                                "Name": "State",
-                                "Value": "Armed"
-                            }
-                        ]
-                    }
-                },
-                {
-                    "ControlGroup": "1",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "Force"
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Variable": "DetailedArmMode",
-                        "Value": "Force",
-                        "Top": 100,
-                        "Left": 50,
-                        "Width": 75,
-                        "Height": 20
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Action": "RequestQuickArmMode",
-                        "Parameters": [
-                            {
-                                "Name": "State",
-                                "Value": "ArmedInstant"
-                            }
-                        ]
-                    }
-                },
-                {
-                    "ControlGroup": "1",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "Stay"
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Variable": "DetailedArmMode",
-                        "Value": "Stay",
-                        "Top": 80,
-                        "Left": 135,
-                        "Width": 75,
-                        "Height": 20
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Action": "RequestQuickArmMode",
-                        "Parameters": [
-                            {
-                                "Name": "State",
-                                "Value": "Stay"
-                            }
-                        ]
-                    }
-                },
-                {
-                    "ControlGroup": "1",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "iStay"
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Variable": "DetailedArmMode",
-                        "Value": "StayInstant",
-                        "Top": 100,
-                        "Left": 135,
-                        "Width": 75,
-                        "Height": 20
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Action": "RequestQuickArmMode",
-                        "Parameters": [
-                            {
-                                "Name": "State",
-                                "Value": "StayInstant"
-                            }
-                        ]
-                    }
-                },
-                {
-                    "ControlGroup": "1",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "Night"
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Variable": "DetailedArmMode",
-                        "Value": "Night",
-                        "Top": 80,
-                        "Left": 220,
-                        "Width": 75,
-                        "Height": 20
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Action": "RequestQuickArmMode",
-                        "Parameters": [
-                            {
-                                "Name": "State",
-                                "Value": "Night"
-                            }
-                        ]
-                    }
-                },
-                {
-                    "ControlGroup": "1",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "iNight"
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Variable": "DetailedArmMode",
-                        "Value": "NightInstant",
-                        "Top": 100,
-                        "Left": 220,
-                        "Width": 75,
-                        "Height": 20
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
-                        "Action": "RequestQuickArmMode",
-                        "Parameters": [
-                            {
-                                "Name": "State",
-                                "Value": "NightInstant"
-                            }
-                        ]
-                    }
-                },
+                        "Top": 0,
+                        "Left": 100,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                },
+
                 {
                     "ControlGroup": "2",
@@ -251,5 +77,5 @@
                     },
                     "Display": {
-                        "Top": 140,
+                        "Top": 40,
                         "Left": 50,
                         "Width": 200,
@@ -263,5 +89,5 @@
                     "ID": "PINCode",
                     "Display": {
-                        "Top": 160,
+                        "Top": 60,
                         "Left": 50,
                         "Width": 100,
@@ -281,5 +107,5 @@
                         "Variable": "ArmMode",
                         "Value": "Armed",
-                        "Top": 160,
+                        "Top": 60,
                         "Left": 160,
                         "Width": 50,
@@ -313,5 +139,5 @@
                         "Variable": "DetailedArmMode",
                         "Value": "Stay",
-                        "Top": 180,
+                        "Top": 80,
                         "Left": 160,
                         "Width": 50,
@@ -345,5 +171,5 @@
                         "Variable": "ArmMode",
                         "Value": "Disarmed",
-                        "Top": 200,
+                        "Top": 100,
                         "Left": 160,
                         "Width": 50,
@@ -372,5 +198,5 @@
                     },
                     "Display": {
-                        "Top": 240,
+                        "Top": 140,
                         "Left": 50,
                         "Width": 200,
@@ -385,5 +211,5 @@
                     },
                     "Display": {
-                        "Top": 260,
+                        "Top": 160,
                         "Left": 50,
                         "Width": 75,
@@ -408,5 +234,5 @@
                     },
                     "Display": {
-                        "Top": 260,
+                        "Top": 160,
                         "Left": 135,
                         "Width": 75,
@@ -431,5 +257,5 @@
                     },
                     "Display": {
-                        "Top": 260,
+                        "Top": 160,
                         "Left": 220,
                         "Width": 75,
@@ -454,5 +280,5 @@
                     },
                     "Display": {
-                        "Top": 300,
+                        "Top": 200,
                         "Left": 50,
                         "Width": 200,
@@ -465,5 +291,5 @@
                         "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
                         "Variable": "VendorStatus",
-                        "Top": 320,
+                        "Top": 220,
                         "Left": 50,
                         "Width": 200,
@@ -476,5 +302,5 @@
                         "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
                         "Variable": "VendorStatusCode",
-                        "Top": 340,
+                        "Top": 240,
                         "Left": 50,
                         "Width": 200,
@@ -487,5 +313,5 @@
                         "Service": "urn:micasaverde-com:serviceId:AlarmPartition2",
                         "Variable": "VendorStatusData",
-                        "Top": 360,
+                        "Top": 260,
                         "Left": 50,
                         "Width": 200,
Index: /trunk/I_VistaAlarmPanel1.xml
===================================================================
--- /trunk/I_VistaAlarmPanel1.xml	(revision 1)
+++ /trunk/I_VistaAlarmPanel1.xml	(revision 3)
@@ -236,7 +236,7 @@
         for partStatus in string.gmatch(fields, "%d") do
           partStatus = tonumber(partStatus)
-          --if(partStatus ~= 0) then numZones = numZones + 1 end 
           if(partStatus ~= 0 and foundParts[partStatus] == nil) then
             numPartitions = numPartitions + 1
+			foundParts[partStatus] = 1
             Partitions[numPartitions] = partStatus
           end
@@ -246,5 +246,4 @@
        
     setVistaPanelState("ActivePartitions", numPartitions)
-    setVistaPanelState("ActiveZones", numZones)
 
   end
@@ -268,4 +267,6 @@
     end
 
+	setVistaPanelState("ActiveZones", j)
+	
     for i,z in ipairs(Zones) do
       log(string.format("%d - %d - %s", i, z, ZoneDescriptions[z]))
