Return lights/music to the state they were before an automation - help

For certain automatons, warnings etc, I want to play a sound or turn lights to a particular colour eg red, for the during of the automation but then everything go back to its original state - so the lights back to the colour/state they were before the automation.

What would be the best way to do this, please?

Depends on if your device/entity supports it you can dynamically snapshot a scene and then apply that snapshot after you perform your actions.

For lights and such it works pretty reliably. You’ll probably have to handle your media separately

Looks at the documentation for Scene on HAs website.