Index: /J_DayTime.js
===================================================================
--- /J_DayTime.js	(revision 3)
+++ /J_DayTime.js	(revision 3)
@@ -0,0 +1,21 @@
+var daytime_Svs = 'urn:rts-services-com:serviceId:DayTime';
+
+function daytime_Settings(deviceID) {
+    var day  = get_device_state(deviceID,  daytime_Svs, 'DayOffset');
+    var night  = get_device_state(deviceID,  daytime_Svs, 'NightOffset');
+    var html =  '<table width="100%">' +
+        ' <tr><td>Day Indicated at +/- <input  type="text" id="daytime_DayOffset"size=10 value="' +  day + '" onchange="daytime_Set(' + deviceID + ', \'DayOffset\', this.value);"> relative to sunrise.</td></tr>' +
+        ' <tr><td>Night Indicated  at +/- <input type="text" id="daytime_NightOffset" size=10 value="' +  night + '" onchange="daytime_Set(' + deviceID + ', \'NightOffset\', this.value);"> relative to sunset.</td></tr>' +
+        '</table>' +
+        '<p>Format is hh:mm:ss';
+    set_panel_html(html);
+}
+
+
+function daytime_Set(deviceID, varName, varVal) {
+    if (varVal.search(/^[\+\-]?\d{2}:\d{2}:\d{2}$/) == 0) {
+        set_device_state(deviceID,  daytime_Svs, varName, varVal);
+    } else {
+        $('#daytime_' + varName).va("");
+    }
+}
Index: /S_SwitchPower1.xml
===================================================================
--- /S_SwitchPower1.xml	(revision 3)
+++ /S_SwitchPower1.xml	(revision 3)
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<scpd xmlns="urn:schemas-upnp-org:service-1-0">
+  <specVersion>
+    <major>1</major>
+    <minor>0</minor>
+  </specVersion>
+  <serviceStateTable>
+    <stateVariable sendEvents="no">
+      <name>Target</name>
+      <sendEventsAttribute>no</sendEventsAttribute> 
+      <dataType>boolean</dataType>
+      <defaultValue>0</defaultValue>
+    </stateVariable>
+    <stateVariable sendEvents="yes">
+      <name>Status</name>
+      <dataType>boolean</dataType>
+      <defaultValue>0</defaultValue>
+      <shortCode>status</shortCode>
+    </stateVariable>
+  </serviceStateTable>
+  <actionList>
+    <action>
+    <name>SetTarget</name>
+      <argumentList>
+        <argument>
+          <name>newTargetValue</name>
+          <direction>in</direction>
+          <relatedStateVariable>Target</relatedStateVariable>
+        </argument>
+      </argumentList>
+    </action>
+    <action>
+    <name>GetTarget</name>
+      <argumentList>
+        <argument>
+          <name>RetTargetValue</name>
+          <direction>out</direction>
+          <relatedStateVariable>Target</relatedStateVariable>
+        </argument>
+      </argumentList>
+    </action>
+    <action>
+    <name>GetStatus</name>
+      <argumentList>
+        <argument>
+          <name>ResultStatus</name>
+          <direction>out</direction>
+          <relatedStateVariable>Status</relatedStateVariable>
+        </argument>
+      </argumentList>
+    </action>
+  </actionList>
+</scpd>
Index: /D_HouseModes.json
===================================================================
--- /D_HouseModes.json	(revision 1)
+++ /D_HouseModes.json	(revision 3)
@@ -259,5 +259,5 @@
                     "allowedValueList": [
                         {
-                            "1": "1",
+                            "m1": "1",
                             "HumanFriendlyText": {
                                 "lang_tag": "m_home",
@@ -266,5 +266,5 @@
                         },
                         {
-                            "2": "2",
+                            "m2": "2",
                             "HumanFriendlyText": {
                                 "lang_tag": "m_away",
@@ -273,5 +273,5 @@
                         },
 						{
-                            "3": "3",
+                            "m3": "3",
                             "HumanFriendlyText": {
                                 "lang_tag": "m_night",
@@ -280,5 +280,5 @@
                         },
 						{
-                            "4": "4",
+                            "m4": "4",
                             "HumanFriendlyText": {
                                 "lang_tag": "m_vacation",
Index: /I_DayTime.xml
===================================================================
--- /I_DayTime.xml	(revision 3)
+++ /I_DayTime.xml	(revision 3)
@@ -0,0 +1,195 @@
+<implementation>
+  
+<specVersion>
+    
+<major>1</major>
+    
+<minor>2</minor>
+  
+</specVersion>
+  
+<settings/>
+  
+<startup>init</startup>
+  
+<functions>
+  
+daytime_svs = "urn:rts-services-com:serviceId:DayTime"
+  
+function init(lul_device)
+    
+luup.call_timer("initial", 1, "20", "", tostring(lul_device))
+  
+end
+  
+function intervaltosec(interval) 
+    
+local res = 0
+    
+for w in string.gmatch(interval, "[%d]+") do
+      
+res = (res * 60) + w
+    
+end
+    
+if (string.sub(interval, 1,1) == '-') then
+      
+res = - res
+    
+end
+    
+return res
+  
+end
+  
+function initial(lul_device) 
+    
+lul_device = tonumber(lul_device)
+    
+NightOffset = luup.variable_get(daytime_svs, "NightOffset", lul_device)
+    
+if (not NightOffset) then
+       
+NightOffset = "00:00:00"
+    
+end
+    NightOffset = NightOffset .. 't'
+    
+DayOffset = luup.variable_get(daytime_svs, "DayOffset",  lul_device)
+    
+if (not DayOffset) then
+       
+DayOffset = "00:00:00"
+    
+end
+    
+DayOffset = DayOffset .. 'r'
+    
+local sr, ss, li, ui
+    
+local now = os.time()
+    
+if (luup.sunrise) then
+      
+sr = luup.sunrise() + intervaltosec(DayOffset)
+      
+ss = luup.sunset() + intervaltosec(NightOffset)
+    
+end
+   
+if (luup.is_night()) then
+      
+if (luup.sunrise) then
+          
+li = ss - (24 * 3600)
+          
+ui = sr
+	luup.log("InitN: " .. li .. ' : ' .. now .. ' : ' .. ui)
+	
+if ((now > li) and (ui > now)) then
+            
+setNight(lul_device)
+	
+else
+            
+setDay(lul_device)
+	
+end
+      
+else
+        
+setNight(lul_device)
+      
+end
+    
+else 
+      
+if (luup.sunrise) then
+       li = sr - (24 * 3600)
+          
+ui = ss
+	luup.log("InitD: " .. li .. ' : ' .. now .. ' : ' .. ui)
+	
+if ((now > li) and (ui > now)) then
+           setDay(lul_device)
+	
+else
+            
+setNight(lul_device)
+	
+end
+      
+else
+        
+setDay(lul_device)
+      
+end
+    
+end
+    
+os.execute("/bin/sh /etc/cmh-ludl/dn-install.sh")
+    
+os.remove("/etc/cmh-ludl/dn-install.sh")
+    
+os.execute("touch /etc/cmh-ludl/dn-install.sh")
+  
+end
+  
+function setDay(lul_device)
+    
+lul_device = tonumber(lul_device)
+    
+luup.log("SetDay: " .. DayOffset)
+    
+luup.call_action(daytime_svs, "SetTarget", {newTargetValue="1"}, lul_device)
+    
+luup.call_timer("setNight", 2, NightOffset, "1,2,3,4,5,6,7", lul_device)
+  
+end
+  
+function setNight(lul_device)
+    lul_device = tonumber(lul_device)
+    
+luup.log("SetNight:" .. NightOffset)
+    
+luup.call_action(daytime_svs, "SetTarget", {newTargetValue="0"}, lul_device)
+    luup.call_timer("setDay", 2, DayOffset, "1,2,3,4,5,6,7", lul_device)
+  
+end
+  
+</functions>
+  
+<actionList>
+    
+<action>
+      <
+serviceId>urn:rts-services-com:serviceId:DayTime</serviceId>
+      
+<name>SetTarget</name>
+      
+<run>
+        
+old_target = luup.variable_get(daytime_svs, "Target", lul_device)
+        
+if (old_target == lul_settings.newTargetValue) then 
+          
+luup.log("No Status Change: " .. lul_settings.newTargetValue)
+        
+else 
+          
+luup.log("New Status is: " .. lul_settings.newTargetValue)
+          
+luup.variable_set(daytime_svs, "Target", lul_settings.newTargetValue, lul_device)
+          
+luup.variable_set(daytime_svs, "Status", lul_settings.newTargetValue, lul_device)
+        
+end 
+      
+</run>
+      
+<jobname>SetTarget</jobname>
+    
+</action>
+  </actionList>
+
+</implementation>
Index: /D_BinaryLight1.json
===================================================================
--- /D_BinaryLight1.json	(revision 3)
+++ /D_BinaryLight1.json	(revision 3)
@@ -0,0 +1,322 @@
+{
+	"default_icon": "binary_light_default.png",
+    "state_icons": [
+        {
+            "img": "binary_light_off.png",
+            "conditions": [
+                {
+                    "service": "urn:upnp-org:serviceId:SwitchPower1",
+                    "variable": "Status",
+                    "operator": "==",
+                    "value": 0,
+                    "subcategory_num": 0
+                }
+            ]
+        },
+        {
+            "img": "binary_light_on.png",
+            "conditions": [
+                {
+                    "service": "urn:upnp-org:serviceId:SwitchPower1",
+                    "variable": "Status",
+                    "operator": "==",
+                    "value": 1,
+                    "subcategory_num": 0
+                }
+            ]
+        }
+    ],
+	"x": "2",
+	"y": "4",
+	"inScene": "1",
+	"ToggleButton": 1,
+	"Tabs": [
+		{
+			"Label": {
+				"lang_tag": "ui7_tabname_control",
+				"text": "Control"
+			},
+			"Position": "0",
+			"TabType": "flash",
+			"top_navigation_tab": 1,
+			"ControlGroup": [
+				{
+					"id": "1",
+					"isSingle": "1",
+					"scenegroup": "1"
+				}
+			],
+			"SceneGroup": [
+				{
+					"id": "1",
+					"top": "2",
+					"left": "0",
+					"x": "2",
+					"y": "1"
+				}
+			],
+			"Control": [
+				{
+					"ControlGroup": "1",
+					"ControlType": "multi_state_button",
+					"top": "0",
+					"left": "1",
+					"states":[
+						{
+							"Label": {
+								"lang_tag": "ui7_cmd_on",
+								"text": "On"
+							},
+							"ControlGroup": "1",
+							"Display": {
+								"Service": "urn:upnp-org:serviceId:SwitchPower1",
+								"Variable": "Status",
+								"Value": "1"
+							},
+							"Command": {
+								"Service": "urn:upnp-org:serviceId:SwitchPower1",
+								"Action": "SetTarget",
+								"Parameters": [
+									{
+										"Name": "newTargetValue",
+										"Value": "1"
+									}
+								]
+							},
+							"ControlCode": "power_on"
+						},
+						{
+							"Label": {
+								"lang_tag": "ui7_cmd_off",
+								"text": "Off"
+							},
+							"ControlGroup": "1",
+							"Display": {
+								"Service": "urn:upnp-org:serviceId:SwitchPower1",
+								"Variable": "Status",
+								"Value": "0"
+							},
+							"Command": {
+								"Service": "urn:upnp-org:serviceId:SwitchPower1",
+								"Action": "SetTarget",
+								"Parameters": [
+									{
+										"Name": "newTargetValue",
+										"Value": "0"
+									}
+								]
+							},
+							"ControlCode": "power_off"
+						}						
+					]
+				}
+			]
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_settings",
+				"text": "Settings"
+			},
+			"Position": "1",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "simple_device"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_advanced",
+				"text": "Advanced"
+			},
+			"Position": "2",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "advanced_device"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_device_options",
+				"text": "Device Options"
+			},
+			"Position": "3",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_zwave_options"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_logs",
+				"text": "Logs"
+			},
+			"Position": "4",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_logs"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_notifications",
+				"text": "Notifications"
+			},
+			"Position": "5",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_notifications"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_device_scenes",
+				"text": "Scenes"
+			},
+			"Position": "6",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_scenes"
+		}
+	],
+	"sceneList": {
+		"group_1": {
+			"cmd_1": {
+				"label": "ON",
+				"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+				"action": "SetTarget",
+				"arguments": {
+					"newTargetValue": "1"
+				},
+				"display": {
+					"service": "urn:upnp-org:serviceId:SwitchPower1",
+					"variable": "Status",
+					"value": "1"
+				}
+			},
+			"cmd_2": {
+				"label": "OFF",
+				"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+				"action": "SetTarget",
+				"arguments": {
+					"newTargetValue": "0"
+				},
+				"display": {
+					"service": "urn:upnp-org:serviceId:SwitchPower1",
+					"variable": "Status",
+					"value": "0"
+				}
+			}
+		}
+	},
+	"eventList2": [
+		{
+			"id": 1,
+			"label": {
+				"lang_tag": "ui7_a_device_is_turned_on_off",
+				"text": "A device is turned on or off"
+			},
+			"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "boolean",
+					"defaultValue": "1",
+					"allowedValueList": [
+						{
+							"Off": "0",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_device_turned_off",
+								"text": "Whenever the _DEVICE_NAME_ is turned off"
+							}
+						},
+						{
+							"On": "1",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_device_turned_on",
+								"text": "Whenever the _DEVICE_NAME_ is turned on"
+							}
+						}
+					],
+					"name": "Status",
+					"comparisson": "=",
+					"prefix": {
+						"lang_tag": "ui7_which_mode",
+						"text": "Which mode"
+					},
+					"suffix": {}
+				}
+			]
+		},
+		{
+			"id": 2,
+			"label": {
+				"lang_tag": "ui7_wh_energy_usage_24_goes_above",
+				"text": "Device energy usage for last 24 hours goes above"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Last24HKWH",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_kwh",
+						"text": "KWH"
+					},
+					"suffix": "",
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_kwh_usage_goes_above_day_dev",
+						"text": "Total energy usage for _DEVICE_NAME_ goes over _ARGUMENT_VALUE_ KWH in the last day"
+					}
+				}
+			]
+		},
+		{
+			"id": 3,
+			"label": {
+				"lang_tag": "ui7_wh_energy_usage_30_goes_below",
+				"text": "Device energy usage for last 30 days goes above"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Last30DKWH",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_kwh",
+						"text": "KWH"
+					},
+					"suffix": "",
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_kwh_usage_goes_below_month_dev",
+						"text": "Total energy usage for _DEVICE_NAME_ goes above _ARGUMENT_VALUE_ KWH in the last 30 days"
+					}
+				}
+			]
+		},
+		{
+			"id": 4,
+			"label": {
+				"lang_tag": "ui7_wh_energy_usage_365_goes_below",
+				"text": "Device energy usage for last year goes above"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Last365DKWH",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_kwh",
+						"text": "KWH"
+					},
+					"suffix": "",
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_kwh_usage_goes_below_year_dev",
+						"text": "Total energy usage for _DEVICE_NAME_ goes above _ARGUMENT_VALUE_ KWH in the last year"
+					}
+				}
+			]
+		}
+	],
+	"device_type": "urn:schemas-upnp-org:device:BinaryLight:1"
+}
Index: /D_DayTime.json
===================================================================
--- /D_DayTime.json	(revision 3)
+++ /D_DayTime.json	(revision 3)
@@ -0,0 +1,284 @@
+{
+    "default_icon": "DayTime.png",
+    "state_icons": [
+        {
+            "img": "DayTime_0.png",
+            "conditions": [
+                {
+                    "service": "urn:rts-services-com:serviceId:DayTime",
+                    "variable": "Status",
+                    "operator": "==",
+                    "value": 0,
+                    "subcategory_num": 0
+                }
+            ]
+        },
+        {
+            "img": "DayTime_100.png",
+            "conditions": [
+                {
+                    "service": "urn:rts-services-com:serviceId:DayTime",
+                    "variable": "Status",
+                    "operator": "==",
+                    "value": 1,
+                    "subcategory_num": 0
+                }
+            ]
+        }
+    ],
+    "x": "2",
+    "y": "4",
+    "inScene": "1",
+    "DisplayStatus": {
+        "Service": "urn:rts-services-com:serviceId:DayTime",
+        "Variable": "Status",
+        "MinValue": "1",
+        "MaxValue": "4"
+    },
+    "ToggleButton": 1,
+    "Tabs": [
+        {
+            "Label": {
+                "lang_tag": "tabname_control",
+                "text": "Control"
+            },
+            "Position": "0",
+            "TabType": "flash",
+            "ControlGroup": [
+                {
+                    "id": "1",
+                    "isSingle": "1",
+                    "scenegroup": "1"
+                },
+                {
+                    "id": "2",
+                    "isSingle": "1",
+                    "scenegroup": "1"
+                },
+		{
+                    "id": "3",
+                    "isSingle": "1",
+                    "scenegroup": "1"
+                },
+		{
+                    "id": "4",
+                    "isSingle": "1",
+                    "scenegroup": "1"
+                }
+            ],
+            "SceneGroup": [
+                {
+                    "id": "1",
+                    "top": "2",
+                    "left": "0",
+                    "x": "2",
+                    "y": "1"
+                }
+            ],
+            "Control": [
+		{
+                    "ControlGroup": "4",
+                    "ControlType": "button",
+                    "top": "0",
+                    "left": "3",
+                    "Label": {
+                        "lang_tag": "cmd_Vacation",
+                        "text": "Vacation"
+                    },
+                    "Display": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Variable": "Status",
+                        "Value": "4",
+                        "Top": 60,
+                        "Left": 335,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Action": "SetTarget",
+                        "Parameters": [
+                            {
+                                "Name": "newTargetValue",
+                                "Value": "4"
+                            }
+                        ]
+                    },
+                    "ControlCode": "power_vacation"
+                },
+                {
+                    "ControlGroup": "3",
+                    "ControlType": "button",
+                    "top": "0",
+                    "left": "2",
+                    "Label": {
+                        "lang_tag": "cmd_Night",
+                        "text": "Night"
+                    },
+                    "Display": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Variable": "Status",
+                        "Value": "3",
+                        "Top": 60,
+                        "Left": 240,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Action": "SetTarget",
+                        "Parameters": [
+                            {
+                                "Name": "newTargetValue",
+                                "Value": "3"
+                            }
+                        ]
+                    },
+                    "ControlCode": "power_night"
+                },
+		{
+                    "ControlGroup": "2",
+                    "ControlType": "button",
+                    "top": "0",
+                    "left": "1",
+                    "Label": {
+                        "lang_tag": "cmd_Away",
+                        "text": "Away"
+                    },
+                    "Display": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Variable": "Status",
+                        "Value": "2",
+                        "Top": 60,
+                        "Left": 145,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Action": "SetTarget",
+                        "Parameters": [
+                            {
+                                "Name": "newTargetValue",
+                                "Value": "2"
+                            }
+                        ]
+                    },
+                    "ControlCode": "power_on"
+                },
+                {
+                    "ControlGroup": "1",
+                    "ControlType": "button",
+                    "top": "0",
+                    "left": "0",
+                    "Label": {
+                        "lang_tag": "cmd_Home",
+                        "text": "Home"
+                    },
+                    "Display": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Variable": "Status",
+                        "Value": "1",
+                        "Top": 60,
+                        "Left": 50,
+                        "Width": 75,
+                        "Height": 20
+                    },
+                    "Command": {
+                        "Service": "urn:rts-services-com:serviceId:DayTime",
+                        "Action": "SetTarget",
+                        "Parameters": [
+                            {
+                                "Name": "newTargetValue",
+                                "Value": "1"
+                            }
+                        ]
+                    },
+                    "ControlCode": "power_off"
+                }
+            ]
+        },
+        {
+            "Label": {
+                "lang_tag": "settings",
+                "text": "Settings"
+            },
+            "Position": "1",
+            "TabType": "javascript",
+            "ScriptName": "J_DayTime.js",
+            "Function": "daytime_Settings"
+        },
+        {
+            "Label": {
+                "lang_tag": "advanced",
+                "text": "Advanced"
+            },
+            "Position": "2",
+            "TabType": "javascript",
+            "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"
+        }
+    ],
+    "eventList2": [
+        {
+            "id": 1,
+            "label": {
+                "lang_tag": "toggle_day_night",
+                "text": "Day or Night has arrived"
+            },
+            "serviceId": "urn:rts-services-com:serviceId:DayTime",
+            "argumentList": [
+                {
+                    "id": 1,
+                    "dataType": "boolean",
+                    "defaultValue": "1",
+                    "allowedValueList": [
+                        {
+                            "Off": "0",
+                            "HumanFriendlyText": {
+                                "lang_tag": "night",
+                                "text": "_DEVICE_NAME_ indicates Night time."
+                            }
+                        },
+                        {
+                            "On": "1",
+                            "HumanFriendlyText": {
+                                "lang_tag": "day",
+                                "text": "_DEVICE_NAME_ indicates Day time."
+                            }
+                        }
+                    ],
+                    "name": "Status",
+                    "comparisson": "=",
+                    "prefix": {
+                        "lang_tag": "which_mode",
+                        "text": "Which mode"
+                    },
+                    "suffix": {}
+                }
+            ]
+        }
+    ],
+    "DeviceType": "urn:schemas-rts-services-com:device:DayTime:1",
+    "device_type": "urn:schemas-rts-services-com:device:DayTime:1"
+}
Index: /impl.txt
===================================================================
--- /impl.txt	(revision 3)
+++ /impl.txt	(revision 3)
@@ -0,0 +1,2 @@
+Housemodes saved in variable Status 1 2 3 4
+If Status = X call function ChangeMode(x)
Index: /D_GenericIO1.json
===================================================================
--- /D_GenericIO1.json	(revision 3)
+++ /D_GenericIO1.json	(revision 3)
@@ -0,0 +1,219 @@
+{
+	"x": "2",
+	"y": "3",
+	"inScene": "1",
+	"Tabs": [
+		{
+			"Label": {
+				"lang_tag": "tabname_control",
+				"text": "Control"
+			},
+			"Position": "0",
+			"TabType": "flash",
+			"top_navigation_tab": 1,
+			"ControlGroup": [
+				{
+					"id": "1",
+					"scenegroup": "1",
+					"isSingle": "1"
+				},
+				{
+					"id": "2",
+					"scenegroup": "1",
+					"isSingle": "1"
+				}
+			],
+			"SceneGroup": [
+				{
+					"id": "1",
+					"top": "2",
+					"left": "0",
+					"x": "2",
+					"y": "1"
+				}
+			],
+			"Control": [
+				{
+					"ControlGroup": "2",
+					"ControlType": "button",
+					"top": "0",
+					"left": "0",
+					"Label": {
+						"lang_tag": "cmd_on",
+						"text": "On"
+					},
+					"Display": {
+						"Service": "urn:upnp-org:serviceId:SwitchPower1",
+						"Variable": "Status",
+						"Value": "1",
+						"Top": 60,
+						"Left": 50,
+						"Width": 75,
+						"Height": 20
+					},
+					"Command": {
+						"Service": "urn:upnp-org:serviceId:SwitchPower1",
+						"Action": "SetTarget",
+						"Parameters": [
+							{
+								"Name": "newTargetValue",
+								"Value": "1"
+							}
+						]
+					}
+				},
+				{
+					"ControlGroup": "1",
+					"ControlType": "button",
+					"top": "0",
+					"left": "1",
+					"Label": {
+						"lang_tag": "cmd_off",
+						"text": "Off"
+					},
+					"Display": {
+						"Service": "urn:upnp-org:serviceId:SwitchPower1",
+						"Variable": "Status",
+						"Value": "0",
+						"Top": 60,
+						"Left": 145,
+						"Width": 75,
+						"Height": 20
+					},
+					"Command": {
+						"Service": "urn:upnp-org:serviceId:SwitchPower1",
+						"Action": "SetTarget",
+						"Parameters": [
+							{
+								"Name": "newTargetValue",
+								"Value": "0"
+							}
+						]
+					}
+				}
+			]
+		},
+		{
+			"Label": {
+				"lang_tag": "settings",
+				"text": "Settings"
+			},
+			"Position": "1",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "simple_device"
+		},
+		{
+			"Label": {
+				"lang_tag": "advanced",
+				"text": "Advanced"
+			},
+			"Position": "2",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "advanced_device"
+		},
+		{
+			"Label": {
+				"lang_tag": "device_options",
+				"text": "Device Options"
+			},
+			"Position": "3",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_zwave_options"
+		},
+		{
+			"Label": {
+				"lang_tag": "logs",
+				"text": "Logs"
+			},
+			"Position": "4",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_logs"
+		},
+		{
+			"Label": {
+				"lang_tag": "notifications",
+				"text": "Notifications"
+			},
+			"Position": "5",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_notifications"
+		}
+	],
+	"sceneList": {
+		"group_1": {
+			"cmd_1": {
+				"label": "ON",
+				"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+				"action": "SetTarget",
+				"arguments": {
+					"newTargetValue": "1"
+				},
+				"display": {
+					"service": "urn:upnp-org:serviceId:SwitchPower1",
+					"variable": "Status",
+					"value": "1"
+				}
+			},
+			"cmd_2": {
+				"label": "OFF",
+				"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+				"action": "SetTarget",
+				"arguments": {
+					"newTargetValue": "0"
+				},
+				"display": {
+					"service": "urn:upnp-org:serviceId:SwitchPower1",
+					"variable": "Status",
+					"value": "0"
+				}
+			}
+		}
+	},
+	"eventList2": [
+		{
+			"id": 1,
+			"label": {
+				"lang_tag": "a_device_is_turned_on_off",
+				"text": "A device is turned on or off"
+			},
+			"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "boolean",
+					"defaultValue": "1",
+					"allowedValueList": [
+						{
+							"Off": "0",
+							"HumanFriendlyText": {
+								"lang_tag": "hft_device_turned_off",
+								"text": "Whenever the _DEVICE_NAME_ is turned off"
+							}
+						},
+						{
+							"On": "1",
+							"HumanFriendlyText": {
+								"lang_tag": "hft_device_turned_on",
+								"text": "_DEVICE_NAME_ is turned on"
+							}
+						}
+					],
+					"name": "Status",
+					"comparisson": "=",
+					"prefix": {
+						"lang_tag": "which_mode",
+						"text": "Which mode"
+					},
+					"suffix": {}
+				}
+			]
+		}
+	],
+	"DeviceType": "urn:schemas-micasaverde-com:device:GenericIO:1",
+	"device_type": "urn:schemas-micasaverde-com:device:GenericIO:1"
+}
Index: /D_HVAC_ZoneThermostat1.json
===================================================================
--- /D_HVAC_ZoneThermostat1.json	(revision 3)
+++ /D_HVAC_ZoneThermostat1.json	(revision 3)
@@ -0,0 +1,841 @@
+{
+	"default_icon": "thermostat_device_default.png",
+    "state_icons": [
+        {
+            "img": "thermostat_mode_off.png",
+            "conditions": [
+                {
+                    "service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                    "variable": "ModeStatus",
+                    "operator": "==",
+                    "value": "Off",
+                    "subcategory_num": 1
+                }
+            ]
+        },
+        {
+            "img": "thermostat_mode_auto.png",
+            "conditions": [
+                {
+                    "service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                    "variable": "ModeStatus",
+                    "operator": "==",
+                    "value": "AutoChangeOver",
+                    "subcategory_num": 1
+                }
+            ]
+        },
+        {
+            "img": "thermostat_mode_cooling.png",
+            "conditions": [
+                {
+                    "service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                    "variable": "ModeStatus",
+                    "operator": "==",
+                    "value": "CoolOn",
+                    "subcategory_num": 1
+                }
+            ]
+        },
+        {
+            "img": "thermostat_mode_heating.png",
+            "conditions": [
+                {
+                    "service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                    "variable": "ModeStatus",
+                    "operator": "==",
+                    "value": "HeatOn",
+                    "subcategory_num": 1
+                }
+            ]
+        }
+    ],
+	"x": "4",
+	"y": "4",
+	"inScene": "1",
+	"ToggleButton": 1,
+	"Tabs": [
+		{
+			"Label": {
+				"lang_tag": "ui7_tabname_control",
+				"text": "Control"
+			},
+			"Position": "0",
+			"TabType": "flash",
+			"top_navigation_tab": 1,
+			"ControlGroup": [
+				{
+					"id": "7",
+					"scenegroup": "7"
+				},
+				{
+					"id": "6",
+					"scenegroup": "6"
+				}
+			],
+			"SceneGroup": [
+				{
+					"id": "7",
+					"top": "0.5",
+					"left": "0",
+					"x": "2",
+					"y": "0.5"
+				},
+				{
+					"id": "6",
+					"top": "1.5",
+					"left": "0",
+					"x": "2",
+					"y": "1.5"
+				}
+			],
+			"Control": [
+                {
+                    "ControlGroup": "6",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "ui7_cmd_thermostat_set_mode_off",
+                        "text": "Set Mode Off"
+                    },
+                    "Display": {
+                        "Service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                        "Variable": "ModeStatus",
+                        "Value": "Off"
+                    },
+                    "Command": {
+                        "HumanFriendlyText": {
+                            "lang_tag": "ui7_cmd_thermostat_set_mode_off",
+                            "text": "Set Mode Off"
+                        },
+                        "Service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                        "Action": "SetModeTarget",
+                        "Parameters": [
+                            {
+                                "Name": "NewModeTarget",
+                                "Value": "Off"
+                            }
+                        ]
+                    },
+                    "ControlCode": "thermostat_mode_off"
+                },
+                {
+                    "ControlGroup": "6",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "ui7_cmd_thermostat_set_mode_cool_on",
+                        "text": "Set Mode Cool On"
+                    },
+                    "Display": {
+                        "Service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                        "Variable": "ModeStatus",
+                        "Value": "CoolOn"
+                    },
+                    "Command": {
+                        "HumanFriendlyText": {
+                            "lang_tag": "ui7_cmd_thermostat_set_mode_cool_on",
+                            "text": "Set Mode Cool On"
+                        },
+                        "Service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                        "Action": "SetModeTarget",
+                        "Parameters": [
+                            {
+                                "Name": "NewModeTarget",
+                                "Value": "CoolOn"
+                            }
+                        ]
+                    },
+                    "ControlCode": "thermostat_mode_cool"
+                },
+                {
+                    "ControlGroup": "6",
+                    "ControlType": "button",
+                    "Label": {
+                        "lang_tag": "ui7_cmd_thermostat_set_mode_heat_on",
+                        "text": "Set Mode Heat On"
+                    },
+                    "Display": {
+                        "Service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                        "Variable": "ModeStatus",
+                        "Value": "HeatOn"
+                    },
+                    "Command": {
+                        "HumanFriendlyText": {
+                            "lang_tag": "ui7_cmd_thermostat_set_mode_heat_on",
+                            "text": "Set Mode Heat On"
+                        },
+                        "Service": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+                        "Action": "SetModeTarget",
+                        "Parameters": [
+                            {
+                                "Name": "NewModeTarget",
+                                "Value": "HeatOn"
+                            }
+                        ]
+                    },
+                    "ControlCode": "thermostat_mode_heat"
+                },
+				{
+					"ControlGroup": "7",
+					"ControlType": "slider",
+					"top": "0",
+					"left": "0",
+					"ControlPair": "1",
+					"Style": "numeric",
+					"LabelMin": {
+						"lang_tag": "ui7_hvac_zonethermostat_heatpoint_label_min",
+						"text": "Cold"
+					},
+					"LabelMax": {
+						"lang_tag": "ui7_hvac_zonethermostat_heatpoint_label_max",
+						"text": "Hot"
+					},
+					"LabelSymbol": {
+						"lang_tag": "ui7_hvac_zonethermostat_heatpoint_label_symbol",
+						"text": "&deg;"
+					},
+					"ShowButtons": "1",
+					"Display": {
+						"Service": "urn:upnp-org:serviceId:TemperatureSetpoint1",
+						"Variable": "CurrentSetpoint",
+						"MinValue": "0",
+						"MaxValue": "100",						
+						"Top": 50,
+						"Left": 50,
+						"Width": 100,
+						"Height": 20,
+						"ID": "NewCurrentSetpoint"					
+					},
+					"Command": {
+						"HumanFriendlyText": {
+								"lang_tag": "ui7_cmd_thermostat_set_setpoint",
+								"text": "Set temperature"
+						},
+						"Sufix": "&deg;_TEMPERATURE_FORMAT_",
+						"Description": {
+							"lang_tag": "ui7_cmd_thermostat_setpoint_description",
+							"text": "Enter a value between 0 and 100"
+						},
+						"Service": "urn:upnp-org:serviceId:TemperatureSetpoint1",
+						"Action": "SetCurrentSetpoint",
+						"Parameters": [
+							{
+								"Name": "NewCurrentSetpoint",
+								"ID": "NewCurrentSetpoint"
+							}
+						]
+					},
+					"ControlCode": "heating_setpoint"
+				}
+			]
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_settings",
+				"text": "Settings"
+			},
+			"Position": "1",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "simple_device"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_advanced",
+				"text": "Advanced"
+			},
+			"Position": "2",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "advanced_device"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_device_options",
+				"text": "Device Options"
+			},
+			"Position": "3",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_zwave_options"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_logs",
+				"text": "Logs"
+			},
+			"Position": "4",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_logs"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_notifications",
+				"text": "Notifications"
+			},
+			"Position": "5",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_notifications"
+		},
+		{
+			"Label": {
+				"lang_tag": "ui7_device_scenes",
+				"text": "Scenes"
+			},
+			"Position": "6",
+			"TabType": "javascript",
+			"ScriptName": "shared.js",
+			"Function": "device_scenes"
+		}
+	],
+	"sceneList": {
+		"group_1": {
+			"cmd_1": {
+				"label": "OFF",
+				"serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+				"action": "SetModeTarget",
+				"arguments": {
+					"NewModeTarget": "Off"
+				}
+			},
+			"cmd_2": {
+				"label": "COOL",
+				"serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+				"action": "SetModeTarget",
+				"arguments": {
+					"NewModeTarget": "CoolOn"
+				}
+			},
+			"cmd_3": {
+				"label": "HEAT",
+				"serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+				"action": "SetModeTarget",
+				"arguments": {
+					"NewModeTarget": "HeatOn"
+				}
+			},
+			"cmd_4": {
+				"label": "AUTO",
+				"serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+				"action": "SetModeTarget",
+				"arguments": {
+					"NewModeTarget": "AutoChangeOver"
+				}
+			}
+		},
+		"group_2": {
+			"cmd_1": {
+				"label": "Set Heat Setpoint",
+				"serviceId": "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat",
+				"action": "SetCurrentSetpoint",
+				"argumentList": {
+					"argument_1": {
+						"dataType": "ui1",
+						"defaultValue": "",
+						"allowedValueRange": {
+							"minimum": "0",
+							"maximum": "100"
+						},
+						"prefix": "to",
+						"suffix": "&deg;",
+						"name": "NewCurrentSetpoint"
+					}
+				}
+			}
+		},
+		"group_3": {
+			"cmd_1": {
+				"label": "Set Cool Setpoint",
+				"serviceId": "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool",
+				"action": "SetCurrentSetpoint",
+				"argumentList": {
+					"argument_1": {
+						"dataType": "ui1",
+						"defaultValue": "",
+						"allowedValueRange": {
+							"minimum": "0",
+							"maximum": "100"
+						},
+						"prefix": "to",
+						"suffix": "&deg;",
+						"name": "NewCurrentSetpoint"
+					}
+				}
+			}
+		},
+		"group_4": {
+			"cmd_1": {
+				"label": "Set Fan On",
+				"serviceId": "urn:upnp-org:serviceId:HVAC_FanOperatingMode1",
+				"action": "SetMode",
+				"arguments": {
+					"NewMode": "ContinuousOn"
+				}
+			},
+			"cmd_2": {
+				"label": "Set Fan Auto",
+				"serviceId": "urn:upnp-org:serviceId:HVAC_FanOperatingMode1",
+				"action": "SetMode",
+				"arguments": {
+					"NewMode": "Auto"
+				}
+			}
+		},
+		"group_5": {
+			"cmd_1": {
+				"label": "Normal",
+				"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+				"action": "SetTarget",
+				"arguments": {
+					"newTargetValue": "1"
+				}
+			},
+			"cmd_2": {
+				"label": "Energy",
+				"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+				"action": "SetTarget",
+				"arguments": {
+					"newTargetValue": "0"
+				}
+			}
+		}
+	},
+	"eventList2": [
+		{
+			"id": 1,
+			"label": {
+				"lang_tag": "ui7_thermostat_mode_changes",
+				"text": "Thermostat Mode Changes"
+			},
+			"serviceId": "urn:upnp-org:serviceId:HVAC_UserOperatingMode1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "string",
+					"defaultValue": "",
+					"allowedValueList": [
+						{
+							"Off": "Off",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_device_turned_off",
+								"text": "Whenever the _DEVICE_NAME_ is turned off"
+							}
+						},
+						{
+							"Cool": "CoolOn",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_thermostat_set_to_cool",
+								"text": "Whenever the _DEVICE_NAME_ is set to cool"
+							}
+						},
+						{
+							"Heat": "HeatOn",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_thermostat_set_to_heat",
+								"text": "Whenever the _DEVICE_NAME_ is set to heat"
+							}
+						},
+						{
+							"Auto": "AutoChangeOver",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_thermostat_set_to_auto",
+								"text": "Whenever the _DEVICE_NAME_ is set to auto"
+							}
+						}
+					],
+					"name": "ModeStatus",
+					"comparisson": "=",
+					"prefix": {
+						"lang_tag": "ui7_mode",
+						"text": "Mode"
+					},
+					"suffix": {}
+				}
+			]
+		},
+		{
+			"id": 2,
+			"label": {
+				"lang_tag": "ui7_ambient_temperature_goes_above",
+				"text": "Ambient temperature goes above"
+			},
+			"serviceId": "urn:upnp-org:serviceId:TemperatureSensor1",
+			"norepeat": "1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "CurrentTemperature",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_temperature",
+						"text": "temperature"
+					},
+					"suffix": {
+						"lang_tag": "ui7_degrees",
+						"text": "degrees"
+					},
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_hft_ambient_temperature_goes_above",
+						"text": "_DEVICE_NAME_ ambient temperature goes above _ARGUMENT_VALUE_ degrees"
+					}
+				}
+			]
+		},
+		{
+			"id": 3,
+			"label": {
+				"lang_tag": "ui7_normal_mode_changes",
+				"text": "Energy Mode or Normal Mode Changes"
+			},
+			"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "boolean",
+					"defaultValue": "1",
+					"allowedValueList": [
+						{
+							"Energy": "0",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_thermostat_energy_energy",
+								"text": "_DEVICE_NAME_ set to energy"
+							}
+						},
+						{
+							"Normal": "1",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_thermostat_energy_normal",
+								"text": "_DEVICE_NAME_ set to normal"
+							}
+						}
+					],
+					"name": "Status",
+					"comparisson": "=",
+					"prefix": {
+						"lang_tag": "ui7_which_mode",
+						"text": "Which mode"
+					},
+					"suffix": {}
+				}
+			]
+		},
+		{
+			"id": 4,
+			"label": {
+				"lang_tag": "ui7_ambient_temperature_goes_above_or_below",
+				"text": "Ambient temperature goes above or below"
+			},
+			"serviceId": "urn:upnp-org:serviceId:TemperatureSensor1",
+			"norepeat": "1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "CurrentTemperature",
+					"comparisson": "<,>",
+					"prefix": {
+						"lang_tag": "ui7_temperature",
+						"text": "temperature"
+					},
+					"suffix": {
+						"lang_tag": "ui7_degrees",
+						"text": "degrees"
+					},
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_hft_ambient_temperature_goes_above_or_below",
+						"text": "_DEVICE_NAME_ goes above/below _ARGUMENT_VALUE_ degrees"
+					}
+				}
+			]
+		},
+		{
+			"id": 5,
+			"label": {
+				"lang_tag": "ui7_thermostat_heat_point_goes_over",
+				"text": "Thermostat HEAT set point goes over"
+			},
+			"serviceId": "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "CurrentSetpoint",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_temperature",
+						"text": "temperature"
+					},
+					"suffix": {
+						"lang_tag": "ui7_degrees",
+						"text": "degrees"
+					},
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_hft_thermostat_heatpoint_goes_over",
+						"text": "_DEVICE_NAME_ heat setpoint goes over _ARGUMENT_VALUE_ degrees"
+					}
+				}
+			]
+		},
+		{
+			"id": 6,
+			"label": {
+				"lang_tag": "ui7_thermostat_coolpoint_goes_below",
+				"text": "Thermostat COOL set point goes below"
+			},
+			"serviceId": "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "CurrentSetpoint",
+					"comparisson": "<",
+					"prefix": {
+						"lang_tag": "ui7_temperature",
+						"text": "temperature"
+					},
+					"suffix": {
+						"lang_tag": "ui7_degrees",
+						"text": "degrees"
+					},
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_hft_thermostat_coolpoint_goes_below",
+						"text": "_DEVICE_NAME_ cool setpoint goes below _ARGUMENT_VALUE_ degrees"
+					}
+				}
+			]
+		},
+		{
+			"id": 7,
+			"label": {
+				"lang_tag": "ui7_ambient_temperature_goes_below",
+				"text": "Ambient temperature goes below"
+			},
+			"serviceId": "urn:upnp-org:serviceId:TemperatureSensor1",
+			"norepeat": "1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "CurrentTemperature",
+					"comparisson": "<",
+					"prefix": {
+						"lang_tag": "ui7_temperature",
+						"text": "temperature"
+					},
+					"suffix": {
+						"lang_tag": "ui7_degrees",
+						"text": "degrees"
+					},
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_hft_ambient_temperature_goes_below",
+						"text": "_DEVICE_NAME_ ambient temperature goes below _ARGUMENT_VALUE_ degrees"
+					}
+				}
+			]
+		},
+		{
+			"id": 8,
+			"label": {
+				"lang_tag": "ui7_battery_level_goes_below",
+				"text": "Battery level goes below"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:HaDevice1",
+			"argumentList": [
+				{
+					"id": 1,
+					"prefix": {
+						"lang_tag": "ui7_Level",
+						"text": "Level"
+					},
+					"dataType": "i4",
+					"name": "BatteryLevel",
+					"comparisson": "<",
+                    "minValue": "1",
+                    "maxValue": "99",
+					"suffix": {
+						"lang_tag": "ui7_percent_sign",
+						"text": "%"
+					},
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_hft_battery_level_goes_below",
+						"text": "Battery level for _DEVICE_NAME_ goes below _ARGUMENT_VALUE_%"
+					}
+				}
+			]
+		},
+		{
+			"id": 9,
+			"label": {
+				"lang_tag": "ui7_wh_energy_usage_24_goes_above",
+				"text": "Device energy usage for last 24 hours goes above"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Last24HKWH",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_kwh",
+						"text": "KWH"
+					},
+					"suffix": "",
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_kwh_usage_goes_above_day_dev",
+						"text": "Total energy usage for _DEVICE_NAME_ goes over _ARGUMENT_VALUE_ KWH in the last day"
+					}
+				}
+			]
+		},
+		{
+			"id": 10,
+			"label": {
+				"lang_tag": "ui7_wh_energy_usage_30_goes_below",
+				"text": "Device energy usage for last 30 days goes above"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Last30DKWH",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_kwh",
+						"text": "KWH"
+					},
+					"suffix": "",
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_kwh_usage_goes_below_month_dev",
+						"text": "Total energy usage for _DEVICE_NAME_ goes above _ARGUMENT_VALUE_ KWH in the last 30 days"
+					}
+				}
+			]
+		},
+		{
+			"id": 11,
+			"label": {
+				"lang_tag": "ui7_wh_energy_usage_365_goes_below",
+				"text": "Device energy usage for last year goes above"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Last365DKWH",
+					"comparisson": ">",
+					"prefix": {
+						"lang_tag": "ui7_kwh",
+						"text": "KWH"
+					},
+					"suffix": "",
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_kwh_usage_goes_below_year_dev",
+						"text": "Total energy usage for _DEVICE_NAME_ goes above _ARGUMENT_VALUE_ KWH in the last year"
+					}
+				}
+			]
+		},
+		{
+			"id": 12,
+			"label": {
+				"lang_tag": "ui7_energy_usage_goes_above",
+				"text": "Energy usage goes above"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Watts",
+					"comparisson": ">",
+					"prefix": "Watts: ",
+					"suffix": "",
+					"HumanFriendlyText": {
+						"lang_tag": "hft_energy_usage_goes_above",
+						"text": "Whenever the energy usage for _DEVICE_NAME_ goes above _ARGUMENT_VALUE_ Watts"
+					}
+				}
+			]
+		},
+		{
+			"id": 13,
+			"label": {
+				"lang_tag": "ui7_energy_usage_goes_below",
+				"text": "Energy usage goes below"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:EnergyMetering1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "i4",
+					"name": "Watts",
+					"comparisson": "<",
+					"prefix": "Watts: ",
+					"suffix": {},
+					"HumanFriendlyText": {
+						"lang_tag": "ui7_hft_energy_usage_goes_below",
+						"text": "Energy usage for _DEVICE_NAME_ goes below _ARGUMENT_VALUE_ Watts"
+					}
+				}
+			]
+		},
+		{
+			"id": 14,
+			"label": {
+				"lang_tag": "thermostat_state_changes",
+				"text": "Thermostat State Changes"
+			},
+			"serviceId": "urn:micasaverde-com:serviceId:HVAC_OperatingState1",
+			"argumentList": [
+				{
+					"id": 1,
+					"dataType": "string",
+					"defaultValue": "",
+					"allowedValueList": [
+						{
+							"Idle": "Idle",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_state_idle",
+								"text": "_DEVICE_NAME_ is idle"
+							}
+						},
+						{
+							"Heating": "Heating",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_state_heating",
+								"text": "_DEVICE_NAME_ is actively heating"
+							}
+						},
+						{
+							"Heat": "Cooling",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_state_cooling",
+								"text": "_DEVICE_NAME_ is actively cooling"
+							}
+						},
+						{
+							"Auto": "FanOnly",
+							"HumanFriendlyText": {
+								"lang_tag": "ui7_hft_state_fan",
+								"text": "_DEVICE_NAME_ fan is running"
+							}
+						}
+					],
+					"name": "ModeState",
+					"comparisson": "=",
+					"prefix": {
+						"lang_tag": "state",
+						"text": "State"
+					},
+					"suffix": {}
+				}
+			]
+		}		
+	],
+	"device_type": "urn:schemas-upnp-org:device:HVAC_ZoneThermostat:1"
+}
Index: /D_BinaryLight1.xml
===================================================================
--- /D_BinaryLight1.xml	(revision 3)
+++ /D_BinaryLight1.xml	(revision 3)
@@ -0,0 +1,28 @@
+<?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-upnp-org:device:BinaryLight:1</deviceType>
+    <staticJson>D_BinaryLight1.json</staticJson>
+    <serviceList>
+      <service>
+        <serviceType>urn:schemas-upnp-org:service:SwitchPower:1</serviceType>
+        <serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
+        <SCPDURL>S_SwitchPower1.xml</SCPDURL>
+      </service>
+      <service>
+        <serviceType>urn:schemas-micasaverde-com:service:EnergyMetering:1</serviceType>
+        <serviceId>urn:micasaverde-com:serviceId:EnergyMetering1</serviceId>
+        <SCPDURL>S_EnergyMetering1.xml</SCPDURL>
+      </service>
+      <service>
+        <serviceType>urn:schemas-micasaverde-com:service:HaDevice:1</serviceType>
+        <serviceId>urn:micasaverde-com:serviceId:HaDevice1</serviceId>
+        <SCPDURL>S_HaDevice1.xml</SCPDURL>
+      </service>
+    </serviceList>
+  </device>
+</root>
