[OBSOLETE] MyQ Garage Door Device Type

I have an Assurelink and I used the MyQ device type ST_MyQ_Device_Type.groovy, but… I can’t get it working either. I get “Error: An unexpected error occurred” right after I try to set up the preferences. I’m positive the username password and question regarding Assurelink are correct; however, for Craftsman we have a “Places” and door name. I’ve tried every combination of Place - Name, just Name, just place, and even the ID I saw for the gateway in the app. I still just get the error. I’d love to view the debug log in the SmartThings IDE, but I can find absolutely no way of turning on debug-level logging so I can see these logs. HELP!?

I am getting that error pretty often for the last few days for other stuff too.

For the record, I had no troubles adding a Nest via custom device–took like 3 seconds.

Well, eventually a debug log showed up in my Live Logging view and subsequently spat out id’s for a device 47 and 49. I didn’t have the 259 but reading through this thread, there’s an indicator that 47 is also a valid door id. I used that as the door name and it seems to be fine now?! Weird.

Hi, I just installed the MyQ Universal Smartphone Garage Door Controller and I’m receiving the door_not_found error. I think I’ve tried all the different solutions mentioned in the thread (making sure Device Name matches, force quitting the SmartThings app, etc.), but to no avail…

Does anyone have an idea as to something I may have done wrong or another solution? Below is my error:

Name Value
date 2014-12-13 12:35:28.592 PM CST (2014-12-13T18:35:28.592Z)
description Door is door_not_found
deviceId b98cc645-fc8b-408e-898e-6b4ab7384b81
deviceTypeId 273ee395-4df5-413a-a2c0-513e93b33a51
displayed true
eventSource DEVICE
hubId 46ce02fc-17ad-4edd-a66c-3e4480bc5b7c
id cfafc563-82f6-11e4-b36e-22000bc10a02
isStateChange true
isVirtualHub false
linkText Garage Door Opener
locationId 4e2873d5-359a-41db-9b38-60d406c0ea2a
name doorStatus
rawDescription
unixTime 1418495728592
value door_not_found
viewed false

This thread is not showing where you received the code and instructions from scottinpollock and storageanarchy. Any help would be greatly appreciated.

I’ve written my own version of MyQ integration based of @essidle’s codes. I’ve only tested with Liftmaster tho. you can find the codes here. GitHub - copy-ninja/SmartThings_MyQ: Integrate SmartThings with MyQ

Thanks, Jason. However, I ran into the below issue when I tried installing the MyQ.ServiceManager.SmartApp.groovy:

Groovy.lang.MissingMethodException: No signature of method: script1419738721319612435007.page() is applicable for argument types: (java.util.LinkedHashMap) values: [[name:prefLogIn, title:MyQ]] Possible solutions: path(java.lang.Object), wait(), any(), wait(long), main(java.lang.String), main(java.util.List)

Do you know if there is something I need to change in the code?

you need to install ServiceManager.SmartApp in the SmartApp section and GarageDoorOpener.SmartDevice in device type

Once published, go to your phone app and scroll to My Apps, you should see the MyQ logo. Proceed to install that

1 Like

Thanks! Probably should have figured that out myself…

The only issue I have now is that it will only open the garage door and the icon will stay on “Opening”. If I force quit the app and come back in the icon shows as “Closed”, but the garage door is still open and if I click on the icon it will not close. Don’t know if that is anything you can fix, but I thought I would pass along in case you get more questions of the same.

Thanks for all your help with this.

hit refresh or wait a few minutes, the status would change

The app updates and works great. But it does seem to lack some features. I can’t add it as a GarageDoor under Doors & Locks. It does not seem to see. Your app seems to be missing the following

capability “Contact Sensor”
capability “Sensor”
capability “Momentary”
capability “Actuator”

Without these I can’t add them to the automation part of smartthings as it is not recognized as a door for some reason

:edit: I noticed when setting it up as a GarageDoor in Smartthings under doors it does not provide a relay option.
Good job and thanks.

1 Like

Thanks again to everyone who made this happen :smile: After running through 331 posts I was still unable to get this to work at first, being new to the ST platform.

