Save state of automation after restart of HA

Hey there
I have several automations that control certain devices with PV surplus.
Bassically there is 1 automation for every device. If there is enough PV power the device is turned on, otherwise its turned off.
Problem with these automations is, they need to be turned on, when HA starts.
So if 1 automation os turned off (because I dont want the device to be “sun controlled” at the moment), it will not work, when I restart HA - because the automation was off, when HA starts up.
This is annoying, when u install updates, because you always have to turn on the automations, and turn it off after HA has rebootet.
Im looking for a way to save the automations state, and turn it on, when HA shuts down.
After restarting the saved states should apply again.
The only way I got for this, is creating an input boolean helper for every automation.
Is there a smarter way to do so?

Don’t turn your automations off.

Use conditions instead.

This is not possible, as its a blueprint

Put the condition in your blueprint.

I still think its not possible, because it launches some pyscript code.
https://github.com/InventoCasa/ha-advanced-blueprints/tree/main/PV_Excess_Control

But anyway. Using a condition in my case would mean, using an input boolean for every automation and not turning off the automation, but the boolean.
Then creating a helper for every automations state at reboot might be easier anyway.

If the pyscript is just turning on/off something, you can easily have it turn on/off an input boolean and use that as a condition.