Index: /trunk/I_CaddxNX584Security.xml
===================================================================
--- /trunk/I_CaddxNX584Security.xml	(revision 20)
+++ /trunk/I_CaddxNX584Security.xml	(revision 30)
@@ -7,4 +7,8 @@
 --
 -- Luup plugin for GE/Networx/Caddx NX-584/NX-8E security system interface.
+--
+-- Version 0.2 2011-04-27 by Deborah Pickett
+-- * Panic modes (medical, fire, police)
+-- * Uses Partition API 2
 --
 -- Version 0.1 2010-08-07 by Deborah Pickett
@@ -155,5 +159,5 @@
 	end
 
-	-- To do: Start enumerating child devices.
+	-- Start enumerating child devices.
 	local childDevices = luup.chdev.start(deviceId)
 
@@ -429,5 +433,4 @@
 -- The plugin would like to know the name of a given zone
 -- (z, integer) in a Zone Name message (0x03).
--- This isn't implemented on the NX-4 so I haven't been able to test it.
 function getZoneName(deviceId, z)
 	if (LOG_DEBUG) then luup.log("Sending message and waiting for response: 0x23 Zone Name Request") end
@@ -492,5 +495,5 @@
 						deviceId, childDevices,
 						"Partition-" .. p, PARTITION_STATUS[p]["name"],
-						"urn:schemas-micasaverde-com:device:AlarmPartition:1", "D_AlarmPartition1.xml",
+						"urn:schemas-futzle-com:device:CaddxNX584Partition:2", "D_CaddxNX584Partition2.xml",
 						"", "", true
 					)
@@ -588,6 +591,11 @@
 	PARTITION_STATUS[partition]["isArmed"] = bitMask(string.byte(string.sub(message,2)), 64)
 	PARTITION_STATUS[partition]["isPartial"] = bitMask(string.byte(string.sub(message,4)), 4)
-	PARTITION_STATUS[partition]["isSiren"] = bitMask(string.byte(string.sub(message,3)), 4)
+	PARTITION_STATUS[partition]["isSiren"] = bitMask(string.byte(string.sub(message,3)), 2)
+	PARTITION_STATUS[partition]["wasSiren"] = bitMask(string.byte(string.sub(message,3)), 1)
 	PARTITION_STATUS[partition]["isReady"] = bitMask(string.byte(string.sub(message,7)), 4)
+	PARTITION_STATUS[partition]["isChime"] = bitMask(string.byte(string.sub(message,4)), 8)
+	PARTITION_STATUS[partition]["isExitDelay"] = bitMask(string.byte(string.sub(message,4)), 192)
+	PARTITION_STATUS[partition]["isEntryDelay"] = bitMask(string.byte(string.sub(message,4)), 16) or
+		bitMask(string.byte(string.sub(message,8)), 1)
 	PARTITION_STATUS[partition]["lastUser"] = string.byte(string.sub(message,6))
 	return partition
@@ -602,4 +610,8 @@
 			PARTITION_STATUS[partition]["isPartial"] = bitMask(string.byte(string.sub(message,partition+1)), 8)
 			PARTITION_STATUS[partition]["isReady"] = bitMask(string.byte(string.sub(message,partition+1)), 2)
+			PARTITION_STATUS[partition]["isChime"] = bitMask(string.byte(string.sub(message,partition+1)), 16)
+			PARTITION_STATUS[partition]["isExitDelay"] = bitMask(string.byte(string.sub(message,partition+1)), 64)
+			PARTITION_STATUS[partition]["isEntryDelay"] = bitMask(string.byte(string.sub(message,partition+1)), 32)
+			PARTITION_STATUS[partition]["wasSiren"] = bitMask(string.byte(string.sub(message,partition+1)), 128)
 		end
 	end
@@ -649,35 +661,44 @@
 		if (partitionDevice == nil) then return end
 
-		local armed = PARTITION_STATUS[partition]["isArmed"] and not PARTITION_STATUS[partition]["isPartial"] and "1" or "0"
-		if (LOG_DEBUG) then luup.log("Armed: " .. armed) end
-		if (luup.variable_get(ALARM_PARTITION_SERVICEID, "Armed", partitionDevice) ~= armed) then
-			luup.variable_set(ALARM_PARTITION_SERVICEID, "Armed", armed, partitionDevice)
-		end
-
-		local stay = PARTITION_STATUS[partition]["isPartial"] and PARTITION_STATUS[partition]["isArmed"] and "1" or "0"
-		if (LOG_DEBUG) then luup.log("StayArmed: " .. stay) end
-		if (luup.variable_get(ALARM_PARTITION_SERVICEID, "StayArmed", partitionDevice) ~= stay) then
-			luup.variable_set(ALARM_PARTITION_SERVICEID, "StayArmed", stay, partitionDevice)
-		end
-
-		local disarmed = not PARTITION_STATUS[partition]["isArmed"] and not PARTITION_STATUS[partition]["isPartial"] and "1" or "0"
-		if (LOG_DEBUG) then luup.log("Disarmed: " .. disarmed) end
-		if (luup.variable_get(ALARM_PARTITION_SERVICEID, "Disarmed", partitionDevice) ~= disarmed) then
-			luup.variable_set(ALARM_PARTITION_SERVICEID, "Disarmed", disarmed, partitionDevice)
-		end
-
-		local breached = PARTITION_STATUS[partition]["isSiren"] and "1" or "0"
-		if (LOG_DEBUG) then luup.log("Breached: " .. breached) end
-		if (luup.variable_get(ALARM_PARTITION_SERVICEID, "Breached", partitionDevice) ~= breached) then
-			luup.variable_set(ALARM_PARTITION_SERVICEID, "Breached", breached, partitionDevice)
-		end
+		-- Simple armed state (armed or not).
+		local armed = PARTITION_STATUS[partition]["isArmed"] and "Armed" or "Disarmed"
+		if (LOG_DEBUG) then luup.log("ArMode: " .. armed) end
+		luup.variable_set(ALARM_PARTITION_SERVICEID, "ArmMode", armed, partitionDevice)
+
+		-- Detailed armed state.
+		-- Listed in increasing order of importance.
+		local detailArmed = "Disarmed"
+		detailArmed = PARTITION_STATUS[partition]["isReady"] and "Ready" or detailArmed
+		detailArmed = PARTITION_STATUS[partition]["isArmed"] and "Armed" or detailArmed
+		detailArmed = PARTITION_STATUS[partition]["isPartial"] and "Stay" or detailArmed
+		detailArmed = PARTITION_STATUS[partition]["isExitDelay"] and "ExitDelay" or detailArmed
+		detailArmed = PARTITION_STATUS[partition]["isEntryDelay"] and "EntryDelay" or detailArmed
+		if (LOG_DEBUG) then luup.log("DetailedArmMode: " .. detailArmed) end
+		luup.variable_set(ALARM_PARTITION_SERVICEID, "DetailedArmMode", detailArmed, partitionDevice)
+
+		-- Current alarm.
+		local breached = PARTITION_STATUS[partition]["isSiren"] and "Active" or "None"
+		if (LOG_DEBUG) then luup.log("Alarm: " .. breached) end
+		luup.variable_set(ALARM_PARTITION_SERVICEID, "Alarm", breached, partitionDevice)
+
+		-- Past alarm (which has since cleared).
+		local pastAlarm = PARTITION_STATUS[partition]["wasSiren"] and "1" or "0"
+		if (LOG_DEBUG) then luup.log("AlarmMemory: " .. pastAlarm) end
+		luup.variable_set(ALARM_PARTITION_SERVICEID, "AlarmMemory", pastAlarm, partitionDevice)
+
+		-- Chime mode.
+		local chime = PARTITION_STATUS[partition]["isChime"] and "1" or "0"
+		if (LOG_DEBUG) then luup.log("ChimeEnabled: " .. chime) end
+		luup.variable_set(ALARM_PARTITION_SERVICEID, "ChimeEnabled", chime, partitionDevice)
 
 		-- Create a variable on the alarm interface matching the user who
 		-- last changed the partition, if there isn't already.
