Garage Door - Vent - Luup Code

Hello Everyone,

I’ve done a search and haven’t quite found the code to do what I need.
Device:
Telguard GDC1 - Universal Z-Wave Garage Door Control Switch

Goal:
Vent Garage Door a couple inches or so. (To let some heat out of the garage)
Example: (Engage opening the garage door - then stop it from opening - leaving the garage open about 3-6 inches).

Progress: (but not)
I’ve been able to get the garage door to vent somewhat…
I can get it to open wait a second and then stop it from opening. (it’s not a quite a vent as the garage is about 75% open.)
However, after 5-10 seconds it will auto-close the garage. (because it thinks that it failed to close…)

Background:
When you engage the “Close Garage Door”, it waits about 5-10 seconds and if it sees the garage is not closed, then it will try to re-close itself.

Last Attempted Code: (Opens Garage Door - Stops it 75% Way - but then auto closes)

local device = 22
-- Switch on device 22:
luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="1" },device)
luup.call_delay( 'vent', 1) -- Call the switch off function after a delay of 1 seconds
function vent()
   luup.call_action("urn:upnp-org:serviceId:SwitchPower1","SetTarget",{ newTargetValue="0" },device)
end

Thoughts:
If I can some how figure how to change this:
<Device_Num_22 PendingJobs=“0” status=“4”>
to this
<Device_Num_22 PendingJobs=“0” status=“-1”>
It max cancel the auto close feature.
I’ve tried using
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetStatus”,{ newStatusValue=“-1” },device)
but it doesn’t seem to do anything…

Additional Information:
Device_Type: urn:schemas-upnp-org:device:BinaryLight:1
XML Schema:
<Device_Num_22 PendingJobs=“0” status=“-1”>











































</Device_Num_22>

When opening:
<Device_Num_22 PendingJobs=“0” status=“4”>


When opened for 30 seconds:
<Device_Num_22 PendingJobs=“0” status=“-1”>


When closing:
<Device_Num_22 PendingJobs=“0” status=“4”>


When closed for 30 seconds:
<Device_Num_22 PendingJobs=“0” status=“-1”>


I’m assuming when I paired this device with my Vera 3 controller that it defaulted to a Binary Switch.
Which set my files to:
Device_File: D_BinaryLight1.xml
Device_JSON: D_BinaryOpenClose1.json

I reached out to the manufacture and they supplied 3 files.

D_TelguardGDC1.json

