Nice write up @pihydro.0001 . I will be linking many people to this post.
wow, this is something new. Now we can have a push button on cayenne. you could have also done this from code by sending back OFF to the button.
this is because when you are in infinte loop of another script, it stops the main cayenne code. thus making the device offline.
waiting to see a complete working solution.