Use Amber Electric Forecast to Optimize what hours are selected for pool pump each day

So, a question up front: does your setup need to run for 8 hours continuously or can it be split up into 30 minute blocks?

The current SmartShift algorithm does the latter. It basically runs a planner that works out when the best time of the day will be run, and tries to stick to that unless things change too much. You will have a problem where a majority of the running will be at the end of the day, because you hit a point where you have to run the pump because there aren’t enough 30-minute slots left.

A simplier way to start with is set a threshold price “if the price is cheaper then this, run it”. DMO price is a good starting place.

You’ll need to setup a sensor that tracks how many hours the pump has run today, and a second sensor that calculates the average forecast for the remaining time (ie, already run for 2 hours? Average the next 6 hours)

If the average is less than your threshold and there is still pumping to do, keep running. If not turn off for a bit.

There is still a bit there but I believe YAML automations could do all that. Can you template from an array of attributes? Is a good starting point