{
	"default_icon": "garage_door_open.png",
    "state_icons": [
        {
            "img": "garage_door_closed.png",
            "conditions": [
                {
                    "service": "urn:upnp-org:serviceId:SwitchPower1",
                    "variable": "Status",
                    "operator": "==",
                    "value": 0,
                    "subcategory_num": 0
                }
            ]
        },
        {
            "img": "garage_door_open.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": "tabname_control",
				"text": "Control"
			},
			"Position": "0",
			"TabType": "flash",
			"ControlGroup":[
				{
					"id":"1",
					"isSingle":"1",
					"scenegroup":"1"
				},
				{
					"id":"2",
					"isSingle":"1",
					"scenegroup":"1"
				}
			],
			"SceneGroup":[
				{
					"id":"1",
					"top": "1",
					"left": "0",
					"x":"2",
					"y":"1"
				}
			],
			"Control": [
				{
					"ControlGroup":"2",
					"ControlType": "button",
					"top": "0",
					"left": "0",
					"Label": {
						"lang_tag": "cmd_open",
						"text": "Open"
					},
					"Display": {
						"Service": "urn:upnp-org:serviceId:SwitchPower1",
						"Variable": "Status",
						"Value": "1",
						"Top": 60,
						"Left": 145,
						"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": "0",
					"Label": {
						"lang_tag": "cmd_open",
						"text": "Close"
					},
					"Display": {
						"Service": "urn:upnp-org:serviceId:SwitchPower1",
						"Variable": "Status",
						"Value": "0",
						"Top": 60,
						"Left": 50,
						"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": "OPEN",
				"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": "CLOSE",
				"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": "Garage_Door_is_opened_or_closed",
                "text": "The Garage Door is opened or closed"
            },
			"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
			"argumentList": [
				{
					"id": 1,
					"dataType": "boolean",
					"defaultValue": "1",
					"allowedValueList": [
						{
                            "Opened": "0",
                            "HumanFriendlyText": {
                                "lang_tag": "hft_device_opened",
                                "text": "_DEVICE_NAME_ is opened"
                            }
                        },
                        {
                            "Closed": "1",
                            "HumanFriendlyText": {
                                "lang_tag": "hft_device_closed",
                                "text": "_DEVICE_NAME_ is closed"
                            }
                        }
					],
					"name": "Status",
					"comparisson": "=",
					"prefix": {
                        "lang_tag": "which_mode",
                        "text": "Which mode"
                    },
					"suffix": {}
				}
			]
		}
	],
	"DeviceType": "urn:schemas-micasaverde-com:device:GarageDoorController:1",
    "device_type": "urn:schemas-micasaverde-com:device:GarageDoorController:1"
}

D_TelguardGDC1.xml

<?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:GarageDoorController:1</deviceType>
    <staticJson>D_TelguardGDC1.json</staticJson>
	<friendlyName>Telguard GDC1 (UL Listed)</friendlyName>
    <manufacturer>Telguard</manufacturer>
    <manufacturerURL>http://www.telguard.com/GDC1</manufacturerURL>
    <modelDescription>Telguard GDC1</modelDescription>
    <modelName>GDC1</modelName>
    <modelNumber>1.0</modelNumber>
    <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:HaDevice:1</serviceType>
        <serviceId>urn:micasaverde-com:serviceId:HaDevice1</serviceId>
        <SCPDURL>S_HaDevice1.xml</SCPDURL>
      </service>
    </serviceList>
  </device>
</root>

D_TelguardGDC1_bu.json

{
	"default_icon": "garage_door_open.png",
    "state_icons": [
        {
            "img": "garage_door_closed.png",
            "conditions": [
                {
                    "service": "urn:upnp-org:serviceId:SwitchPower1",
                    "variable": "Status",
                    "operator": "==",
                    "value": 0,
                    "subcategory_num": 0
                }
            ]
        },
        {
            "img": "garage_door_open.png",
            "conditions": [
                {
                    "service": "urn:upnp-org:serviceId:SwitchPower1",
                    "variable": "Status",
                    "operator": "==",
                    "value": 1,
                    "subcategory_num": 0
                }
            ]
        }
    ],
	"x":"2",
	"y":"1",
	"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": "0",
					"left": "0",
					"x":"1",
					"y":"1"
				}
			],
			"Control": [
				{
					"ControlGroup": "1",
					"ControlType": "multi_state_button",
					"top": "0",
					"left": "0",
					"states":[
						{
							"Label": {
								"lang_tag": "cmd_open",
								"text": "Opened"
							},
							"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": "open_door"
						},
						{
							"Label": {
								"lang_tag": "cmd_close",
								"text": "Closed"
							},
							"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": "close_door"
						}						
					]
				}
			]
		},
		{
			"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": "OPEN",
				"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": "CLOSE",
				"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": "Garage_Door_is_opened_or_closed",
                "text": "The Garage Door is opened or closed"
            },
			"serviceId": "urn:upnp-org:serviceId:SwitchPower1",
			"argumentList": [
				{
					"id": 1,
					"dataType": "boolean",
					"defaultValue": "1",
					"allowedValueList": [
						{
                            "Opened": "0",
                            "HumanFriendlyText": {
                                "lang_tag": "hft_device_opened",
                                "text": "_DEVICE_NAME_ is opened"
                            }
                        },
                        {
                            "Closed": "1",
                            "HumanFriendlyText": {
                                "lang_tag": "hft_device_closed",
                                "text": "_DEVICE_NAME_ is closed"
                            }
                        }
					],
					"name": "Status",
					"comparisson": "=",
					"prefix": {
                        "lang_tag": "which_mode",
                        "text": "Which mode"
                    },
					"suffix": {}
				}
			]
		}
	],
	"DeviceType": "urn:schemas-micasaverde-com:device:GarageDoorController:1",
    "device_type": "urn:schemas-micasaverde-com:device:GarageDoorController:1"
}