Power saving mode for emergency power & scene usage

Hi All,

within my home I am having an emergency power battery.
As soon as the grid power is off, the power supply is seamlessly covered by my emergency battery and a corresponding state is visible within Home Assistant.
I have now created an “energy saving” automation which first creates a scene on the fly of a lot of entities (including automations, heaters/climate, media_player, switches, vacuums etc.etc.) and afterwards turns off most of them as they are “nice to have”, but not essential.

If the grid power comes back, the on the fly created scene is recovered and all is fine :slight_smile:

…but now I was thinking about what will happen if the power does NOT come back and my battery is running out of energy?..at least at some point of < 10% battery power I would start shutting down even my home assistant server - and loose the on the fly scene with this :frowning:

So I would have to “restore” all states out of my mind …and I don’t think that would be great.
How are you handling cases like these? Do you have solutions like this in place?

I was thinking about taking an “emergency backup” at the 10% level, and restore this with an automation as soon as HA comes back on. What do you think is this a good / bad idea?
(I would have to test if an on the fly create scene is included within home assistant)

Open for any discussion, ideas or suggestions - not directly trying to solve my case…just want to exchange thoughts