Solar automation for EV. Latching onto a solar state

Hi,

I’m new here, so I apologies if this is a Nooooooob question.

I have a Huawei 8kW Inverter with 15kw batteries. Maximum charge/discharge is restricted by the manufacturer to 5kW

This is what I’m trying to achieve:
Trigger: Solar production is over 4000w.
Action: Activate state called “sunny”
Trigger: Solar production is under 4000w for 60minutes
Action: Deactivate state called “sunny”

My question is: How do I create “sunny” state in Home Assistant as I wish to latch onto this state to a condition:

WHEN “Sunny” is active
AND “homeBattery” is low
THEN “EV Charger” change mode to Eco

Thanks in advance