Error on runIn()

Hi Guys,

As stated as this doc -> http://docs.smartthings.com/en/latest/ref-docs/smartapp-ref.html#runin

i tried to run the examble but i got this error…

groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method physicalgraph.scheduling.SchedulerFactory#getSchedulerForRunIn.
Cannot resolve which method to invoke for [null, class java.lang.Integer, class java.util.LinkedHashMap] due to overlapping prototypes between:
[class physicalgraph.app.InstalledSmartApp, int, interface java.util.Map]
[class physicalgraph.device.cache.DeviceDTO, int, interface java.util.Map]

Anyone know why?

Hi @Cety, I’ll take a look at this today.

Can you provide more context for this? Please provide at least the line where you are calling runIn() and the handler method definition. Even better, create a gist of the whole SmartApp and link to it. Thanks!

Hi Jim,

Here’s the context…

preferences {
section(“Title”) {
// TODO: put inputs here
}
}

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

initialize()

}

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

unsubscribe()
initialize()

}

def initialize() {
// TODO: subscribe to attributes, devices, locations, etc.
}

// TODO: implement event handlers

runIn(300, myHandlerMethod)
runIn(400, “myOtherHandlerMethod”)

def myHandlerMethod() {
log.debug “handler method called”
}

def myOtherHandlerMethod() {
log.debug “other handler method called”
}

Basically I just copy paste from http://docs.smartthings.com/en/latest/ref-docs/smartapp-ref.html#runin
to new App.

I want to execute runIn() method in interval without any action triggered.

Looks like you have the runIn() calls outside of a method. Place them inside your initialize() block and it should work.

Thanks, It works :smile: