Any integrations/blueprints to optimize Solar powerusage?

Hello there,

my parents have a pretty big solar power plant on their roof.
In an effort to optimize the consumption of self produced power, I created some automations that would enable/disable electric heating fans in when the house was cold enough.
Now they got a heat pump system installed (Mitsubishi) and since the old automations were a huge mess of if/when/else to optimize the power usage, I wondered if there was a script/blueprint or integration that could optimize this.
E.g. where scenes paired with consumptions could be added and then enabled by HA on demand to use as much of the generated power as long as there was heating demand.

I’m in the proces of installing a Mitsubishi heatpump as well. It isn’t running yet, but I’ve given the integration in HA some thought allready. Same situation; a lot of solar power which should be used for own consumption as much as possible.
The main difference with electric heating fans is, that you can’t just turn a heatpump off (you could but it’s very bad for the inner parts life time). So the way I’m probably going to do it is as follows:

  • integrate the heatpump in HA and set up a climate control for it

  • whenever there is enough power, increase the target temperature of the climate

  • make sure if a target temp is set, it will remain in that setting for at least 30min to an hour to prevent cycling with cloudy wheather.

  • whenever there is no longer enough solar power and the timer has run out the heatpump can resume it’s usuall routine (i.e. it’s normal temperature is set again).

I have also installed a Shelly EM to measure the power.
My parents heat pump comes with 4 room units, and the pump itself cannot be influenced directly, at least as far as I know.
So I guess the first step for me will be to find out what the smallest possible power point is (assumed ~600 W) and how it can be best influenced (e.g. setting target temperature just above the current room temperature).

The units come with MELcloud WiFi modules, so influencing them should be easy.
My idea for the “manual” way was to create scenes for different power levels and then switch amongst them to fir the current available power envelope.

I basically did the same for the heating fans too (3 of them )

and it worked quite well, mostly because their consumption is so predictable.
But I had hoped that someone already did something similar in the past…