After alot of bouncing around, I found out why mine was not working: when asking if i had a Liftmaster i typed “No” when I should not have input anything, and that broke the Device Type. As soon as I cleared that input field, everything started working. Wish the instructions were updated to reflect a few things. All of the different possible Device IDs became a witch hunt.

For one, the code on the first post is entered as a “Device Type” once you activate your API access at http://graph.api.smartthings.com/login/auth

Dont touch any fields on Device Type, but click the 2nd Tab for entering/pasting the Code. Then you publish “for me” and the Smart Things app on your phone will give you some direction for configuration of the new garage door.

If you have problems, go back to the graph.api website to view the Events / Live logging to see if there are any errors that correlates with the troubleshooting information listed here.

Just want to say thanks to Adam and all others who have helped with this. Got mine to work right away!

Aside from controlling the garage door through the ST app, is anyone automating there garage door or creating any smart apps using it?

Meir

All,

[First post!]

As a learning exercise, I’ve taken @SteveGanz modified Ridiculously MyQ Automated Garage Door and tied it to the recent MyQ Device and SmartApp shared by @CopyNinja to create an updated RAGD. Biggest change was converting to Door Control capabilities. I also intentionally cut it down to remove opening the door on an auto door sensor and closing on internal door closure. These weren’t practical for me and I had concerns of phantom detection (I know they were optional, but I removed them anyway). It now basically closes the door when a presence detector leaves and opens on presence arrival (the use case I wanted).

The only issue I’m having right now is the time to manually open the garage, get in and drive the car to be out of presence range is often quicker than the polling notices the door is open, so it does not close because it believes it is already closed. Debug logging confirms this.

I’m considering a couple of options:

  1. Don’t check if already closed before closing. I suspect the new MyQ Door Device can handle this as an idempotent condition. Haven’t tested this yet, but believe this simple solution is probably best.
  2. Monitor the state for a short period after detecting presence “away” and if it becomes open, then close it. Maybe the “false alarm” period?
  3. Maintaining door state based on the executed actions. I hate this idea, but may use it to trigger the code to look longer at the sensor (i.e. wait out a false “closed”).

My updated code is provided here hoping someone will find it useful.

Apologies if this is out of place, I’m new here. Take it easy on me…

/**
 *  Ridiculously Automated MyQ Garage Door
 *
 *  Author: SmartThings (modified by Steve Ganz for MyQ Garage Door Openers)
 *  Date: 2014-06-06
 *
 * Monitors arrival and departure of car(s) and
 *
 *    1) opens door when car arrives,
 *    2) closes door after car has departed (for N minutes),
 */

definition(
    name: "Automated MyQ Garage Door",
    namespace: "smartthings",
    author: "SmartThings (modified by Steve Ganz and David Hare for MyQ Garage Door Openers)",
    description: "Monitors arrival and departure of car(s) and 1) opens door when car arrives, 2) closes door after car has departed (for N minutes).  Based on Ridiculously Automated Garage Door by SmartThings and modified for MyQ Garage Door Openers.",
    category: "Convenience",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/garage_contact.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/garage_contact@2x.png"
)

preferences {

	section("Garage door") {
		input "doorSensor", "capability.doorControl", title: "Which door Control?"
		input "doorSwitch", "capability.doorControl", title: "Which door Control?"
		input "openThreshold", "number", title: "Warn when open longer than (optional)",description: "Number of minutes", required: false
	}
	section("Car(s) using this garage door") {
		input "cars", "capability.presenceSensor", title: "Presence sensor", description: "Which car(s)?", multiple: true, required: false
	}

	section("False alarm threshold (defaults to 10 min)") {
		input "falseAlarmThreshold", "number", title: "Number of minutes", required: false
	}
}

def installed() {
	log.trace "installed()"
	subscribe()
}

def updated() {
	log.trace "updated()"
	unsubscribe()
	subscribe()
}

def subscribe() {
	log.debug "present: ${cars.collect{it.displayName + ': ' + it.currentPresence}}"
	subscribe(doorSensor, "door", garageDoorContact)
	subscribe(cars, "presence", carPresence)
}

