Excess Solar to Switch Smart Plug - Reading Efergy Power Consumption

I hope I’m posting this in the right place, if not I apologise and would appreciate the redirection.

I’ve recently become aware of Home-Assistant and reading about it like what I see. Before I get into it I’d like to know it can do what I’d like it to.

The initial use is to control a Smart Plug which has an EV charger plugged into it, when there is sufficient Solar generation, which is monitored with 2 sensors (Solar and Total Load) on an Efergy system.

I’d like the plug to switch on when the Solar > 1.5 KWH and Total Load < 2.5KWH
Switch off if the load exceeds 2.5KWH or Solar generation is less than 1.5KWH
Only operating between 9am and 5pm.

The plug will be switched on between 9pm and 7am

I’m not sure if this will need anything other than the Efergy Integration and an Smart Plug integration.
Can the Efergy integration monitor and create these triggers.

Thanks.

Is there any automation of this type?
Thanks in advance.