Help with creating local fallback safe

HEY! I have build an aquarium controller with arduino, relay and temp sensor ,for now. Some relay control heaters, the heaters are coming on base on temp provided by sensor and lights base on time. All project is working with cayenne. I am very new to coding, the problem is in case the servers or internet are not working. How can I make arduino to follow a local code, like, if cayenne offline do this…? Any help will be much appreciate!

I went to go find the thread that has the code, but when I found it I saw posted over there as well. Give a shout if you need any help!