def doorOpenCheck()
{
	final thresholdMinutes = openThreshold
	if (thresholdMinutes) {
		def currentState = doorSensor.doorState
		log.debug "doorOpenCheck"
		if ((currentState?.value == "open") || (currentState?.value == "opening")) {
			log.debug "open for ${now() - currentState.date.time}, openDoorNotificationSent: ${state.openDoorNotificationSent}"
			if (!state.openDoorNotificationSent && now() - currentState.date.time > thresholdMinutes * 60 *1000) {
				def msg = "${doorSwitch.displayName} was been open for ${thresholdMinutes} minutes"
				log.info msg
				sendPush msg
				state.openDoorNotificationSent = true
			}
		}
		else {
			state.openDoorNotificationSent = false
		}
	}
}

def carPresence(evt)
{
	log.info "$evt.name: $evt.value"
	// time in which there must be no "not present" events in order to open the door
	final openDoorAwayInterval = falseAlarmThreshold ? falseAlarmThreshold * 60 : 600

	if (evt.value == "present") {
		// A car comes home

		def car = getCar(evt)
		def t0 = new Date(now() - (openDoorAwayInterval * 1000))
		def states = car.statesSince("presence", t0)
		def recentNotPresentState = states.find{it.value == "not present"}

		if (recentNotPresentState) {
			log.debug "Not opening ${doorSwitch.displayName} since car was not present at ${recentNotPresentState.date}, less than ${openDoorAwayInterval} sec ago"
		}
		else {
			if ((doorSensor.currentDoor == "closed") || (doorSensor.currentDoor == "closing")) {
				openDoor()
				sendPush "Opening garage door due to arrival of ${car.displayName}"
				state.appOpenedDoor = now()
			}
			else {
				log.debug "door already open"
			}
		}
	}
	else {
		// A car departs
		if ((doorSensor.currentDoor == "open") || (doorSensor.currentDoor == "opening")) {
			closeDoor()
			log.debug "Closing ${doorSwitch.displayName} after departure"
			sendPush("Closing ${doorSwitch.displayName} after departure")
		}
		else {
			log.debug "Not closing ${doorSwitch.displayName} because its already closed.  State: ${doorSensor.currentDoor}"
		}
	}
}

def garageDoorContact(evt)
{
	log.info "garageDoorContact, $evt.name: $evt.value"
	if ((evt.value == "open") || (evt.value == "opening")) {
		schedule("0 * * * * ?", "doorOpenCheck")
	}
	else {
    	state.openDoorNotificationSent = false   // reset door notification state.
		unschedule("doorOpenCheck")
	}
}


private openDoor()
{
	if ((doorSensor.currentDoor == "closed") || (doorSensor.currentDoor == "closing")) {
		log.debug "opening door"
		doorSwitch.open()
	}
}

private closeDoor()
{
	if ((doorSensor.currentDoor == "open") || (doorSensor.currentDoor == "opening")) {
		log.debug "closing door"
		doorSwitch.close()
	}
}

private getCar(evt)
{
	cars.find{it.id == evt.deviceId}
}

Any update on this? Hoping for official support soon.

2 Likes

Hi All… first post, great work being done on here! I’m having a problem that I have seen on this forum before, but the fixes mentioned aren’t working for me. I keep getting device not found. After reading this post I thought for sure it was because I wasn’t using the correct device ID, so I confirmed it in the logging and still no joy. I’m sure it’s something simple I’m overlooking. Any help with this brain fart would be appreciated.

