Wemo Devices going offline. Device Handler solution>>>

So most, if not all, are aware that if you install Wemo Connect app, that from time to time the devices will go offline. While the smartapp Polster does improve the situation, neither its polling nor refresh options guarantee the offline device will come back online. One thing that if guaranteed to bring the offline Wemo back online is the “Refresh” button found within the SmartThings app/Things/devicename option. So… It occurred to me that modifying the device handler to simulate the button press would be a good solution to this problem. I modified the ST provide device handler “Wemo Light Switch” and added the following lines to the refresh() function

def refresh() {
// Added the next two line
def refreshSec=(refreshMinutes * 60).toInteger()
runIn(refreshSec , refresh)
//
log.debug “Executing WeMo Light Switch ‘subscribe’, then ‘timeSyncResponse’, then ‘poll’”
[subscribe(), timeSyncResponse(), poll()]
}

While refresh() is called every seconds and the log confirms all the functions [subscribe(), timeSyncResponse(), poll()] are called at such time, it does not work.There is a difference between this “auto-refresh” versus actually pressing the refresh button. In the latter additional code is executed. I can not for the likes of me figure how this difference occurs.

I added log.debug statements to each function in the device handler to get a sense of what happened when the button was pressed versus the auto-timed-refresh. There appears to be no set way the former executes. Obviously there is logic at play here that my modification the the handler is missing.

Can anyone explain or provide direction on how I can duplicate this “Refresh” button press??

Much appreciated.

1 Like

No one?? …