Wyze Plug: power cycle on loss of internet connection

My modem degrades over time and needs a reboot from time to time. The speeds get slow. So a ping to the outside not sure that would work but if I could Schedule a reboot of the plug that would work perfectly.