Solar panels and warm pump

have a solar panels and a warm pump.

I have no knowledge of home assistant at all. But is the wolling posible:
for example, when there is plenti of sun and the solar panels generate 1.5 kWh of electricity, the heat pump automatically starts up with the 2 indoor units in the living area at 22° and when there is no more than 1.2 kWh, the indoor units switch off.
And that form November to March. And the other moments use the schedule

without details of the make/model of product it is hard to tell.

Generally, Yes, monitoring the state of sun or the electrical output of solar system can be done using multiple methods.

Turning a heat pump on or off based on the state of another device may also be done.

A conditional automation may be used to control ON/OFF based on panel output and/or Time of day/year.

Devices such as esp32 used with esphome are generally useful for interfacing with products or there may be an integration available that monitors and controls your devices.

I had a Solaris convertor for my sun panels
A Daikin heat pump

Model is handy to know also.