"Heavy Usage" Device Management

Context: Where I live it is common for the power to go out more than once a day for periods of 2-4 hours at a time. I have solar with battery backup. As it stands, I have automated “heavy usage” devices to switch off when the power goes out so that I don’t drain the batteries too quickly - things like geysers, pool pump, tumble dryer, etc. I have already set up sensors to work out what the remaining runtime is on the current load (n hours), taking into account the battery charge and the current solar production.

Requirement: I would like to develop logic to manage these “heavy usage” devices in a smart way. What I would like is for the system to automatically decide if “heavy devices” can still be on during a power outage based on the current solar production and battery storage.

Ideas: What I have in mind (although open to other suggestions) is that I would like to set some sort of threshold to say I only want “heavy devices” to operate if I have more than 4 hours of remaining runtime available on current load. The trick is though that if a new “heavy device” is turned on, then the remaining runtime will reduce again (obviously because the current load will increase), so I will need logic around that - I was thinking of setting an upper and lower limit - i.e. turn a heavy device on if remaining runtime is greater than 5 hours, and turn it off if I go below 4 hours. It gets more complicated when you want to manage more than one device though - one has to decide on some sort of priority of which device can run and which can’t, depending on available power / remaining runtime.

Any ideas or suggestions on how to manage this?

I found this post that relates to this which is very helpful - I will try it out and see if it meets my requirement…

Offline Solar forecast / battery state forecast - integration - Energy - Home Assistant Community (home-assistant.io)