runEvery1Minute and def installed

I'm trying to sense when a device has stopped responding. I planned on using runEvery1Minute(someMethod). I am using a state variable that is reset in the parse method.

I thought the best way to initialize this method was to put it into the "def installed" method of the DH. However "def installed" doesn't seem to run. Even if I change the device handler from what it is to "device" then back, def installed log.debug statement is not run based on monitoring the live log.

I though def installed when the DH is assigned to a device (and saved) perhaps I'm wrong.

When does "def installed" run?

Where should I put the runEvery1Minute(someMethod)?

I read an earlier post that suggest that I may have to go to 5 minutes but as of now I can't get the method to run at all.

thanks
John

Installed only runs when the device is installed. Updated runs when preference section save is clicked.

@mike.maxwell

Thank you.

Is there an issue created if the runEvery1Minute(something) is run multiple times?

It would seem like runEvery1Minute would go "forever" or until stopped. What else could stop it from running? (hub reboot, firmware update etc)

It will never stop. And will restart on hub boot

1 Like