Execute(call) a Handler

I seem to have a hard time finding my questions searching the documintation and community . So here is another one.

After a runIn() finishes I’m changing the value of an atomicState then i need to run a different handler. What needs to go in front of it so it will be called?

if(tmode == "heat" && tstate == "idle" && atomicState.heatrunning == true)
  runIn(120, heatstoppedHandler)
  log.debug "Heat Stop timer started"

def heatstoppedHandler() {
atomicState.heatrunning = false
??? (mainControlHandler)

I’m not making an endless loop I just need the handler to run through once more.

I might be misunderstanding your question, but if you’re just trying to call a method to execute immediately, you should just need to call it.


Thanks that did it. When it call the handler it gave this debug in the log

2:36:19 PM: debug mainControlHandler called: null

guessing that is normal?

That’s a debug line generated by your code. Is there a line in mainControlHandler that looks something like this?

log.debug "mainControlHandler called: ${x}"

The only potentially troublesome thing is that it’s showing null for whatever x is. But maybe that’s ok. Depends on what you’re doing.

Yep makes sense now. Normal it doesn’t say null but guessing that is because it normally starts because it was subscribe() and that info is from that.