I have a smart app that subscribes to a switch. When the switch is open I do something. Then I want to check a few minutes later to see if the switch is still open and if so do something else. There are several switches involved.
So what I am trying to do is pass the current switch info to my timed subroutine like this:
def handler(evt) {
do something
runIn(time, timehandler(evt))
}
def timehandler(evt){
do something
}
But it appears I can’t pass the evt? Is there another way to do this?
Problem with that method, if a different contact is open after the time delay I get something true when it’s not.
I solved the problem by storing the current contact name, then in the time handler iterate thru all the contacts and if the open matches the name then it’s true.
I just thought it would be nice to pass the evt itself, but apparently that is not possible.
Sorry, it wasn’t clear as to what your intent was for the multiple devices. I drew the assumption that they were to be treated as a group performing a group action.