Simulated Gate Opener

I have a gate controller that uses a simple momentary contact closure to open and close the gate. The reversing mechanism is mechanical. With each contact closure the gate reverses direction going from open to closed to open, etc. I am using a MIMOlite relay to activate the gate controller. I have added a Z-wave door / window sensor to tell me if the gate is currently open or closed. What I need is a way to integrate the these two devices into a single simulated gate control device. I would then set up two routines: Open Gate and Close Gate. Open Gate would generate a contact closure IF the gate sensor indicates the gate is currently closed and do nothing if was already open. Same scenario to close an open gate. Any ideas?

1 Like

Sorta…

Create a new smartapp and use this code:

/**
 *  GarageGate OpenClose Control
 *
 *  Copyright 2015 Chris B
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 */
definition(
    name: "GarageGate OpenClose Control",
    namespace: "sirhcb",
    author: "Chris B",
    description: "Fine control of a Garage or Gate.",
    category: "",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")

preferences {
	section("Which Virtual Switch is the Close Trigger?") {
		input "triggerC", "capability.switch", title: "Which?"
	}
	section("Which Virtual Switch is the Open Trigger?") {
		input "triggerO", "capability.switch", title: "Which?"
	}
	section("Which door sensor should I check?"){
		input "door", "capability.contactSensor", title: "Which?" 
    }
    section("Which outlet/relay controls the Garage?"){
		input "outlet", "capability.switch", title: "Which?"
    }
}

def installed() {
	log.debug "Installed with settings: ${settings}"

	initialize()
}

def updated() {
	log.debug "Updated with settings: ${settings}"

	unsubscribe()
	initialize()
}

def initialize() {
	switchesOff()
    subscribe(triggerC, "switch.on", garageClose)
	subscribe(triggerO, "switch.on", garageOpen)  
}

def switchesOff() {
	triggerC.off()
    triggerO.off()
}


def garageClose(evt) {
	//check if door is open
	if (door.currentContact == "open") {
		//if the door is open, then turn on the relay to close.  Otherwise, do nothing.
        outlet.on() 
    }
    //Turn off the virtual tiles.
    runIn (10, switchesOff)
}

def garageOpen(evt) {
	//check if door is closed
	if (door.currentContact == "closed") {
		//if the door is closed, then turn on the relay to open.  Otherwise, do nothing.
       	outlet.on()
    }
    //Turn off the virtual tiles.
    runIn (10, switchesOff)
}

You’ll also need to create two virtual tiles, one to act as the Open Gate Trigger, one to act as the Close Gate Trigger.

After you’ve done that install this app and select the triggers, the sensor, and the relay that you’re using to open/close the gate.

Then have your routines turn the Open or Close trigger. The app will check if the gate is open or closed and then act appropriately.

1 Like

I am in a very similar situation. I have gates that open by momentary push of a button. My gates close on their own after 15 seconds. Hence, all I am looking for is some type of device to integrate with ST to open the gate for me.

Any dry contact relay would work for this purpose. (The dry contact means that whatever signal/wpoer is pushed to trigger the relay… that same signal/power does not “leak” through to the circuit that the relay is turning on.

Evolve, and Remotec both have nice z-wave relays that will do this. Back when I setup my garage doors most z-wave relays were pretty expensive so I actually “made” a z-wave relay by buying a cheap relay at Radio Shack, using some old plugs from past computer equipment and a z-wave outlet.

You can also use my virtual garage door smartapp
I believe it would work New smart app to link the virtual/simulated garage door device with two actual devices