Question.... I am trying to figure out why a driver is not initializing after a reboot as expected.
So I stuck some debug logging as well as a scheduled runIn in there. After a reboot I don't see either happen, and I can't figure out why.
Here is what is in the driver right now. I get ZERO logs after a reboot, and the scheduled task is never scheduled - making me thing initialize isn't actually running for some reason after a reboot???
def initialize() {
log.debug "----- IN INITIALIZE -----"
log.debug "----- IN INITIALIZE -----"
pauseExecution(1000)
log.debug "----- IN INITIALIZE -----"
runInMillis(5000, heartbeat)
}
def updated() {
log.debug "----- IN UPDATED -----"
}
won't be much consolation but I stumbled upon the need for capability initialize only a week or so ago... so I barely beat you at removing my dunce cap.
I've had this set of hints in my "Templates" for years...
/**
mike.maxwell (Leader)
May 25, 2018
installed() - runs when driver is installed, via pair or virtual
configure() - runs when driver is installed, after installed is run. if capability Configuration exists, a Configure command is added to the ui
initialize() - runs first time driver loads, ie system startup when capability Initialize exists, a Initialize command is added to the ui.
updated() - runs when save is clicked in the preferences section
Initialized() is not a capability or built in driver command, it's a local method only, I've never understood it either, i guess it saves a few lines of duplicate calls...
**/
You can usually do that by changing the device type to "Device" and then clicking on each delete command button, then set it back to whichever driver you need.