Schedule ESS charging at low energy price and solar forecast?

Currently my setup is running in ESS mode. On some days there is not enough solar generation to bring the batteries back to 100%. I’m playing with Node RED and would like to achieve something like:

If expected solar less than X kW
Determine lowest energy price for Y hours.
Set Charging Schedule to charged from Grid ad lowest energy price time and Y duration.
End

Determining the expected solar is possible through the VRM API and “Solar Yield Forecast”.
How can I determine the lowest energy price? I’m using Zonneplan with dynamic contract.