Garage Door Control after v2?

Okay guys… I upgraded to Hub 2.0 a couple of days ago. I think this should work as a solution… it’s a very simplistic SmartApp, but it should work… at least it does for me.

You need to change the Multi-Sensor to SmartSense Garage Door Sensor Button in the IDE, then install the following program. Just input the sensor and the associated relay/switch and then tapping the SmartSense Garage Door Sensor Button will trigger the relay or switch.

(If you’re using a switch/outlet – like me – you’ll want to setup an automation in Smart Lights that turns off the outlet as soon as it’s turned on so it’s ready to be trigger the next time you need it.)

/**
 *  Virtual Garage Triggers Outlet
 *
 *  Author: chrisb
 */

// Automatically generated. Make future change here.
definition(
    name: "Virtual Garage triggers outlet",
    namespace: "sirhcb",
    author: "ChrisB",
    description: "Tapping a SmartSense Virtual Garage Sensor Button triggers and outlet connected to a relay to open/close a garage door, and then shuts off the outlet after 4 seconds.",
    category: "My Apps",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience%402x.png",
    oauth: true)

preferences {
	section("When a Virtual Garage Door is tapped..."){
		input "GarageSensor1", "capability.contactSensor", title: "Which?"
	}
	section("Trigger which outlet?"){
		input "switches", "capability.switch"
	}
}


def installed()
{
	subscribe(GarageSensor1, "buttonpress.true", contactOpenHandler)
}

def updated()
{
	unsubscribe()
	subscribe(GarageSensor1, "buttonpress.true", contactOpenHandler)
}

def contactOpenHandler(evt) {
	log.debug "$evt.value: $evt, $settings"
	log.trace "Turning on switches: $switches"
	switches.on()
}
2 Likes