-		if (luup.variable_get(ALARM_SERVICEID, "User" .. PARTITION_STATUS[partition]["lastUser"], deviceId) == nil) then
-			luup.variable_set(ALARM_SERVICEID, "User" .. PARTITION_STATUS[partition]["lastUser"], "User " .. PARTITION_STATUS[partition]["lastUser"], deviceId)
+		local lastUser = luup.variable_get(ALARM_SERVICEID, "User" .. PARTITION_STATUS[partition]["lastUser"], deviceId)
+		if (lastUser == nil) then
+			lastUser = "User " .. PARTITION_STATUS[partition]["lastUser"];
+			luup.variable_set(ALARM_SERVICEID, "User" .. PARTITION_STATUS[partition]["lastUser"], lastUser, deviceId)
 		end
 		-- This is the user who last modified the partition.
-		luup.variable_set(ALARM_PARTITION_SERVICEID, "LastUser", (PARTITION_STATUS[partition]["lastUser"]), partitionDevice)
+		luup.variable_set(ALARM_PARTITION_SERVICEID, "LastUser", lastUser, partitionDevice)
 	end
 end
@@ -694,14 +715,10 @@
 		local tripped = ZONE_STATUS[zone]["isFaulted"] and "1" or "0"
 		if (LOG_DEBUG) then luup.log("Tripped: " .. tripped) end
-		if (luup.variable_get(ALARM_ZONE_SERVICEID, "Tripped", zoneDevice) ~= tripped) then
-			luup.variable_set(ALARM_ZONE_SERVICEID, "Tripped", tripped, zoneDevice)
-		end
+		luup.variable_set(ALARM_ZONE_SERVICEID, "Tripped", tripped, zoneDevice)
 
 		-- Invert logic because alarm panel speaks of "is bypassed".
 		local armed = ZONE_STATUS[zone]["isBypassed"] and "0" or "1"
 		if (LOG_DEBUG) then luup.log("Armed: " .. armed) end
-		if (luup.variable_get(ALARM_ZONE_SERVICEID, "Armed", zoneDevice) ~= armed) then
-			luup.variable_set(ALARM_ZONE_SERVICEID, "Armed", armed, zoneDevice)
-		end
+		luup.variable_set(ALARM_ZONE_SERVICEID, "Armed", armed, zoneDevice)
 	end
 end
@@ -1198,7 +1215,7 @@
 		<action>
 			<serviceId>urn:micasaverde-com:serviceId:AlarmPartition1</serviceId>
-			<name>RequestQuickArm</name>
+			<name>RequestQuickArmMode</name>
 			<job>
-				if (LOG_DEBUG) then luup.log("Job: Partition: RequestQuickArm " .. lul_device .. " job " .. getJobId(lul_job)) end
+				if (LOG_DEBUG) then luup.log("Job: Partition: RequestQuickArmMode to " .. lul_settings.State .. " " .. lul_device .. " job " .. getJobId(lul_job)) end
 				
 				if (not CAPABILITY_SECONDARY_KEYPAD) then
@@ -1208,10 +1225,19 @@
 				local partition = tonumber(string.match(luup.devices[lul_device].id, "%d+"))
 
-				if (LOG_DEBUG) then luup.log("Job: Adding job") end
 				-- Protocol doc says that command (second byte) for "Exit" mode should be message 2,
 				-- but on my system it seems that message 0 does the job.  Hmm.  Hope it isn't
 				-- different depending on what panel you've got.  That'd be crazy.
