How to Control Smart Switches for an Off-Grid System to get the Maximum Energy from a PV inverter?

I have published at https://ab.bapha.be/posts/20260908/ how I use openHAB to turn on and off loads, in order to get the maximum energy from a PV inverter. I have included fully functional example, described also why all the mentioned tweaks exist and why this approach is not ideal.

What logic do others use to get the maximum possible energy from a PV-inverter in an off-grid system? I am really interested to read other approaches.

yeah interesting writeup. i usually do something dumber than your approach: hysteresis on inverter watts plus a short settle timer so loads dont chatter when clouds flicker. your pv-max chasing logic is cleaner than the on/off bang bang i started with.

one thing that bit me: if a load is already on and production dips, turning it off too fast just wastes the ramp. a 30-60s delay before shedding helped more than fancy math.

hysteresis on inverter watts plus a short settle timer so loads dont chatter when clouds flicker. your pv-max chasing logic is cleaner than the on/off bang bang i started with.

How is this supposed to work? When there is no consumption and the battery is full, the inverter watts (input from PV) decrease, because the power cannot go anywhere. This can last forever - until load is attached or sunset.

Waiting 60 seconds before acting to avoid cloud flicker is reasonable for air conditioners, which need minutes to start.

But it makes no sense for stoves or heating resistors, as taking energy from the battery - caused by the 30 seconds delay - and putting later that energy back in the battery, does lose part of the energy.