Revert Devices Back to Previous State After a Scene?

Hi Everyone - I’m new to the forum, but have been using my Vera plus for relatively simple automation for the past few years. I have a scene that if a smoke detector detects smoke/activates (I have a Nest Protect and several First Alert ZCOMBOs), my doors unlock, lights turn on and the AC shuts off. Is there a way to have all of the devices return to their previous state once the alarm shuts off (maybe using Reactor in some way I am not thinking of)? In other words, if a light was off pre-alarm, it would turn back off, but if it was on, it would stay on.

I have played around with some very basic luup coding (mostly copying and pasting and replacing variables!), but I am by no means proficient enough to write something from scratch.

Thanks for any help you can offer!

You probably want to look ar reactor or pleg, which are plugins that enhance the logic functions of vera. Reactor has more active support right now, so it’s probably a better choice.

You can define some normal states based on time of day or your current mode (night, day, weekend, holiday, away, etc) so that when the emergency state is over the house becomes “normal” but you won’t be able to get it back to the exact state it was before the emergency.