Mediaplayer: get state and set it back in a automatiom after a tts message

Hi all,
I use my Sonos (tts.google_translate_say) to alert my home about bad air in the living room.

Problem:
My Sonos is playing music or radio.
After the alert message was announced I like to switch back to the status of the mediaplayer before the automation was triggered and getting back to the old Mediaplayer status.

My Question:
how I can switch back to the old status of the mediaplyer?

Check out the snapshot section of the sonos docs, I think this is what you are looking for.

many thanks @Burningstone this is exactly what I am looked for.
works perfectly.