Question about automations

Hello,

Im wondering if its possible to do automation that does something and then changes back to what it was.

I do have several different scenes in my room for lights.
So if i have “nightmode scene” on and one of my alert lights goes red for moment, how do i change it back to what it was?

I know i could just do another automation that goes to some specified scene but its not what it was.

Somehow all scenes should write to some modifier what scene i was using or something.

Any ideas?

I wrote a couple of python_script’s that can save and restore a set of switches and/or lights. You might be able to use them. E.g., whatever turns the alert light to red would first use the script to save that light’s current settings. Then, whatever decides that light should go back the way it was would use the restore script.