Thanks guys, will look into this!
Im setting up a smart EV charging plan with this flow.
From the moment I plug the car I dont care when it charges as long as its charged by 9 am.
I can calculate how many hours of charge are required but still need to find that # of cheapest hours within the period from “now” and 9 am.
Also, I am running a peak shaving program so the charging speed may be drastically reduced to allow for heating to run. Each time the charging current is changed I need to update the charging plan (hence update the period duration).
I hope it makes sense