I get the “Scheduled action in 1 minutes” message in the log but I never get the message from within takeAction(). BTW maxOpenTime is set to 1.
Is this supposed to work in the Simulator environment ?, if yes, what could I be doing wrong?, any debugging help would be appreciated.
I tested a bit more and found out that for values of 30 seconds and lower it fires, 40 seconds and higher it does not. I haven’t figured out the exact cut off between 30 and 40 seconds where it starts to fail.
This is a bug, I’m hoping this is only a simulator issue and is not a problem on the Hub. Can anyone confirm this?
Also, is there a work around?
BTW: here’s a simple app to test this out…
/**
* Garage Door Monitor
*
* Author: SmartThings
*/
definition(
name: "Test RunIn",
namespace: "smartthings",
author: "SmartThings",
description: "Test RunIn",
category: "Safety & Security",
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("When the door is open...") {
input "contsensor", "capability.contactSensor", title: "Which?"
}
}
def installed()
{
subscribe(contsensor, "contact.open", contactHandler)
}
def updated()
{
unsubscribe()
subscribe(contsensor, "contact.open", contactHandler)
}
def contactHandler(evt) {
log.debug "Scheduling takeAction"
runIn(30, takeAction) //vary the number to test out where it fails
}
def takeAction(){
log.debug "Running takeAction"
}