+				local command = {
+					Armed = "\002",
+					Stay = "\000"
+				}
+				local commandByte = command[lul_settings.State]
+				if (commandByte == nil) then
+					-- Command not supported.
+					return 2, nil
+				end
+				if (LOG_DEBUG) then luup.log("Job: Adding job") end
 				addPendingJob(getJobId(lul_job),
-					"\062\000" .. string.char(2 ^ (partition-1)),
+					"\062" .. commandByte .. string.char(2 ^ (partition-1)),
 					{
 						[29] = function(deviceId, message)
@@ -1243,7 +1269,7 @@
 		<action>
 			<serviceId>urn:micasaverde-com:serviceId:AlarmPartition1</serviceId>
-			<name>RequestArm</name>
+			<name>RequestArmMode</name>
 			<job>
-				if (LOG_DEBUG) then luup.log("Job: Partition: RequestArm " .. lul_device .. " job " .. getJobId(lul_job)) end
+				if (LOG_DEBUG) then luup.log("Job: Partition: RequestArmMode to " .. lul_settings.State .. " ".. lul_device .. " job " .. getJobId(lul_job)) end
 				
 				if (not CAPABILITY_PRIMARY_KEYPAD_WITH_PIN) then
@@ -1255,7 +1281,17 @@
 				if (pinCode == nil) then return 2, nil end
 
+				local command = {
+					Armed = "\002",
+					Stay = "\003",
+					Disarmed = "\001"
+				}
+				local commandByte = command[lul_settings.State]
+				if (commandByte == nil) then
+					-- Command not supported.
+					return 2, nil
+				end
 				if (LOG_DEBUG) then luup.log("Job: Adding job") end
 				addPendingJob(getJobId(lul_job),
-					"\060" .. pinCode .. "\002" .. string.char(2 ^ (partition-1)),
+					"\060" .. pinCode .. commandByte .. string.char(2 ^ (partition-1)),
 					{
 						[29] = function(deviceId, message)
@@ -1287,109 +1323,31 @@
 		<action>
 			<serviceId>urn:micasaverde-com:serviceId:AlarmPartition1</serviceId>
-			<name>RequestQuickStay</name>
+			<name>RequestPanicMode</name>
 			<job>
-				if (LOG_DEBUG) then luup.log("Job: Partition: RequestQuickStay " .. lul_device .. " job " .. getJobId(lul_job)) end
+				if (LOG_DEBUG) then luup.log("Job: Partition: RequestMedicalPanic to " .. lul_settings.State .. " " .. lul_device .. " job " .. getJobId(lul_job)) end
 				
+				if (luup.variable_get(ALARM_SERVICEID, "EnablePanic", lul_device) ~= "1") then
+					-- Panic disabled; return error.
+					return 2, nil
+				end
 				if (not CAPABILITY_SECONDARY_KEYPAD) then
-					-- Cannot quick stay; return error.
+					-- Cannot send panic; return error.
 					return 2, nil
 				end
 				local partition = tonumber(string.match(luup.devices[lul_device].id, "%d+"))
 
-				if (LOG_DEBUG) then luup.log("Job: Adding job") end
-				-- Help! The communication protocol doesn't seem to match reality on my panel.
-				-- Command (byte 2) of 0 should enter Stay mode, but it enters Armed mode.
-				-- I don't really want to try other values, because some of them are the
-				-- panic button.  Volunteers welcome!
-				addPendingJob(getJobId(lul_job),
-					"\062\000" .. string.char(2 ^ (partition-1)),
-					{
-						[29] = function(deviceId, message)
-							-- Nothing more to do.  The interface will
-							-- send a snapshot with the updated info RSN,
-							-- and we'll update the partition device then.
-							JOBS[getJobId(lul_job)]["complete"] = 4
-							return 0
-						end,
-						[31] = function(deviceId, message)
-							JOBS[getJobId(lul_job)]["complete"] = 2
-							return 0
-						end,
-					}
-				)
-				if (LOG_DEBUG) then luup.log("Job: Processing send queue") end
-				processSendQueue()
-				if (LOG_DEBUG) then luup.log("Job: Done") end
-				-- Either the timeout or incoming task will be called next.
-				return 5, 10
-			</job>
-			<incoming>
-				checkJobComplete(lul_job)
-			</incoming>
-			<timeout>
-				checkJobComplete(lul_job)
-			</timeout>
-		</action>
-		<action>
-			<serviceId>urn:micasaverde-com:serviceId:AlarmPartition1</serviceId>
-			<name>RequestStay</name>
-			<job>
-				if (LOG_DEBUG) then luup.log("Job: Partition: RequestStay " .. lul_device .. " job " .. getJobId(lul_job)) end
-				
-				if (not CAPABILITY_PRIMARY_KEYPAD_WITH_PIN) then
-					-- Cannot stay; return error.
+				local command = {
+					Medical = "\005",
+					Fire = "\004",
+					Police = "\006"
+				}
+				local commandByte = command[lul_settings.State]
+				if (commandByte == nil) then
+					-- Command not supported.
 					return 2, nil
 				end
-				local partition = tonumber(string.match(luup.devices[lul_device].id, "%d+"))
-				local pinCode = validatePin(lul_settings.PINCode)
-				if (pinCode == nil) then return 2, nil end
-
 				if (LOG_DEBUG) then luup.log("Job: Adding job") end
 				addPendingJob(getJobId(lul_job),
-					"\060" .. pinCode .. "\003" .. string.char(2 ^ (partition-1)),
-					{
-						[29] = function(deviceId, message)
-							-- Nothing more to do.  The interface will
-							-- send a snapshot with the updated info RSN,
-							-- and we'll update the partition device then.
-							JOBS[getJobId(lul_job)]["complete"] = 4
-							return 0
-						end,
-						[31] = function(deviceId, message)
-							JOBS[getJobId(lul_job)]["complete"] = 2
-							return 0
-						end,
-					}
-				)
-				if (LOG_DEBUG) then luup.log("Job: Processing send queue") end
-				processSendQueue()
-				if (LOG_DEBUG) then luup.log("Job: Done") end
-				-- Either the timeout or incoming task will be called next.
-				return 5, 10
-			</job>
-			<incoming>
-				checkJobComplete(lul_job)
-			</incoming>
-			<timeout>
-				checkJobComplete(lul_job)
-			</timeout>
-		</action>
-		<action>
-			<serviceId>urn:micasaverde-com:serviceId:AlarmPartition1</serviceId>
-			<name>RequestDisarm</name>
-			<job>
-				if (LOG_DEBUG) then luup.log("Job: Partition: RequestDisarm " .. lul_device .. " job " .. getJobId(lul_job)) end
-				
-				if (not CAPABILITY_PRIMARY_KEYPAD_WITH_PIN) then
-					-- Cannot disarm; return error.
-					return 2, nil
-				end
-				local partition = tonumber(string.match(luup.devices[lul_device].id, "%d+"))
-				local pinCode = validatePin(lul_settings.PINCode)
-				if (pinCode == nil) then return 2, nil end
-
-				if (LOG_DEBUG) then luup.log("Job: Adding job") end
-				addPendingJob(getJobId(lul_job),
-					"\060" .. pinCode .. "\001" .. string.char(2 ^ (partition-1)),
+					"\062" .. commandByte .. string.char(2 ^ (partition-1)),
 					{
 						[29] = function(deviceId, message)
Index: /trunk/D_CaddxNX584Partition2.json
===================================================================
--- /trunk/D_CaddxNX584Partition2.json	(revision 30)
+++ /trunk/D_CaddxNX584Partition2.json	(revision 30)
@@ -0,0 +1,754 @@
+{
+    "flashicon": "icons\/Door_Lock.swf",
+    "imgIconBody": "",
+    "imgIconDimmable": "",
+    "imgIconTurnable": "",
+    "imgIconMin": "pics\/devices\/Door_UNLOCKED.png",
+    "imgIconMax": "pics\/devices\/Door_LOCKED.png",
+    "halloIconsDir": "pics\/hallo",
+    "DisplayStatus": {
+        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+        "Variable": "ArmMode",
+        "MinValue": "Disarmed",
+        "MaxValue": "Armed"
+    },
+    "doc_url": {
+        "doc_language": 1,
+        "doc_manual": 1,
+        "doc_version": 1,
+        "doc_platform": 0,
+        "doc_page": "devices" 
+    },
+    "ToggleButton": 1,
+    "Tabs": [
+        {
+            "Label": {
+                "lang_tag": "tabname_control",
+                "text": "Alarm Partition"
+            },
+            "Position": "0",
+            "TabType": "flash",
+            "ControlGroup": [
+                {
+                    "id": "1"
+                },
+                {
+                    "id": "2"
+                }
+            ],
+            "Control": [
+                {
+                    "ControlGroup": "1",
+                    "ControlHeader": "1",
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "device_settings_page",
+                        "text": "Status"
+                    },
+                    "Display": {
+                        "Top": 0,
+                        "Left": 50,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlHeader": "1",
+                    "ControlType": "variable",
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "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:AlarmPartition1",
+                        "Variable": "ArmMode",
+                        "Value": "Armed",
+                        "Top": 80,
+                        "Left": 50,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestQuickArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Armed"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_lock",
+                        "text": "Force"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "DetailedArmMode",
+                        "Value": "Force",
+                        "Top": 100,
+                        "Left": 50,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestQuickArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "ArmedInstant"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_lock",
+                        "text": "Stay"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "DetailedArmMode",
+                        "Value": "Stay",
+                        "Top": 80,
+                        "Left": 135,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestQuickArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Stay"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_lock",
+                        "text": "iStay"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "DetailedArmMode",
+                        "Value": "StayInstant",
+                        "Top": 100,
+                        "Left": 135,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestQuickArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "StayInstant"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_lock",
+                        "text": "Night"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "DetailedArmMode",
+                        "Value": "Night",
+                        "Top": 80,
+                        "Left": 220,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestQuickArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Night"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_lock",
+                        "text": "iNight"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "DetailedArmMode",
+                        "Value": "NightInstant",
+                        "Top": 100,
+                        "Left": 220,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestQuickArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "NightInstant"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "2",
+                    "ControlHeader": "1",
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "device_settings_page",
+                        "text": "PIN Options"
+                    },
+                    "Display": {
+                        "Top": 140,
+                        "Left": 50,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlGroup": "2",
+                    "ControlPair": "1",
+                    "ControlType": "input",
+                    "ID": "PINCode",
+                    "Display": {
+                        "Top": 160,
+                        "Left": 50,
+                        "Width": 100,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlGroup": "2",
+                    "ControlPair": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_set",
+                        "text": "Arm"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "ArmMode",
+                        "Value": "Armed",
+                        "Top": 160,
+                        "Left": 160,
+                        "Width": 50,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Armed"
+                            },
+                            {
+                                "Name": "PINCode",
+                                "ID": "PINCode"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "2",
+                    "ControlPair": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_set",
+                        "text": "Stay"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "DetailedArmMode",
+                        "Value": "Stay",
+                        "Top": 180,
+                        "Left": 160,
+                        "Width": 50,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Stay"
+                            },
+                            {
+                                "Name": "PINCode",
+                                "ID": "PINCode"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlGroup": "2",
+                    "ControlPair": "1",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_set",
+                        "text": "Disarm"
+                    },
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "ArmMode",
+                        "Value": "Disarmed",
+                        "Top": 200,
+                        "Left": 160,
+                        "Width": 50,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestArmMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Disarmed"
+                            },
+                            {
+                                "Name": "PINCode",
+                                "ID": "PINCode"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "device_settings_page",
+                        "text": "Panic Alarm Options"
+                    },
+                    "Display": {
+                        "Top": 240,
+                        "Left": 50,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_set",
+                        "text": "Police"
+                    },
+                    "Display": {
+                        "Top": 260,
+                        "Left": 50,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestPanicMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Police"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_set",
+                        "text": "Medical"
+                    },
+                    "Display": {
+                        "Top": 260,
+                        "Left": 135,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestPanicMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Medical"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "cmd_set",
+                        "text": "Fire"
+                    },
+                    "Display": {
+                        "Top": 260,
+                        "Left": 220,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Action": "RequestPanicMode",
+                        "Parameters": [
+                            {
+                                "Name": "State",
+                                "Value": "Fire"
+                            }
+                        ]
+                    }
+                },
+                {
+                    "ControlType": "label",
+                    "Label": {
+                        "lang_tag": "device_settings_page",
+                        "text": "Vendor Options"
+                    },
+                    "Display": {
+                        "Top": 300,
+                        "Left": 50,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlType": "variable",
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "VendorStatus",
+                        "Top": 320,
+                        "Left": 50,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlType": "variable",
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "VendorStatusCode",
+                        "Top": 340,
+                        "Left": 50,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                },
+                {
+                    "ControlType": "variable",
+                    "Display": {
+                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                        "Variable": "VendorStatusData",
+                        "Top": 360,
+                        "Left": 50,
+                        "Width": 200,
+                        "Height": 20
+                    }
+                }
+            ]
+        },
+        {
+            "Label": {
+                "lang_tag": "notifications",
+                "text": "Notifications"
+            },
+            "Position": "2",
+            "TabType": "javascript",
+            "ScriptName": "shared.js",
+            "Function": "device_notifications"
+        },
+        {
+            "Label": {
+                "lang_tag": "logs",
+                "text": "Logs"
+            },
+            "Position": "3",
+            "TabType": "javascript",
+            "ScriptName": "shared.js",
+            "Function": "device_logs"
+        },
+        {
+            "Label": {
+                "lang_tag": "advanced",
+                "text": "Advanced"
+            },
+            "Position": "4",
+            "TabType": "javascript",
+            "ScriptName": "shared.js",
+            "Function": "advanced_device"
+        }
+    ],
+    "DeviceType": "urn:schemas-futzle-com:device:CaddxNX584Partition:2",
+    "eventList": {
+        "event_1": {
+            "label": "Armed state",
+            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+            "argumentList" : {
+                "argument_1" : {
+                    "dataType": "string",
+                    "defaultValue": "Armed",
+                    "allowedValueList" : {
+                        "Yes" : "Armed",
+                        "No" : "Disarmed"
+                    },
+                    "name": "ArmMode",
+                    "comparisson": "=",
+                    "prefix": "Is Armed?",
+                    "suffix": ""
+                }
+            }
+        },
+        "event_2": {
+            "label": "Armed detailed state",
+            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+            "argumentList" : {
+                "argument_1" : {
+                    "dataType": "string",
+                    "defaultValue": "Armed",
+                    "allowedValueList" : {
+                        "Disarmed" : "Disarmed",
+                        "Armed" : "Armed",
+                        "Stay" : "Stay",
+                        "StayInstant" : "StayInstant",
+                        "Night" : "Night",
+                        "NightInstant" : "NightInstant",
+                        "Force" : "Force",
+                        "Ready" : "Ready",
+                        "Vacation" : "Vacation",
+                        "NotReady" : "NotReady",
+                        "FailedToArm" : "FailedToArm",
+                        "EntryDelay" : "EntryDelay",
+                        "ExitDelay" : "ExitDelay"
+                    },
+                    "name": "DetailedArmMode",
+                    "comparisson": "=",
+                    "prefix": "Armed state",
+                    "suffix": ""
+                }
+            }
+        },
+        "event_3": {
+            "label": "Alarm Active",
+            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+            "argumentList" : {
+                "argument_1" : {
+                    "dataType": "string",
+                    "defaultValue": "Active",
+                    "allowedValueList" : {
+                        "Active" : "Active",
+                        "NotActive" : "None"
+                    },
+                    "name": "Alarm",
+                    "comparisson": "=",
+                    "prefix": "Is Active?",
+                    "suffix": ""
+                }
+            }
+        },
+        "event_4": {
+            "label": "A PIN Code is entered",
+            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+            "argumentList" : {
+                "argument_1" : {
+                    "dataType": "string",
+                    "defaultValue": "",
+                    "name": "LastUser",
+                    "comparisson": "=",
+                    "prefix": "User",
+                    "suffix": ""
+                }
+            }
+        },
+        "event_5": {
+            "label": "Vendor Status Code",
+            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+            "argumentList" : {
+                "argument_1" : {
+                    "dataType": "string",
+                    "defaultValue": "",
+                    "name": "VendorStatusCode",
+                    "comparisson": "=",
+                    "prefix": "Code",
+                    "suffix": ""
+                }
+            }
+        }
+    },
+    "sceneList": {
+        "group_1": {
+            "cmd_1": {
+                "label": "Set Partition ... (PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestArmMode",
+                "argumentList": {
+                    "argument_1": {
+                        "dataType": "string",
+                        "defaultValue": "Disarmed",
+                        "allowedValueList": {
+                            "Disarmed" : "Disarmed",
+                            "Armed" : "Armed",
+                            "Stay" : "Stay",
+                            "StayInstant" : "StayInstant",
+                            "Night" : "Night",
+                            "NightInstant" : "NightInstant",
+                            "Force" : "Force",
+                            "Vacation" : "Vacation"
+                        },
+                        "name": "State",
+                        "prefix": "State",
+                        "suffix": ""
+                    },
+                    "argument_2": {
+                        "dataType": "ui4",
+                        "defaultValue": "1234",
+                        "allowedValueRange": {
+                            "minimum": "0",
+                            "maximum": "99999999"
+                        },
+                        "prefix" : "PIN",
+                        "suffix" : "0-99999999, (insecure)",
+                        "name": "PINCode"
+                    }
+                }
+            }
+        },
+        "group_2": {
+            "cmd_1": {
+                "label": "Set Partition Disarmed (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "Disarmed"
+                }
+            },
+            "cmd_2": {
+                "label": "Set Partition Armed (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "Armed"
+                }
+            },
+            "cmd_3": {
+                "label": "Set Partition Stay (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "Stay"
+                }
+            },
+            "cmd_4": {
+                "label": "Set Partition StayInstant (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "StayInstant"
+                }
+            },
+            "cmd_5": {
+                "label": "Set Partition Night (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "Night"
+                }
+            },
+            "cmd_6": {
+                "label": "Set Partition NightInstant (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "NightInstant"
+                }
+            },
+            "cmd_7": {
+                "label": "Set Partition Force (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "Force"
+                }
+            },
+            "cmd_8": {
+                "label": "Set Partition Vacation (No PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArmMode",
+                "arguments": {
+                    "State": "Vacation"
+                }
+            }
+        },
+        "group_3": {
+            "cmd_1": {
+                "label": "Request Medical Panic",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestPanicMode",
+                "arguments": {
+                    "State": "Medical"
+                }
+            },
+            "cmd_2": {
+                "label": "Request Police Panic",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestPanicMode",
+                "arguments": {
+                    "State": "Police"
+                }
+            },
+            "cmd_3": {
+                "label": "Request Fire Panic",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestPanicMode",
+                "arguments": {
+                    "State": "Fire"
+                }
+            }
+        }
+    }
+}
Index: /trunk/S_AlarmPartition2.xml
===================================================================
--- /trunk/S_AlarmPartition2.xml	(revision 30)
+++ /trunk/S_AlarmPartition2.xml	(revision 30)
@@ -0,0 +1,343 @@
+<?xml version="1.0"?>
+<scpd xmlns="urn:schemas-upnp-org:service-1-0">
+  <specVersion>
+    <major>2</major>
+    <minor>0</minor>
+  </specVersion>
+  <serviceStateTable>
+    <!-- The High Level State of the Partition, representing whether it's Armed or Disarmed.
+
+         Partition implementations are only required to implement the "Armed" and "Disarmed" states
+         since not every Panel provides the ability to "see" the other statuses and reflect
+         them to the UPnP consumer.
+
+         Disarmed - The Partition is in an un-armed state, and ready to be Armed.
+         Armed - The Partition is currently armed, or in an "away" state.
+    -->
+    <stateVariable sendEvents="yes">
+      <name>ArmMode</name>
+      <dataType>string</dataType>
+      <shortCode>armmode</shortCode>
+      <defaultValue>Disarmed</defaultValue>
+      <allowedValueList>
+        <allowedValue>Disarmed</allowedValue>
+        <allowedValue>Armed</allowedValue>
+      </allowedValueList>
+    </stateVariable>
+
+
+    <!-- The Detailed state of the Partition, representing whether it's Armed, Disarmed or one
+         of the common intermediary states.
+
+         Partition implementations are required to implement the "Armed" and "Disarmed" states,
+         corresponding to the State variable above.  Not every Panel provides the required API
+         to "see" the other statuses and reflect them to the UPnP consumer.
+
+         Note that some implementations may consider the "ExitDelay" state to be "Armed"
+         whilst others may consider them to be "Disarmed".  No association between DetailedArmMode
+         and State variables should be assumed by UPnP clients, due to this potential difference.
+
+         Some of the states may be transitional, and no guarantees are provided that the Panel
+         will complete any subsequent transition to a corresponding permanent state.  
+         UPnP clients should make no assumptions about the "next state" from what is
+         immediately presented, since this may be Vendor and/or Implementation specific.
+
+         Some of the states, like Night/NightInstant and Vacation, are included for specific Panel
+         vendors like the Elk and may not be present on other Panels.  Control Point authors should
+         be prepared to display these DetailedArmMode using an CP-specific visualization (an Icon,
+         Translated Text and so-on)
+
+         Disarmed - The Partition is disarmed.
+         Armed - The Partition is currently armed, or in an "away" state.
+         Stay - The Partition is in an "at-home" state, delays are permitted on Entry doors.
+         StayInstant - The Partition is in an "at-home" state, Entry doors trigger Alarm immediately.
+         Night - The Partition is in an "at-home, at-night" state, delays are permitted on Entry doors.
+         NightInstant - The Partition is in an "at-home, at-night" state, Entry doors trigger Alarm immediately.
+         Force - The Partition is in an "away" state, but one or more Zones are open.
+         Ready - The Partition is in an un-armed state, and ready to be Armed.
+         Vacation - The Partition is currently armed, or in an "away" state.
+         NotReady - The Partition is in an un-armed state, but one or more Zones are open.
+         FailedToArm - The Partition is in an un-armed state, and an arming attempt just failed.
+         EntryDelay - The Partition is currently moving towards the Disarmed state.
+         ExitDelay - The Partition is currently moving towards the Armed state.
+    -->
+    <stateVariable sendEvents="yes">
+      <name>DetailedArmMode</name>
+      <dataType>string</dataType>
+      <shortCode>detailedarmmode</shortCode>
+      <defaultValue>Ready</defaultValue>
+      <allowedValueList>
+        <allowedValue>Disarmed</allowedValue>
+        <allowedValue>Armed</allowedValue>
+        <allowedValue>Stay</allowedValue>
+        <allowedValue>StayInstant</allowedValue>
+        <allowedValue>Night</allowedValue>
+        <allowedValue>NightInstant</allowedValue>
+        <allowedValue>Force</allowedValue>
+        <allowedValue>Ready</allowedValue>
+        <allowedValue>Vacation</allowedValue>
+        <allowedValue>NotReady</allowedValue>
+        <allowedValue>FailedToArm</allowedValue>
+        <allowedValue>EntryDelay</allowedValue>
+        <allowedValue>ExitDelay</allowedValue>
+      </allowedValueList>
+    </stateVariable>
+
+
+    <!-- An indicator of whether the Partition is in Alarm state or not.
+
+      Partition implementations are only required to implement the "None" and "Active"
+      states.
+
+      Many alarm systems will "automatically" clear a Alarm state after some, often legally
+      mandated, period of time.  If this happens, the Partition should move to the "None"
+      state, but also has the option of setting the "AlarmMemory" state.
+
+      None - The Partition is not currently in Alarm, and no prior record of Alarm.
+      Active - The Partition is currently showing as an Alarm actively going off.
+    -->
+    <stateVariable sendEvents="yes">
+      <name>Alarm</name>
+      <dataType>string</dataType>
+      <shortCode>alarm</shortCode>
+      <defaultValue>None</defaultValue>
+      <allowedValueList>
+        <allowedValue>None</allowedValue>
+        <allowedValue>Active</allowedValue>
+      </allowedValueList>
+    </stateVariable>
+
+
+    <!-- An indicator of whether the Partition has Chime mode enabled.
+
+      Some Alarm Systems (DSC, Paradox, GE Caddx) can run in a mode where each Zone
+      that's opened will trigger a Chime, or Bell, to ring for a short period of
+      time.  This setting is independant of any Armed or Disarmed state of the 
+      Partition.
+
+      If the Panel supports intraspection of this property, then the value should
+      be brought forward.  Some panels (Paradox) support the setting, but don't
+      support the intraspection of the setting.  In these cases, the Partition
+      implementation must return "false" for this attribute.
+
+      true - The Partition is in Chime mode, and will ring a Bell when Zones are opened.
+      false - Chimes are disabled.  No chime/sound will occur when a Zone is opened.
+    -->
+    <stateVariable sendEvents="yes">
+      <name>ChimeEnabled</name>
+      <dataType>boolean</dataType>
+      <shortCode>chimeenabled</shortCode>
+      <defaultValue>false</defaultValue>
+    </stateVariable>
+
+
+    <!-- An indicator of whether the Partition has previously been in an Alarm state.
+
+      Each Panel, has a Panel-specific mechanism through which it will transition/clear
+      it's "AlarmMemory" state.
+
+      true - A prior Alarm state occurred, but it has since cleared
+      false - No prior Alarm state is known, or the Prior Alarm condition has been cleared.
+    -->
+    <stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>AlarmMemory</name>
+      <dataType>boolean</dataType>
+      <shortCode>alarmmemory</shortCode>
+    </stateVariable>
+
+
+    <!-- An indicator of when the Partition last entered "Active" state.
+
+      Not all Alarm systems support the information necessary to know that a Alarm has been
+      "reset" distinctly from it being "cleared" by some automated means.
+
+      If any implementation returns "Memory", for Alarm, then it must supply a non-Zero
+      value for this StateVariable.
+
+      0 - Default value if "Memory" is not supported, or if no prior record of Alarm.
+      TODO: represented as seconds past epoch???
+    -->
+    <stateVariable sendEvents="yes">
+      <name>LastAlarmActive</name>
+      <dataType>ui4</dataType>
+      <shortCode>lastalarmactive</shortCode>
+      <defaultValue>0</defaultValue>
+    </stateVariable>
+
+
+    <!-- The Last User to initiate an event against the Partition.
+
+      An Alarm-specific string representing the "User" who last initiated a command against
+      the Partition (typically, but not necessarily) via a Keypad input to the Panel.
+
+      Partitions that don't support the notion of "Users" should leave this blank.
+
+      A Partition implementation may choose to blank-out the value of this stateVariable,
+      after any time period that seems reasonable, to meet local security requirements.
+    -->
+    <stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>LastUser</name>
+      <dataType>string</dataType>
+      <shortCode>lastuser</shortCode>
+      <defaultValue></defaultValue> 
+    </stateVariable>
+
+
+    <!-- The Vendor Status (label) indicated by the Partition.
+
+      An Alarm/Vendor-specific string representing the Human readable "Status" last indicated
+      by the Partition.
+
+      This string may also show the Last status (label) of the Alarm Panel, and can be used
+      by UPnP Clients to display "progress" or current state.
+
+      eg. "Password not valid", "George's home is Arming", "Zones in Bypass 003, 004"
+
+      A Partition implementation may choose to blank-out the value of this stateVariable,
+      after any time period that seems reasonable, to meet local security requirements.
+
+      The string value is intended to be Human readable, as it may be presented within
+      a UPnP client's native display.
+    -->
+    <stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>VendorStatus</name>
+      <dataType>string</dataType>
+      <shortCode>vendorstatus</shortCode>
+      <defaultValue></defaultValue>
+    </stateVariable>
+
+
+    <!-- The Vendor Status Code indicated by the Partition.
+
+      An Alarm/Vendor-specific string representing the internal Status "code" last
+      indicated by the Partition.
+
+      This string may also show the Last status (label) of the Alarm Panel, and can be used
+      by UPnP Clients to display "progress" or current state.
+
+      These can also be used by "events" to provide Partition-specific mechanisms to
+      trigger things like "Fail to Arm" events and the like.
+
+      eg. "1378" (Elk) - "Rule Triggered Voice Telephone Dial"
+      eg. "658" (DSC) - "Keypad Lock-out"
+      eg. "040" (Paradox) - "Fail to Communicate on telephone Number"
+
+      A Partition implementation may choose to blank-out the value of this stateVariable,
+      after any time period that seems reasonable, to meet local security requirements.
+
+      The string value is intended to be used for Vendor specific scripting purposes.  Consult
+      your specific Vendor for the set of Valid Vendor Status codes.
+    -->
+    <stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>VendorStatusCode</name>
+      <dataType>string</dataType>
+      <shortCode>vendorstatuscode</shortCode>
+    </stateVariable>
+
+
+    <!-- The Vendor Status Data for the Vendor Status Code.
+
+      An Alarm/Vendor-specific string representing the internal state "data", associated with
+      the Vendor Status Code above.
+
+      The string value is intended to be used for Vendor specific scripting purposes.  Consult
+      your specific Vendor for the set of Valid Vendor Status data.
+    -->
+    <stateVariable sendEvents="yes" allowRepeats="yes">
+      <name>VendorStatusData</name>
+      <dataType>string</dataType>
+      <shortCode>vendorstatusdata</shortCode>
+    </stateVariable>
+  </serviceStateTable>
+ <actionList>
+    <!-- Request the Partition move into a named Arming mode, using a specific PIN Code..
+
+      There is no guarantee that requesting "Stay" mode wont result in the
+      State becoming "Armed", as some Panels do not differentiate the Stay Armed
+      status.
+
+      The following values must be accepted for the Arming mode, but Vendor specific values
+      may be input as well.  If a particular Vendor doesn't support the mode requested
+      it is free to "promote" the mode to an equivalent, or higher, mode within it's own
+      set.
+
+      eg. Requested State "Night" -> Executed State "Stay"
+
+      Disarmed - The Partition is disarmed.
+      Armed - The Partition is currently armed, or in an "away" mode.
+      Stay - The Partition is in an "at-home" mode, delays are permitted on Entry doors.
+      StayInstant - The Partition is in an "at-home" mode, Entry doors trigger Alarm immediately.
+      Night - The Partition is in an "at-home, at-night" mode, delays are permitted on Entry doors.
+      NightInstant - The Partition is in an "at-home, at-night" mode, Entry doors trigger Alarm immediately.
+      Force - The Partition is in an "away" mode, but one or more Zones are open.
+      Vacation - The Partition is currently armed, or in an "away" mode.
+    -->
+    <action>
+      <name>RequestArmMode</name>
+      <argumentList>
+        <argument>
+          <name>State</name>
+          <direction>in</direction>
+          <relatedStateVariable>DetailedArmMode</relatedStateVariable>
+        </argument>
+        <argument>
+          <name>PINCode</name>
+          <direction>in</direction>
+          <relatedStateVariable>ui4</relatedStateVariable>
+        </argument>
+      </argumentList>
+    </action>
+
+
+    <!-- Request the Partition move into a named Arming mode (No PIN Code).
+
+      The following values must be accepted for the Arming mode, but Vendor specific values
+      may be input as well.  If a particular Vendor doesn't support the mode requested
+      it is free to "promote" the mode to an equivalent, or higher, mode within it's own
+      set.
+
+      eg. Requested State "Night" -> Executed State "Stay"
+
+      Disarmed - The Partition is disarmed.
+      Armed - The Partition is currently armed, or in an "away" mode.
+      Stay - The Partition is in an "at-home" mode, delays are permitted on Entry doors.
+      StayInstant - The Partition is in an "at-home" mode, Entry doors trigger Alarm immediately.
+      Night - The Partition is in an "at-home, at-night" mode, delays are permitted on Entry doors.
+      NightInstant - The Partition is in an "at-home, at-night" mode, Entry doors trigger Alarm immediately.
+      Force - The Partition is in an "away" mode, but one or more Zones are open.
+      Vacation - The Partition is currently armed, or in an "away" mode.
+    -->
+    <action>
+      <name>RequestQuickArmMode</name>
+      <argumentList>
+        <argument>
+          <name>State</name>
+          <direction>in</direction>
+          <relatedStateVariable>DetailedArmMode</relatedStateVariable>
+        </argument>
+      </argumentList>
+    </action>
+
+
+    <!-- Request the initiation of a named Panic mode.
+
+      The following values must be accepted for the Panic mode, but Vendor specific values
+      may be input as well.  If a particular named mode doesn't exist, then the Vendor 
+      implementation is free to map this in a Vendor-specific manner.
+
+      Police - The Police Panic mode
+      Fire - The Fire Panic mode
+      Medical - The Medical Panic mode
+    -->
+    <action>
+      <name>RequestPanicMode</name>
+      <argumentList>
+        <argument>
+          <name>State</name>
+          <direction>in</direction>
+          <relatedStateVariable>string</relatedStateVariable>
+        </argument>
+      </argumentList>
+    </action>
+  </actionList>
+</scpd>
Index: /trunk/D_CaddxNX584Partition2.xml
===================================================================
--- /trunk/D_CaddxNX584Partition2.xml	(revision 30)
+++ /trunk/D_CaddxNX584Partition2.xml	(revision 30)
@@ -0,0 +1,20 @@
+<?xml version="1.0"?>
+<root xmlns="urn:schemas-upnp-org:device-1-0">
+  <specVersion>
+    <major>1</major>
+    <minor>0</minor>
+  </specVersion>
+  <device>
+    <deviceType>urn:schemas-futzle-com:device:CaddxNX584Partition:2</deviceType>
+    <staticJson>D_CaddxNX584Partition2.json</staticJson> 
+    <serviceList>
+      <service>
+        <serviceType>urn:schemas-micasaverde-com:service:AlarmPartition:2</serviceType>
+        <serviceId>urn:micasaverde-com:serviceId:AlarmPartition1</serviceId>
+        <controlURL>/upnp/control/AlarmPartition1</controlURL>
+        <eventSubURL>/upnp/event/AlarmPartition1</eventSubURL>
+        <SCPDURL>S_AlarmPartition2.xml</SCPDURL>
+      </service>
+    </serviceList>
+  </device>
+</root>
Index: unk/D_AlarmPartition1.json
===================================================================
--- /trunk/D_AlarmPartition1.json	(revision 20)
+++ 	(revision )
@@ -1,343 +1,0 @@
-{
-    "flashicon": "icons\/Door_Lock.swf",
-    "imgIconBody": "",
-    "imgIconDimmable": "",
-    "imgIconTurnable": "",
-    "imgIconMin": "pics\/devices\/Door_UNLOCKED.png",
-    "imgIconMax": "pics\/devices\/Door_LOCKED.png",
-    "halloIconsDir": "pics\/hallo",
-    "DisplayStatus": {
-        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-        "Variable": "Disarmed",
-        "MinValue": "1",
-        "MaxValue": "0"
-    },
-    "doc_url": {
-        "doc_language": 1,
-        "doc_manual": 1,
-        "doc_version": 1,
-        "doc_platform": 0,
-        "doc_page": "devices" 
-    },
-    "ToggleButton": 1,
-    "Tabs": [
-        {
-            "Label": {
-                "lang_tag": "tabname_control",
-                "text": "Control" 
-            },
-            "Position": "0",
-            "TabType": "flash",
-            "ControlGroup": [
-                {
-                    "id": "1",
-                    "isSingle": "1"
-                },
-                {
-                    "id": "2",
-                    "isSingle": "1"
-                }
-            ],
-            "Control": [
-                {
-                    "ControlType": "label",
-                    "Label": {
-                        "lang_tag": "device_settings_page",
-                        "text": "One Touch Arming Options" 
-                    },
-                    "Display": {
-                        "Top": 20,
-                        "Left": 50,
-                        "Width": 200,
-                        "Height": 20 
-                    } 
-                },
-                {
-                    "ControlGroup": "1",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "Quick Arm" 
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Variable": "Armed",
-                        "Value": "1",
-                        "Top": 40,
-                        "Left": 50,
-                        "Width": 75,
-                        "Height": 20 
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Action": "RequestQuickArm"
-                    } 
-                },
-                {
-                    "ControlGroup": "2",
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_lock",
-                        "text": "Quick Stay" 
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Variable": "StayArmed",
-                        "Value": "1",
-                        "Top": 40,
-                        "Left": 135,
-                        "Width": 75,
-                        "Height": 20 
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Action": "RequestQuickStay"
-                    } 
-                },
-                {
-                    "ControlType": "label",
-                    "Label": {
-                        "lang_tag": "device_settings_page",
-                        "text": "Arming Options" 
-                    },
-                    "Display": {
-                        "Top": 60,
-                        "Left": 50,
-                        "Width": 200,
-                        "Height": 20 
-                    } 
-                },
-                {
-                    "ControlType": "input",
-                    "ID": "PINCode",
-                    "Display": {
-                        "Top": 80,
-                        "Left": 50,
-                        "Width": 100,
-                        "Height": 20 
-                    } 
-                },
-                {
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_set",
-                        "text": "Arm" 
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Variable": "Armed",
-                        "Value": "1",
-                        "Top": 80,
-                        "Left": 160,
-                        "Width": 50,
-                        "Height": 20 
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Action": "RequestArm",
-                        "Parameters": [
-                            {
-                                "Name": "PINCode",
-                                "ID": "PINCode" 
-                            }
-                        ] 
-                    } 
-                },
-                {
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_set",
-                        "text": "Stay" 
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Variable": "StayArmed",
-                        "Value": "1",
-                        "Top": 100,
-                        "Left": 160,
-                        "Width": 50,
-                        "Height": 20 
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Action": "RequestStayArm",
-                        "Parameters": [
-                            {
-                                "Name": "PINCode",
-                                "ID": "PINCode" 
-                            }
-                        ] 
-                    } 
-                },
-                {
-                    "ControlType": "button",
-                    "Label": {
-                        "lang_tag": "cmd_set",
-                        "text": "Disarm" 
-                    },
-                    "Display": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Variable": "Disarmed",
-                        "Value": "1",
-                        "Top": 120,
-                        "Left": 160,
-                        "Width": 50,
-                        "Height": 20 
-                    },
-                    "Command": {
-                        "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Action": "RequestDisarm",
-                        "Parameters": [
-                            {
-                                "Name": "PINCode",
-                                "ID": "PINCode" 
-                            }
-                        ] 
-                    } 
-                }
-            ] 
-        },
-        {
-            "Label": {
-                "lang_tag": "advanced",
-                "text": "Advanced" 
-            },
-            "Position": "2",
-            "TabType": "javascript",
-            "ScriptName": "shared.js",
-            "Function": "advanced_device" 
-        }
-    ],
-    "DeviceType": "urn:schemas-micasaverde-com:device:AlarmPartition:1",
-    "eventList": {
-        "event_1": {
-            "label": "Partition is Armed",
-            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-            "serviceStateTable" : {
-                "Armed": {
-                    "value" : "1",
-                    "comparisson": "=" 
-                } 
-            },
-            "argumentList" : {
-                "argument_1" : {
-                    "dataType": "boolean",
-                    "defaultValue": "",
-                    "allowedValueList" : {
-                        "Yes" : "1",
-                        "No" : "0" 
-                    },
-                    "name": "Armed",
-                    "comparisson": "=",
-                    "prefix": "Is Armed?",
-                    "suffix": "" 
-                } 
-            } 
-        },
-        "event_2": {
-            "label": "Partition is Stay-Armed",
-            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-            "serviceStateTable" : {
-                "StayArmed": {
-                    "value": "1",
-                    "comparisson": "=" 
-                } 
-            },
-            "argumentList" : {
-                "argument_1" : {
-                    "dataType": "boolean",
-                    "defaultValue": "",
-                    "allowedValueList" : {
-                        "Yes" : "1",
-                        "No" : "0" 
-                    },
-                    "name": "StayArmed",
-                    "comparisson": "=",
-                    "prefix": "Is Stay Armed?",
-                    "suffix": "" 
-                } 
-            } 
-        },
-        "event_3": {
-            "label": "Partition is Breached",
-            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-            "serviceStateTable" : {
-                "Breach": {
-                    "value": "1",
-                    "comparisson": "=" 
-                } 
-            },
-            "argumentList" : {
-                "argument_1" : {
-                    "dataType": "boolean",
-                    "defaultValue": "",
-                    "allowedValueList" : {
-                        "Yes" : "1",
-                        "No" : "0" 
-                    },
-                    "name": "Breach",
-                    "comparisson": "=",
-                    "prefix": "In Breach?",
-                    "suffix": "" 
-                } 
-            } 
-        },
-        "event_4": {
-            "label": "Partition is Disarmed",
-            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-            "serviceStateTable" : {
-                "Disarmed": {
-                    "value" : "1",
-                    "comparisson": "=" 
-                } 
-            },
-            "argumentList" : {
-                "argument_1" : {
-                    "dataType": "boolean",
-                    "defaultValue": "",
-                    "allowedValueList" : {
-                        "Yes" : "1",
-                        "No" : "0" 
-                    },
-                    "name": "Disarmed",
-                    "comparisson": "=",
-                    "prefix": "Is Disarmed?",
-                    "suffix": "" 
-                } 
-            } 
-        } 
-    },
-    "sceneList": {
-        "group_1": {
-            "cmd_1": {
-                "label": "Set Virtual Input Open/Closed",
-                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                "action": "SetVirtualInput",
-                "argumentList": {
-                    "argument_1": {
-                        "dataType": "ui1",
-                        "defaultValue": "1",
-                        "allowedValueRange": {
-                            "minimum": "1",
-                            "maximum": "999" 
-                        },
-                        "prefix" : "Input#",
-                        "suffix" : "(1-999)",
-                        "name": "Input" 
-                    },
-                    "argument_2": {
-                        "dataType": "ui1",
-                        "defaultValue": "1",
-                        "allowedValueList": {
-                            "Open": "0",
-                            "Closed": "1" 
-                        },
-                        "prefix" : "",
-                        "suffix" : "",
-                        "name": "NewState" 
-                    } 
-                } 
-            } 
-        } 
-    } 
-}
Index: unk/S_AlarmPartition1.xml
===================================================================
--- /trunk/S_AlarmPartition1.xml	(revision 20)
+++ 	(revision )
@@ -1,81 +1,0 @@
-<?xml version="1.0"?>
-<scpd xmlns="urn:schemas-upnp-org:service-1-0">
-  <specVersion>
-    <major>1</major>
-    <minor>0</minor>
-  </specVersion>
-  <serviceStateTable>
-    <stateVariable sendEvents="yes">
-      <name>Disarmed</name>
-      <dataType>boolean</dataType>
-      <defaultValue>true</defaultValue>
-    </stateVariable>
-    <stateVariable sendEvents="yes">
-      <name>Armed</name>
-      <dataType>boolean</dataType>
-      <defaultValue>false</defaultValue>
-    </stateVariable>
-    <stateVariable sendEvents="yes">
-      <name>StayArmed</name>
-      <dataType>boolean</dataType>
-      <defaultValue>false</defaultValue>
-    </stateVariable>
-    <stateVariable sendEvents="yes">
-      <name>Breach</name>
-      <dataType>boolean</dataType>
-      <defaultValue>false</defaultValue>
-    </stateVariable>
-  </serviceStateTable>
-  <actionList>
-    <action>
-      <name>RequestArm</name>
-      <argumentList>
-        <argument>
-          <name>PINCode</name>
-          <direction>in</direction>
-        </argument>
-      </argumentList>
-    </action>
-    <action>
-      <name>RequestQuickArm</name>
-      <argumentList>
-      </argumentList>
-    </action>
-    <action>
-      <name>RequestStay</name>
-      <argumentList>
-        <argument>
-          <name>PINCode</name>
-          <direction>in</direction>
-        </argument>
-      </argumentList>
-    </action>
-    <action>
-      <name>RequestQuickStay</name>
-      <argumentList>
-      </argumentList>
-    </action>
-    <action>
-      <name>RequestDisarm</name>
-      <argumentList>
-        <argument>
-          <name>PINCode</name>
-          <direction>in</direction>
-        </argument>
-      </argumentList>
-    </action>
-    <action>
-      <name>SetVirtualInput</name>
-      <argumentList>
-        <argument>
-          <name>Input</name>
-          <direction>in</direction>
-        </argument>
-        <argument>
-          <name>NewState</name>
-          <direction>in</direction>
-        </argument>
-      </argumentList>
-    </action>
-  </actionList>
-</scpd>
Index: unk/D_AlarmPartition1.xml
===================================================================
--- /trunk/D_AlarmPartition1.xml	(revision 20)
+++ 	(revision )
@@ -1,149 +1,0 @@
-<?xml version="1.0"?>
-<root xmlns="urn:schemas-upnp-org:device-1-0">
-  <specVersion>
-    <major>1</major>
-    <minor>0</minor>
-  </specVersion>
-  <device>
-    <deviceType>urn:schemas-micasaverde-com:device:AlarmPartition:1</deviceType>
-	<staticJson>D_AlarmPartition1.json</staticJson> 
-    <serviceList>
-      <service>
-        <serviceType>urn:schemas-micasaverde-com:service:AlarmPartition:1</serviceType>
-        <serviceId>urn:micasaverde-com:serviceId:AlarmPartition1</serviceId>
-        <controlURL>/upnp/control/AlarmPartition1</controlURL>
-        <eventSubURL>/upnp/event/AlarmPartition1</eventSubURL>
-        <SCPDURL>S_AlarmPartition1.xml</SCPDURL>
-      </service>
-    </serviceList>
-    <eventList>
-{
-    "event_1":{
-        "label": "Partition is Armed",
-        "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-        "argumentList" :
-        {
-            "argument_1" :
-            {
-                "dataType": "boolean",
-                "defaultValue": "",
-                "allowedValueList" : 
-                {
-                    "Yes" : "1",
-                    "No" : "0"
-                },
-                "name": "Armed",
-                "comparisson": "=",
-                "prefix": "Is Armed?",
-                "suffix": ""
-            }
-        }
-    },
-    "event_2":{
-        "label": "Partition is Stay-Armed",
-        "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-        "argumentList" :
-        {
-            "argument_1" :
-            {
-                "dataType": "boolean",
-                "defaultValue": "",
-                "allowedValueList" : 
-                {
-                    "Yes" : "1",
-                    "No" : "0"
-                },
-                "name": "StayArmed",
-                "comparisson": "=",
-                "prefix": "Is Stay Armed?",
-                "suffix": ""
-            }
-        }
-    },
-    "event_3":{
-        "label": "Partition is Breached",
-        "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-        "argumentList" :
-        {
-            "argument_1" :
-            {
-                "dataType": "boolean",
-                "defaultValue": "",
-                "allowedValueList" : 
-                {
-                    "Yes" : "1",
-                    "No" : "0"
-                },
-                "name": "Breach",
-                "comparisson": "=",
-                "prefix": "In Breach?",
-                "suffix": ""
-            }
-        }
-    },
-    "event_4":{
-        "label": "Partition is Disarmed",
-        "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-        "argumentList" :
-        {
-            "argument_1" :
-            {
-                "dataType": "boolean",
-                "defaultValue": "",
-                "allowedValueList" : 
-                {
-                    "Yes" : "1",
-                    "No" : "0"
-                },
-                "name": "Disarmed",
-                "comparisson": "=",
-                "prefix": "Is Disarmed?",
-                "suffix": ""
-            }
-        }
-    }
-}
-    </eventList>	
-    <sceneList>
-{
-    "group_1":{
-        "cmd_1":
-        {
-            "label": "Set Virtual Input Open/Closed",
-            "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
-            "action": "SetVirtualInput",
-            "argumentList":
-            {
-                "argument_1":
-                {
-                    "dataType": "ui1",
-                    "defaultValue": "1",
-                    "allowedValueRange":
-                    {
-                        "minimum": "1",
-                        "maximum": "999"
-                    },
-                    "prefix" : "Input#",
-                    "suffix" : "(1-999)",
-                    "name": "Input"
-                },
-                "argument_2":
-                {
-                    "dataType": "ui1",
-                    "defaultValue": "1",
-                    "allowedValueList":
-                    {
-                        "Open": "0",
-                        "Closed": "1"
-                    },
-                    "prefix" : "",
-                    "suffix" : "",
-                    "name": "NewState"
-                },
-            }
-        }
-    }
-}
-    </sceneList>
-  </device>
-</root>
Index: /vendor/D_AlarmPartition1.json
===================================================================
--- /vendor/D_AlarmPartition1.json	(revision 20)
+++ /vendor/D_AlarmPartition1.json	(revision 30)
@@ -37,5 +37,8 @@
                     "id": "2",
                     "isSingle": "1"
