Saving additional entity state information

I have a basic light switch that controls a pool light. To change colors you turn the light on/off a certain number of times. I can easily script that but i want to save the name of the color that was last selected which will always show up in the card regardless if the light is on/off.

How do i save a text value specific to an entity that can persist beyond HA restarts and any other events? Do i need to install a mini-sql db or something like that?

If it’s just one or two entities you need this for, use an input_text helper set by an automation.

Its just a single entity and I will want to pass this value along to a script. I see i can pass it along to an automation so i may need that to call a script. But this seems like the perfect solution as it persists the value across HA restarts just like i’m looking for.

Thank you!