New smart app to link the virtual/simulated garage door device with two actual devices

Found problem it’s not going down 111 and 123 lines for some reason there not equaling true

Update 111 to
if(sensoropen == “${evt.device}”){
And 122 to
if(evt.device == “$sensor”){

See which line works. You should see a debug line saying fully open/close

Try these lines

I get the below red error message when trying to update line 111

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
script_app_metadata_f052f9f3_6438_43ce_9fb8_d2d0d2d29af7: 111: expecting ‘)’, found ‘”’ @ line 111, column 37.
if(sensoropen == “${evt.device}”){
^

1 error

Type the speechmarks copy and paste doesn’t work. Make sure you get the dollars as well

Ok i typed it but am still getting the same issue. Will post the logs in a few

It’s still not doing the if properly try
Ln108
def condev = evt.device

Then
Update 111 to
if(sensoropen == condev){
And 122 to
if(sensor == condev){

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 12:24:54 PM: trace contactHandler - ‘ZZ Gate sensor Closed contact’ is ‘closed’ - virtual contact is 'open’and door is ‘closing’

What is going on with The above? contact is closed but the virtual contact is open and the door is closing?

So its sensing that the door is closed and showing as much but it is saying the virtual contact is still open? maybe this is the issue? after this line it just stops and waits till the checkif.

does thesre need to be a step to update vitual device from physical device once status changes?

You are also clicking publish once you have updated the code?

Thanks Mark I really appreciate the help! I’ll add this in and then report back. Hope you enjoy the rest of your weekend.

Thanks,

MARK!!! YOU DID IT! It looks like it worked.

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:48 AM: trace virtualgdcontactHandler - closed

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:48 AM: info virtual gd event Contact/DoorState = Gate - contact - closed

c4bca0cf-a0ba-4004-a90a-85c908e786a7 8:10:48 AM: debug motionOrContactHandler(Gate contact:closed)

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:48 AM: trace virtualgdcontactHandler - closed

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:48 AM: info virtual gd event Contact/DoorState = Gate - door - closed

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:45 AM: trace contactHandler - ‘ZZ Gate sensor Closed contact’ is ‘closed’ - virtual contact is 'open’and door is ‘closing’

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:45 AM: debug closed sesnor is closed so gate is fully closed

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:45 AM: debug fully closed sensor

2c1d8bd9-64c3-4177-bfe6-78901c5c4423 8:10:45 AM: debug close = closed

c4bca0cf-a0ba-4004-a90a-85c908e786a7 8:10:45 AM: debug motionOrContactHandler(ZZ Gate sensor Closed contact:closed)

0a0e993c-3632-48a8-a818-efefd6ba4d4c 8:10:25 AM: debug Parse returned Zz Gate Switch switch is off

0a0e993c-3632-48a8-a818-efefd6ba4d4c 8:10:25 AM: debug Parse returned Zz Gate Switch switch is off
d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:23 AM: trace contactHandleropen - ‘ZZ Gate sensor Open contact’ is ‘open’,virtual contact is ‘open’ and door is ‘closing’, ‘sending open command’

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:23 AM: info contactHandleropen ‘ZZ Gate sensor Open’ it is ‘open’

2c1d8bd9-64c3-4177-bfe6-78901c5c4423 8:10:23 AM: debug close = closing

2c1d8bd9-64c3-4177-bfe6-78901c5c4423 8:10:23 AM: debug close = closing

c4bca0cf-a0ba-4004-a90a-85c908e786a7 8:10:22 AM: info SHM isActiveSensor(contact:open, app: off, location: off) = false, locationId: 8ac4d931-effd-4b82-a867-46c3ead0c7dc, ISA: c4bca0cf-a0ba-4004-a90a-85c908e786a7

c4bca0cf-a0ba-4004-a90a-85c908e786a7 8:10:22 AM: debug motionOrContactHandler(ZZ Gate sensor Open contact:open)

0a0e993c-3632-48a8-a818-efefd6ba4d4c 8:10:22 AM: debug Parse returned Zz Gate Switch switch is on

0a0e993c-3632-48a8-a818-efefd6ba4d4c 8:10:22 AM: debug Parse returned Zz Gate Switch switch is on

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:21 AM: trace virtualgdcontactHandler - sending close command to Zz Gate Switch the actual garage controler

d6c02cf3-8757-4c82-8aff-0f52db7e33d5 8:10:21 AM: info virtual gd event Contact/DoorState = Gate - door - closing

2c1d8bd9-64c3-4177-bfe6-78901c5c4423 8:10:21 AM: debug close = null

Yes ill have to do that when i get home tonight

Seriously i have been just sitting at work opening and closing the gate watching it on my Nest cameras and smiling every time it opens and tells me its open and then closing it and doing an evil laugh every time!

Seriously this is awesome… Thank you for all of your hard work on this I know it wasn’t easy!

BTW this is the gate you automated below. It is strictly to keep my 2 year old boy in the front yard so my wife and I don’t have to chase him around the neighborhood.

Yes the warning text works when it doesn’t open or close all the way! This is awesome thank you sir!

Nice!!

There seriously isn’t anything for gates out there I looked and looked for days and no one had anything so this is huge for my wife and I. Now to set it up for location routines to open when I get home and close if I push the house panic buttons.

Thank you!

DH code for Icons:

tiles {
standardTile(“toggle”, “device.door”, width: 2, height: 2) {
state(“closed”, label:’{name}', action:"door control.open", icon:"https://raw.githubusercontent.com/Stills00/SmartThingsPublic/master/Gate%20Closed%20Small.png", backgroundColor:"#e86d13", nextState:"opening") state("open", label:'{name}’, action:“door control.close”, icon:“https://raw.githubusercontent.com/Stills00/SmartThingsPublic/master/Gate%20Open%20Small.png”, backgroundColor:"#00A0DC", nextState:“closing”)
state(“opening”, label:’{name}', icon:"https://raw.githubusercontent.com/Stills00/SmartThingsPublic/master/Gate%20Opening%20Small.png", backgroundColor:"##00A0DC") state("closing", label:'{name}’, icon:“https://raw.githubusercontent.com/Stills00/SmartThingsPublic/master/Gate%20Closing%20Small1.png”, backgroundColor:"#e86d13")

	}
	standardTile("open", "device.door", inactiveLabel: false, decoration: "flat") {
		state "default", label:'open', action:"door control.open", icon:"https://raw.githubusercontent.com/Stills00/SmartThingsPublic/master/Gate%20Opening%20Small.png"
	}
	standardTile("close", "device.door", inactiveLabel: false, decoration: "flat") {
		state "default", label:'close', action:"door control.close", icon:"https://raw.githubusercontent.com/Stills00/SmartThingsPublic/master/Gate%20Closing%20Small1.png"
	}
	standardTile("refresh", "device.refresh", inactiveLabel: false, decoration: "flat") {
  		state "refresh", action:"polling.poll", icon:"st.secondary.refresh"
  	}
	main "toggle"
	details(["toggle", "open", "close", "refresh"])

Smart App code for prompts to change it to Gate instead of Garage Door:

preferences {
section(“Choose the switch/relay that opens/closes the Gate”){
input “opener”, “capability.switch”, title: “Physical Gate Switch”, required: true
}
section(“Choose the switch/relay that CLOSES the Gate… if different”){
input “closer”, “capability.switch”, title: “Physical Gate Switch for Close… optional dual switch”, required: false
}
section(“Choose the sensor that senses if the Gate is closed”){
input “sensor”, “capability.contactSensor”, title: “Physical Gate fully Closed Contact Sensor”, required: true
}
section("Choose the sensor for OPEN… optional "){
input “sensoropen”, “capability.contactSensor”, title: “Physical Gate fully Open Contact Sensor … optional dual sensors”, required: false
}

section("Choose the Virtual Garage Door/Gate Device "){
	input "virtualgd", "capability.doorControl", title: "Virtual Garage Door/Gate Device", required: true
}

section("Choose the Virtual Garage Door/Gate Device sensor ... same as above device ... yes you need to do it twice"){
	input "virtualgdbutton", "capability.contactSensor", title: "same as above device", required: true
}

section("Timeout before checking if the Gate opened or closed correctly?"){
	input "checkTimeout", "number", title: "Gate Operation Check Timeout?", required: true, defaultValue: 25
}

 section( "Notifications" ) {
    input("recipients", "contact", title: "Send notifications to") {
        input "sendPushMessage", "enum", title: "Send a push notification?", options: ["Yes", "No"], required: false
        input "phone1", "phone", title: "Send a Text Message?", required: false
    }
}

}

Relased, this should be final version, two DH’s one for a gate and one for a garage door and APP capable of using one or two open/close switches and one or two open close sesnors.
APP


Gate DH

Garage DH

@Lgkahn: Hi Larry, wanted to let you know that I implemented the app successfully and thank you for posting it. In my setup I use the MIMO as a switch and the Ecoklink tilt sensor.

To get Alexa compatibility I creased custom voice commands since saying “Alexa turn on garage door” got old fast. Also, made some minor changes to the code so that I did not get too many push notifications, pretty much commented out the lines that send you a push message when I open the door manually.

Thanks again,
Sandro