-                }
+                },
+                {
+                    "id": "3"
+                },
             ],
             "Control": [
@@ -161,5 +164,5 @@
                     "Command": {
                         "Service": "urn:micasaverde-com:serviceId:AlarmPartition1",
-                        "Action": "RequestStayArm",
+                        "Action": "RequestStay",
                         "Parameters": [
                             {
@@ -171,4 +174,5 @@
                 },
                 {
+                    "ControlGroup": "3",
                     "ControlType": "button",
                     "Label": {
@@ -207,4 +211,24 @@
             "ScriptName": "shared.js",
             "Function": "advanced_device" 
+        },
+        {
+            "Label": {
+                "lang_tag": "logs",
+                "text": "Logs" 
+            },
+            "Position": "3",
+            "TabType": "javascript",
+            "ScriptName": "shared.js",
+            "Function": "device_logs" 
+        },
+        {
+            "Label": {
+                "lang_tag": "notifications",
+                "text": "Notifications" 
+            },
+            "Position": "4",
+            "TabType": "javascript",
+            "ScriptName": "shared.js",
+            "Function": "device_notifications" 
         }
     ],
@@ -339,4 +363,82 @@
                 } 
             } 
+        },
+        "group_2": {
+            "cmd_1": {
+                "label": "Arm Partition (PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestArm",
+                "argumentList": {
+                    "argument_1": {
+                        "dataType": "ui1",
+                        "defaultValue": "1234",
+                        "allowedValueRange": {
+                            "minimum": "0",
+                            "maximum": "999999999999" 
+                        },
+                        "prefix" : "PINCode",
+                        "suffix" : "(0-999999999999)",
+                        "name": "PINCode" 
+                    }
+                } 
+            } 
+        },
+        "group_3": {
+            "cmd_1": {
+                "label": "Quick Arm Partition",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickArm",
+                "argumentList": {
+                } 
+            } 
+        },
+        "group_4": {
+            "cmd_1": {
+                "label": "Stay Arm Partition (PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestStay",
+                "argumentList": {
+                    "argument_1": {
+                        "dataType": "ui1",
+                        "defaultValue": "1234",
+                        "allowedValueRange": {
+                            "minimum": "0",
+                            "maximum": "999999999999" 
+                        },
+                        "prefix" : "PINCode",
+                        "suffix" : "(0-999999999999)",
+                        "name": "PINCode" 
+                    }
+                } 
+            } 
+        },
+        "group_5": {
+            "cmd_1": {
+                "label": "Quick Stay Arm Partition",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestQuickStay",
+                "argumentList": {
+                } 
+            } 
+        },
+        "group_6": {
+            "cmd_1": {
+                "label": "Disarm Partition (PIN)",
+                "serviceId": "urn:micasaverde-com:serviceId:AlarmPartition1",
+                "action": "RequestDisarm",
+                "argumentList": {
+                    "argument_1": {
+                        "dataType": "ui1",
+                        "defaultValue": "1234",
+                        "allowedValueRange": {
+                            "minimum": "0",
+                            "maximum": "999999999999" 
+                        },
+                        "prefix" : "PINCode",
+                        "suffix" : "(0-999999999999)",
+                        "name": "PINCode" 
+                    }
+                } 
+            } 
         } 
     } 
