I created a smart app here that controls when and how long a pool pump will run based on the month. In the future, I hope to add to it to use the average temperature during the day to control how long it runs, but this is good enough for right now.
https://raw.githubusercontent.com/napalmcsr/Hubitat_Napalmcsr/master/Apps/PoolController/PoolController.src
I am using a GE Z-wave pool controller. but this should work on any switch.