Saving groups item states

Hi everybody,
so heres what I’m trying to achieve:
I want to make a group of lights blink and after that each light takes the state it had before again.
The blinking works fine. The looping through items as well. The problem I have is saving the state of the lights. I would need something like a dynamic variable,
In PHP I would create an array with the lights name as a key and the state as a value.
How can I do it here?
Thanks and best regards

Bit like these

I didn’t find those threads. Perfect, storeStates() and restoreStates() did the trick. Thanks :slight_smile: