Can Home Assistant also be used for smart grid?

I now have several smart devices with different apps. I now want to go to one platform and am considering Home Asistent. Now I have a question. We have a heat pump and solar panels. I would like the heat pump to mainly run when solar energy is generated. So a smart grid system. Also that the washing machine is turned on (with a smart socket) when electricity is generated. Can HA provide for this? My heat pump also needs a connection to the smart grid to know that it has to turn on. Are there options for all this within HA or is a connection possible with a smart grid system and if so, which one? Thanks in advance for your thoughts.

Yes you can, depending on your hardware of course.
There are many solutions how to do that. The most compatible way is to get a shelly 3em and a shelly for your smart grid interface. Then you just need to make an automation like when PV export is higher than 1 kW then turn smart grid on.
A better solution would be modbus when your heat pump and inverter support that. Then you dont need extra hardware and sometime heat pumps allow writing the export in a register.
For more specific help post your setup components.
The good thing about home assistant is that you can buy basically any hosting hardware and if it just doesnt work for you, you just use the hardware for other things. And if you just want to test it, use one of your current machines with a docker container. The migration later to a standalone server is easy.