72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:41 AM: error java.lang.NullPointerException: Cannot invoke method toLong() on null object @ line 314
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:41 AM: debug Unknown Door Status ID: null
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:41 AM: debug API Error: [ReturnCode:109, ErrorMessage:Device does not exist.]
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:40 AM: debug Sec Token: FeboDaVtoYVg/MrvEqs0yGA229XO84TAMW9eudl8LSJfnN+xNmB+78G/yygIf4aKoF5iLP0iBKjkL36tlALPvA==
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:39 AM: debug Logging In to Webservice
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:39 AM: debug Refreshing Door State
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:39 AM: debug MyQ Garage door Polling
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:23 AM: error java.lang.NullPointerException: Cannot invoke method toLong() on null object @ line 314
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:23 AM: debug Unknown Door Status ID: null
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:23 AM: debug API Error: [ReturnCode:109, ErrorMessage:Device does not exist.]
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:23 AM: debug Sec Token: WKpvOtLUezWcJTddtxej5QswmIvgtRws623hkCPzWObFA1A/qMe8U93yokOEWJI1afXy32fAamhIe4Sj1yfZzw==
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:22 AM: debug Logging In to Webservice
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:22 AM: debug Refreshing Door State
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:08:22 AM: debug MyQ Garage door Polling
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:07:16 AM: error java.lang.NullPointerException: Cannot invoke method toLong() on null object @ line 314
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:07:16 AM: debug Unknown Door Status ID: null
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:07:16 AM: debug API Error: [ReturnCode:109, ErrorMessage:Device does not exist.]
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:07:16 AM: debug Sec Token: lhcNZxSeti9IIFt6kCCVfgEmHLRaDfVbcytrfm59Prjpj1iUAH9wvWGQSUrVgvGP6gzkrdur0D5/KjTLKvRBkA==
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:07:15 AM: debug Logging In to Webservice
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:07:15 AM: debug Refreshing Door State
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:07:15 AM: debug MyQ Garage door Polling
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:05:39 AM: error java.lang.NullPointerException: Cannot invoke method toLong() on null object @ line 314
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:05:39 AM: debug Unknown Door Status ID: null
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:05:39 AM: debug API Error: [ReturnCode:109, ErrorMessage:Device does not exist.]
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:05:39 AM: debug Sec Token: gDLPcAhu1YMz50TlOgWUmDjG7NhsmMg4Kg9iMVnWzpvdYkhbGgE8M6vx6lAdxPEfM0TIjtveh28MKsaMunbebA==
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:05:38 AM: debug Logging In to Webservice
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:05:38 AM: debug Refreshing Door State
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:05:38 AM: debug MyQ Garage door Polling
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:08 AM: debug Device Discovery found no supported door devices
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:08 AM: debug Device Discovered: Type ID: 49, Device Name: garage1, Device ID: 201750443
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:08 AM: debug Device Discovered: Type ID: 259, Device Name: Garage Door Opener, Device ID: 50617646
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:07 AM: debug Getting MyQ Devices
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:07 AM: debug Sec Token: VDP9aG2X/afQHoGwc/xDUJ55UpDB5XZnyTAmI9WRn62LA2rCrXn4CbMTEcJg75+u6iCa19jJ5mQA+vpOjCVwww==
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:05 AM: debug Logging In to Webservice
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:05 AM: debug Updating MyQ Garage Door
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:05 AM: debug Device Discovery found no supported door devices
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:05 AM: debug Device Discovered: Type ID: 49, Device Name: garage1, Device ID: 201750443
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:05 AM: debug Device Discovered: Type ID: 259, Device Name: Garage Door Opener, Device ID: 50617646
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:03 AM: debug Getting MyQ Devices
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:03 AM: debug Sec Token: s7FdLYPZc39xwQfT0F21KkIlj0xoY4xX/BPoiMADMrMWHMkdCPnswaP9LLbN5sXeiQ5S/YrBqUAYsY3dybADhw==
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:02 AM: debug Logging In to Webservice
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:01:02 AM: debug Updating MyQ Garage Door
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:00:36 AM: error java.lang.NullPointerException: Cannot invoke method toLong() on null object @ line 314
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:00:36 AM: debug Unknown Door Status ID: null
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:00:36 AM: debug API Error: [ReturnCode:141, ErrorMessage:The attribute named [doorstate] is not defined in device type [Gateway]]
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:00:35 AM: debug Sec Token: wejX1F21zDZgLm9t3FqsNirJ4SkLheR1zmSo+DmnJ9lqE6IsZnzrTcgI1KJdLyK5zF0IWtE9V0EE6f9FjxIW4w==
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:00:34 AM: debug Logging In to Webservice
72c1aaef-f6ac-4c4f-90b1-2228861fabaf 10:00:34 AM: debug Refreshing Door State

Try “50617646” or using the name as “Garage Door Opener”

Thanks @copyninja ! Using the name didn’t work, but the device ID worked like a charm. Very much appreciated :slight_smile: