You guys can check out this thread for some more info Arduino Online/Offline Override - #17 by noriel.instructor
CAYENNE_CONNECTED() and CAYENNE_DISCONNECTED() are both available for you as functions that run on those events. In there you can set pins high/low, send an email, etc. I haven’t personally tested it, but from the others in the thread it should work. Let me know if you need any more help!