Sure just do it using CAYENNE_CONNECTED(){} function and making and if statement with Cayenne.run() inside. If you don’t know how to do it, just tell me.
I have a project where I made a couple simple modifications to the cayenne library to identify if it was online or not which works well. You could probably start a timer when it goes offline that basically excludes the cayenne.run() for a specified amount of time. Let me see if I can find the post I used to do that.