Sorry to necro this, but I wanted to do the same thing.
I successfully solved the problem via this 'SwitchBot' device:
https://www.amazon.com/gp/product/B07B7NXV4R/
The app only lets you schedule 5 "on/off" cycles per day, so I had to buy their 'Hub' as well, and then I integrated that with...